Date: Thu, 8 Jan 2004 19:57:46 +0200 From: Ruslan Ermilov <ru@FreeBSD.org> To: "Brian F. Feldman" <green@FreeBSD.org> Cc: cvs-all@FreeBSD.org Subject: Re: cvs commit: src/share/mk bsd.obj.mk Message-ID: <20040108175746.GB33759@FreeBSD.org.ua> In-Reply-To: <200401081707.i08H7Wbh011594@green.bikeshed.org> References: <20040108165519.GA33759@FreeBSD.org.ua> <200401081707.i08H7Wbh011594@green.bikeshed.org>
next in thread | previous in thread | raw e-mail | index | archive | help
--yEPQxsgoJgBvi8ip Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jan 08, 2004 at 12:07:32PM -0500, Brian F. Feldman wrote: > Ruslan Ermilov <ru@FreeBSD.org> wrote: > > On Thu, Jan 08, 2004 at 11:36:19AM -0500, Brian F. Feldman wrote: > > > Ruslan Ermilov <ru@FreeBSD.org> wrote: > > > > : $ make MAKE=3D'/usr/bin/make -DFOO' print-make > > > > : /usr/bin/make -DFOO > > > > : $ make MAKE=3D'/usr/bin/make -DFOO' -V MAKE > > > > : make > > > >=20 > > > > If you really need to access command-line arguments, there > > > > is the .MAKEFLAGS variable available for that purpose. > > > >=20 > > > > But why do you need to ``make MAKE=3D'/usr/bin/make -DFOO' bar'' > > > > in the first place instead of simple ``make -DFOO bar''? If > > > > "bar" is recursive (i.e., runs ${MAKE} subprocesses), then > > > > -DFOO will be properly propagated: > > >=20 > > > Think about this: what options to ${MAKE} are there that have nothing= to do=20 > > > with setting defines? There's actually quite a few; the one in parti= cular=20 > > > that I care about is "-f"; if I want to use bsd.subdir.mk to simply a= pply=20 > > > one BSD Makefile to several directions (which I _do_), I need to use = -f,=20 > > > i.e.: > > >=20 > > > MAKE+=3D -f ${.CURDIR}/drivers/Makefile.subdriver > > >=20 > > > The only think that broke this was the cleandir target. > > >=20 > > Then you should be using the .MAKEFLAS variables here, see > > sys/modules/Makefile for one working example, and let me > > know if it works for you. >=20 > Since .MAKEFLAGS is doesn't expand variables, I have to do it this (prett= y=20 > ugly) way: >=20 > .MAKEFLAGS:=3D ${.MAKEFLAGS} -f ${.CURDIR}/drivers/Makefile.subdriver >=20 : # cat Makefile : all: : @cd ${.CURDIR}; ${MAKE} print-foo :=20 : .MAKEFLAGS+=3D FOO=3D${.CURDIR} :=20 : print-foo: : @echo ${FOO} : # make : /tmp > But it does at least work (does it definitely always get added to ${MAKE}= ?).=20 >=20 It's actually in the make(1) manpage: : .MAKEFLAGS : The environment variable MAKEFLAGS may contain anything that : may be specified on make's command line. Its contents are : stored in make's .MAKEFLAGS variable. Anything specified on : make's command line is appended to the .MAKEFLAGS variable : which is then entered into the environment as MAKEFLAGS for : all programs which make executes. > I don't see the bsd.obj.mk change as being anything but slightly more=20 > correct, so I wouldn't see a good reason to remove it either way. I'm gl= ad=20 > we've clarified the issue. >=20 I never said I want the commit to be backed out, did I? ;) I even see it as a slight improvement, but for a reason that is different from what is in the commit log -- it saves one make(1) invocation. I think that a null commit would be in order though. Cheers, --=20 Ruslan Ermilov FreeBSD committer ru@FreeBSD.org --yEPQxsgoJgBvi8ip Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (FreeBSD) iD8DBQE//ZoaUkv4P6juNwoRAqSQAJ9NMo3COJvIaHMC5FX8qW53W0tklgCfWgwF YBBmHyz3aBy+l3BJ/A+ecYI= =M5YK -----END PGP SIGNATURE----- --yEPQxsgoJgBvi8ip--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040108175746.GB33759>