Date: Wed, 10 Jun 2009 18:29:13 +1000 (EST) From: Bruce Evans <brde@optusnet.com.au> To: "Bjoern A. Zeeb" <bz@FreeBSD.org> Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: kmod.mk - modules build framework [was: svn commit: r193818 - head/sys/modules/sound/sound] Message-ID: <20090610175011.E20224@delplex.bde.org> In-Reply-To: <20090609090541.D22887@maildrop.int.zabbadoz.net> References: <200906090903.n5993D3E062579@svn.freebsd.org> <20090609090541.D22887@maildrop.int.zabbadoz.net>
next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 9 Jun 2009, Bjoern A. Zeeb wrote: > On Tue, 9 Jun 2009, Bjoern A. Zeeb wrote: >> Log: >> Depend on @ machine (_ILINKS) as we do with other modules so that @ >> is there for parallel (-jN) builds. Ideally beforedepends in kmod.mk >> should do the right thing but it seems it does not. > > Anyone with lots of build framework know how may want to look at this. Failures only for parallel builds normally mean missing dependencies. >> -feeder_eq_gen.h: >> +feeder_eq_gen.h: @ machine >> ${AWK} -f @/tools/feeder_eq_mkfilter.awk -- ${FEEDER_EQ_PRESETS} > >> ${.TARGET} Here there is still a missing dependency on the @/tools/feeder_eq_mkfilter.awk (fixed in the next commit). This dependency is not very important, but since the utility has "@" in its pathname, running it certainly depends on "@". This missing dependency seems to be a general bug. There is an ordering requirement that beforedepend is before built before ${DEPENDFILE}, but this apparently doesn't extend to ${DEPENDFILE}'s prerequisites, and I don't know of any general way to make it do so and it probably shouldn't do so in general (some of the prerequisites might be needed before beforedepend). In kmod.mk, all generated sources should depend on each link, like all objects do, but modules makefiles have no way of distinguishing generated sources from ordinary ones. > PS: In case you do I'd have another request to be able to have an > option similar to COPTFLAGS that will actually be passed down to > module builds - at least for make buildkernel/universe/.. COPTFLAGS is a mistake, as is setting CFLAGS using "=" in kern.pre.mk. Since kmod.mk doesn't have these mistakes, there is a chance that ordinary setting of CFLAGS works right. It does seem to work right for single module builds. I don't know what happens when modules are built as part of a kernel (maybe kern.pre.mk has already clobbered CFLAGS?), and there is always the problem that it is difficult to control the order of CFLAGS when individual makefiles add to the end of it. kern.pre.mk uses: CFLAGS= ${COPTFLAGS} ${CWARNFLAGS} ${DEBUG} ${COPTS} where ${DEBUG} provides good control since it is almost at the end (${COPTS} only has include paths and some other things that wouldn't be useful to override). Since ${DEBUG} is also passed to modules makefiles (as DEBUG_FLAGS in the environment), it might help. Bruce
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090610175011.E20224>