Date: Sun, 25 Jan 2004 23:15:35 +0200 From: Ruslan Ermilov <ru@freebsd.org> To: Jens Schweikhardt <schweikh@schweikhardt.net> Cc: current@freebsd.org Subject: Re: make(1) and SUBDIR assignments Message-ID: <20040125211535.GC67382@FreeBSD.org.ua> In-Reply-To: <20040125151824.GA79958@schweikhardt.net> References: <20040125151824.GA79958@schweikhardt.net>
next in thread | previous in thread | raw e-mail | index | archive | help
--KDt/GgjP6HVcx58l Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Jan 25, 2004 at 04:18:24PM +0100, Jens Schweikhardt wrote: > hello, world\n >=20 > I'm trying to selectively install binaries in the source tree, i.e. to > only install bin/dd and bin/df this is what I hoped would work: >=20 > root@hal9000:/usr/src # make buildworld # succeeds > root@hal9000:/usr/src # cd bin > root@hal9000:/usr/src/bin # make install SUBDIR=3D'dd df' >=20 > But it fails: >=20 > =3D=3D=3D> dd > "/usr/share/mk/bsd.subdir.mk", line 60: Inconsistent operator for dd > "/usr/share/mk/bsd.subdir.mk", line 66: warning: duplicate script for tar= get "dd" ignored > make: fatal errors encountered -- cannot continue > *** Error code 1 >=20 > Stop in /share/HEAD/src/bin. >=20 >=20 > (-CURRENT sources and /usr/share/mk/* as of today). Is this >=20 > 1) a bug somewhere (though nothings seems to be wrong with bsd.subdir.mk) > 2) me being confused about how SUBDIR is intended to be used > 3) something else >=20 > Yes, I know I can workaround by > cd /usr/src/bin/dd; make install > cd /usr/src/bin/df; make install >=20 > But why do all the src/*/Makefiles assign the list of subdirs to SUBDIR > and DTRT, but I can't from the outside? >=20 Yes, this looks confusing, but here's what happens here: in make(1), there are four types of variables, and command-line variables take precedence over local variables, and you use this feature to override the SUBDIR assignment inside the src/bin/Makefile. This works, but what you don't take into an account is that make(1) also saves all command-line assignments in environment and makes them available to its subprocesses, so src/bin/Makefile also gets SUBDIR=3D'dd df', which conflicts with its <bsd.prog.mk> "dd" target. Cheers, --=20 Ruslan Ermilov FreeBSD committer ru@FreeBSD.org --KDt/GgjP6HVcx58l Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (FreeBSD) iD8DBQFAFDH3Ukv4P6juNwoRArwiAJ9jc2Pz1/MI/N8nSuOUKA+gTMgRpACggNYh 9BrYeQXJLi2F1yB+38iWAb0= =M3TO -----END PGP SIGNATURE----- --KDt/GgjP6HVcx58l--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040125211535.GC67382>