Date: Thu, 5 Feb 2004 17:14:25 +0200 From: Ruslan Ermilov <ru@FreeBSD.org> To: Bruce Evans <bde@zeta.org.au> Cc: current@FreeBSD.org Subject: Re: Very long SRCS list with unusually long src/ prefix Message-ID: <20040205151425.GA18523@FreeBSD.org.ua> In-Reply-To: <20040206012805.N8113@gamplex.bde.org> References: <20040205091634.GC13932@FreeBSD.org.ua> <20040206012805.N8113@gamplex.bde.org>
next in thread | previous in thread | raw e-mail | index | archive | help
--rwEMma7ioTxnRzrJ
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
On Fri, Feb 06, 2004 at 01:40:45AM +1100, Bruce Evans wrote:
> On Thu, 5 Feb 2004, Ruslan Ermilov wrote:
[...]
> % +.for f in ${DPSRCS:M*.[cS]} ${DPSRCS:M*.cc} ${DPSRCS:M*.C} ${DPSRCS:M*=
=2Ecpp} \
> % + ${DPSRCS:M*.cxx} ${DPSRCS:M*.m}
> % +_mkdep_${f}: ${f}
> % + @echo ${.ALLSRC}
> % +.endfor
>=20
> This seems to run echo once for each file separately. It should be deemed
> inefficient :-).
>=20
But that's what this patch basically does: it splits possibly very
long ${.ALLSRC} list into pieces. It's very inefficient only in
traditional mode. Run this with and without -j1 to see the diff:
: COUNT!=3D jot 1000
:=20
: all:
: .for foo in ${COUNT}
: @echo $$$$ >/dev/null
: .endfor
> I can't see anything better using current make features. The make -V hack
> doesn't work with local variables.
>=20
Yes, because -V is meaningless with local variables.
> This and some other things would be easier and more efficient if make
> had a builtin echo. Then we could just use "builtin_echo ${.ALLSRC:M*.[c=
S]}
> | mkdep ..." in the rules below, and the make -V hack would not be needed
> in kern.post.mk.
>=20
Yeah.
> % ${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) | xargs env \
> % + ${MKDEPCMD} -f ${DEPENDFILE} -a ${MKDEP} \
> % + ${CFLAGS:M-nostdinc*} ${CFLAGS:M-[BID]*}
>=20
> make uses a real shell, so the env shouldn't be needed.
>=20
$ echo foo.c | xargs CC=3Dcc mkdep
xargs: CC=3Dcc: No such file or directory
Cheers,
--=20
Ruslan Ermilov
FreeBSD committer
ru@FreeBSD.org
--rwEMma7ioTxnRzrJ
Content-Type: application/pgp-signature
Content-Disposition: inline
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (FreeBSD)
iD8DBQFAIl3RUkv4P6juNwoRAvuOAJ9h9OtYpk4fkuIOwzEGFozF52SkHgCfaVq3
yQSXqcMqW7424ILMK+U93Gc=
=BB31
-----END PGP SIGNATURE-----
--rwEMma7ioTxnRzrJ--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040205151425.GA18523>
