From owner-freebsd-current@FreeBSD.ORG Fri Feb 6 08:21:59 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 0528516A4CF for ; Fri, 6 Feb 2004 08:21:59 -0800 (PST) Received: from phantom.cris.net (phantom.cris.net [212.110.130.74]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7B23B43D5E for ; Fri, 6 Feb 2004 08:21:27 -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 i16GM5oh031875; Fri, 6 Feb 2004 18:22:05 +0200 (EET) (envelope-from ru@FreeBSD.org.ua) Received: (from ru@localhost) by phantom.cris.net (8.12.10/8.12.10/Submit) id i16GM5E1031870; Fri, 6 Feb 2004 18:22:05 +0200 (EET) (envelope-from ru) Date: Fri, 6 Feb 2004 18:22:05 +0200 From: Ruslan Ermilov To: Bruce Evans Message-ID: <20040206162205.GC29305@FreeBSD.org.ua> References: <20040206012805.N8113@gamplex.bde.org> <20040205151425.GA18523@FreeBSD.org.ua> <20040206030956.F11456@gamplex.bde.org> <20040205.214341.11990356.imp@bsdimp.com> <20040207023229.L872@gamplex.bde.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Bu8it7iiRSEf40bY" Content-Disposition: inline In-Reply-To: <20040207023229.L872@gamplex.bde.org> User-Agent: Mutt/1.5.5.1i cc: current@freebsd.org Subject: Re: Very long SRCS list with unusually long src/ prefix 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: Fri, 06 Feb 2004 16:21:59 -0000 --Bu8it7iiRSEf40bY Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Feb 07, 2004 at 03:07:55AM +1100, Bruce Evans wrote: > On Thu, 5 Feb 2004, M. Warner Losh wrote: >=20 > > In message: <20040206030956.F11456@gamplex.bde.org> > > Bruce Evans writes: > > : > > % + (cd ${.CURDIR}; ${MAKE} _mkdep_cS) | xargs env \ > > : > > % + ${MKDEPCMD} -f ${DEPENDFILE} -a ${MKDEP} \ > > : > > % + ${CFLAGS:M-nostdinc*} ${CFLAGS:M-[BID]*} > > : > > > > : > > make uses a real shell, so the env shouldn't be needed. > > : > > > > : > $ echo foo.c | xargs CC=3Dcc mkdep > > : > xargs: CC=3Dcc: No such file or directory > > : > > : $ echo foo.c | CC=3Dcc xargs mkdep > > > > But MKDEPCMD is 'CC=3Dcc mkdep', so the env is needed... Unless there's > > a MKDEPCMD_ENV variable... >=20 > I missed the mkdep in MKDEPCMD. MKDEPCMD is actually just mkdep in the > usual case and "CC=3D'${CC}' mkdep" in the ${CC} !=3D "cc" case. Putting > args in the macro for the command is mostly foot shooting here. > Kernel makefiles handle this better. >=20 This works slightly better: %%% Index: bsd.dep.mk =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/ncvs/src/share/mk/bsd.dep.mk,v retrieving revision 1.45 diff -u -r1.45 bsd.dep.mk --- bsd.dep.mk 27 Jan 2004 23:22:15 -0000 1.45 +++ bsd.dep.mk 6 Feb 2004 11:53:48 -0000 @@ -19,6 +19,8 @@ # # MKDEPCMD Makefile dependency list program [mkdep] #=20 +# MKDEPENV Environment for ${MKDEPCMD} [not set] +#=20 # SRCS List of source files (c, c++, assembler) # # DPSRCS List of source files which are needed for generating @@ -49,10 +51,11 @@ HTAGSFLAGS?=3D =20 .if ${CC} !=3D "cc" -MKDEPCMD?=3D CC=3D'${CC}' mkdep +MKDEPENV?=3D CC=3D'${CC}' .else -MKDEPCMD?=3D mkdep +MKDEPENV?=3D .endif +MKDEPCMD?=3D mkdep DEPENDFILE?=3D .depend =20 # Keep `tags' here, before SRCS are mangled below for `depend'. @@ -126,24 +129,35 @@ # Different types of sources are compiled with slightly different flags. # Split up the sources, and filter out headers and non-applicable flags. DPSRCS+=3D ${SRCS} + +_mkdep_cS: ${DPSRCS:M*.[cS]:S/^/_mkdep_/} +_mkdep_cc: ${DPSRCS:M*.cc:S/^/_mkdep_/} ${DPSRCS:M*.C:S/^/_mkdep_/} \ + ${DPSRCS:M*.cpp:S/^/_mkdep_/} ${DPSRCS:M*.cxx:S/^/_mkdep_/} +_mkdep_m: ${DPSRCS:M*.m:S/^/_mkdep_/} +.for f in ${DPSRCS:M*.[cS]} ${DPSRCS:M*.cc} ${DPSRCS:M*.C} ${DPSRCS:M*.cpp= } \ + ${DPSRCS:M*.cxx} ${DPSRCS:M*.m} +_mkdep_${f}: ${f} + @echo ${.ALLSRC} +.endfor + ${DEPENDFILE}: ${DPSRCS} rm -f ${DEPENDFILE} .if !empty(DPSRCS:M*.[cS]) - ${MKDEPCMD} -f ${DEPENDFILE} -a ${MKDEP} \ - ${CFLAGS:M-nostdinc*} ${CFLAGS:M-[BID]*} \ - ${.ALLSRC:M*.[cS]} + (cd ${.CURDIR}; ${MAKE} _mkdep_cS) | ${MKDEPENV} xargs \ + ${MKDEPCMD} -f ${DEPENDFILE} -a ${MKDEP} \ + ${CFLAGS:M-nostdinc*} ${CFLAGS:M-[BID]*} .endif .if !empty(DPSRCS:M*.cc) || !empty(DPSRCS:M*.C) || !empty(DPSRCS:M*.cpp) |= | \ !empty(DPSRCS:M*.cxx) - ${MKDEPCMD} -f ${DEPENDFILE} -a ${MKDEP} \ - ${CXXFLAGS:M-nostdinc*} ${CXXFLAGS:M-[BID]*} \ - ${.ALLSRC:M*.cc} ${.ALLSRC:M*.C} ${.ALLSRC:M*.cpp} ${.ALLSRC:M*.cxx} + (cd ${.CURDIR}; ${MAKE} _mkdep_cc) | ${MKDEPENV} xargs \ + ${MKDEPCMD} -f ${DEPENDFILE} -a ${MKDEP} \ + ${CXXFLAGS:M-nostdinc*} ${CXXFLAGS:M-[BID]*} .endif .if !empty(DPSRCS:M*.m) - ${MKDEPCMD} -f ${DEPENDFILE} -a ${MKDEP} \ + (cd ${.CURDIR}; ${MAKE} _mkdep_m) | ${MKDEPENV} xargs \ + ${MKDEPCMD} -f ${DEPENDFILE} -a ${MKDEP} \ ${OBJCFLAGS:M-nostdinc*} ${OBJCFLAGS:M-[BID]*} \ - ${OBJCFLAGS:M-Wno-import*} \ - ${.ALLSRC:M*.m} + ${OBJCFLAGS:M-Wno-import*} .endif .if target(_EXTRADEPEND) _EXTRADEPEND: .USE %%% --=20 Ruslan Ermilov FreeBSD committer ru@FreeBSD.org --Bu8it7iiRSEf40bY Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (FreeBSD) iD8DBQFAI78tUkv4P6juNwoRAmXMAJ4/2pKjDMDNwIcHTSxsij52y9gUhQCggz94 ukhTpTQepnLQb7asHPcEqjE= =9AtM -----END PGP SIGNATURE----- --Bu8it7iiRSEf40bY--