From owner-freebsd-current@FreeBSD.ORG Sun Jan 25 13:14:55 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EF9E716A4CE for ; Sun, 25 Jan 2004 13:14:55 -0800 (PST) Received: from phantom.cris.net (phantom.cris.net [212.110.130.74]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0C95343D2F for ; Sun, 25 Jan 2004 13:14:52 -0800 (PST) (envelope-from ru@FreeBSD.org.ua) Received: from phantom.cris.net (ru@localhost [127.0.0.1]) by phantom.cris.net (8.12.10/8.12.10) with ESMTP id i0PLFaem068619; Sun, 25 Jan 2004 23:15:36 +0200 (EET) (envelope-from ru@FreeBSD.org.ua) Received: (from ru@localhost) by phantom.cris.net (8.12.10/8.12.10/Submit) id i0PLFZN8068614; Sun, 25 Jan 2004 23:15:35 +0200 (EET) (envelope-from ru) Date: Sun, 25 Jan 2004 23:15:35 +0200 From: Ruslan Ermilov To: Jens Schweikhardt Message-ID: <20040125211535.GC67382@FreeBSD.org.ua> References: <20040125151824.GA79958@schweikhardt.net> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="KDt/GgjP6HVcx58l" Content-Disposition: inline In-Reply-To: <20040125151824.GA79958@schweikhardt.net> User-Agent: Mutt/1.5.5.1i cc: current@freebsd.org Subject: Re: make(1) and SUBDIR assignments X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Jan 2004 21:14:56 -0000 --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 "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--