Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 18 Aug 2004 10:25:32 +0200 (CEST)
From:      Harti Brandt <harti@freebsd.org>
To:        Ruslan Ermilov <ru@freebsd.org>
Cc:        ports-committers@freebsd.org
Subject:   Re: cvs commit: ports/java/jdk14 Makefile
Message-ID:  <20040818102107.S872@beagle.kn.op.dlr.de>
In-Reply-To: <20040818081702.GB91053@ip.net.ua>
References:  <200408180706.i7I763ps032344@repoman.freebsd.org> <20040818081702.GB91053@ip.net.ua>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 18 Aug 2004, Ruslan Ermilov wrote:

RE>On Wed, Aug 18, 2004 at 07:06:03AM +0000, Greg Lewis wrote:
RE>> glewis      2004-08-18 07:06:03 UTC
RE>> 
RE>>   FreeBSD ports repository
RE>> 
RE>>   Modified files:
RE>>     java/jdk14           Makefile 
RE>>   Log:
RE>>   . The changes to make in -CURRENT to use MAKEFLAGS make us unable to
RE>>     override the MAKEFLAGS ARCH value in the main HotSpot Makefile.  Fix
RE>>     this by passing in a blank MAKEFLAGS up front so there is nothing to
RE>>     (try to) override.
RE>>   
RE>>   Submitted by:   truckman
RE>>   Requested by:   kris
RE>>   
RE>>   Revision  Changes    Path
RE>>   1.79      +2 -1      ports/java/jdk14/Makefile
RE>> 
RE>The fix to make(1) was to pass command-line variables as
RE>command-line variables to sub-makes, as required by POSIX.
RE>It's still possible to override anything that you want,
RE>you just need to know well how MAKEFLAGS works.  ;)
RE>
RE>MAKEFLAGS is an *environment* variable that make(1) reads
RE>on startup, and treats its contents as if it was specified
RE>on the command line.
RE>
RE>1. The contents of this environment variable is then entered
RE>as the .MAKEFLAGS *global* variable.
RE>
RE>2. Makefile can modify this global as necessary, either by
RE>modifying the variable directly (including adding to it,
RE>overriding it, or even undefining it with .undef), or thru
RE>the special .MAKEFLAGS macro.
                          ^^^^^ target (see commented out line in Makefile 
below)

RE>
RE>3. When make(1) calls another ${MAKE}, it enters the value
RE>of its global variable .MAKEFLAGS into the environment of
RE>sub-make as the MAKEFLAGS variable.
RE>
RE>Make sure you have the latest make(1), then run this
RE>makefile as ``make all FOO=bar''.  Note the difference
RE>between .MAKEFLAGS variable and a target.
RE>
RE>%%%
RE>.if make(all)
RE>.MAKEFLAGS+=	FOO=foo		# override for submakes only
RE>#.MAKEFLAGS:	FOO=foo		# override for myself and submakes
RE>all:
RE>	@echo "${.TARGET}'s idea of FOO: ${FOO}"
RE>	@echo .MAKEFLAGS=${.MAKEFLAGS}
RE>	@cd ${.CURDIR} && ${MAKE} submake
RE>.endif
RE>
RE>.if make(submake)
RE>submake:
RE>	@echo "${.TARGET}'s idea of FOO: ${FOO}"
RE>	@echo .MAKEFLAGS=${.MAKEFLAGS}
RE>.endif
RE>%%%
RE>
RE>
RE>Cheers,

This is an excellent explanation. Perhaps we can put part of it into 
make(1)?

harti



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040818102107.S872>