On Mon, May 13, 2002 at 08:41:11PM +0200, John Hay wrote: > Hi, > > It looks like the makefiles are a bit broken if make -j13 is used. What > I see here is that osreldate.h in obj/usr/src/i386/usr/include/ looks > like this: > > ############################ > ... > #ifdef _KERNEL > #ifdef _KERNEL > #error "/usr/include/osreldate.h cannot be used in the kernel, use sys/param.h" > #error "/usr/include/osreldate.h cannot be used in the kernel, use sys/param.h" > #else > #else > #undef __FreeBSD_version > #undef __FreeBSD_version > #define __FreeBSD_version 500035 > #define __FreeBSD_version 500035 > #endif > #endif > ############################ > > When looking at the output of "make -j13 world", it looks like some parts > are being run more than once: > > ############################ > -------------------------------------------------------------- > >>> stage 4: populating /usr/obj/usr/src/i386/usr/include > -------------------------------------------------------------- > cd /usr/src; MAKEOBJDIRPREFIX=/usr/obj MACHINE_ARCH=i386 MACHINE=i386 OBJFORM > AT_PATH=/usr/obj/usr/src/i386/usr/libexec PERL5LIB=/usr/obj/usr/src/i386/usr/li > bdata/perl/5.6.1 GROFF_BIN_PATH=/usr/obj/usr/src/i386/usr/bin GROFF_FONT_PATH= > /usr/obj/usr/src/i386/usr/share/groff_font GROFF_TMAC_PATH=/usr/obj/usr/src/i38 > 6/usr/share/tmac DESTDIR=/usr/obj/usr/src/i386 INSTALL="sh /usr/src/tools/inst > all.sh" PATH=/usr/obj/usr/src/i386/usr/sbin:/usr/obj/usr/src/i386/usr/bin:/usr/ > obj/usr/src/i386/usr/games:/sbin:/bin:/usr/sbin:/usr/bin make -f Makefile.inc1 S > HARED=symlinks includes incsinstall > ===> share/info > ===> share/info > ===> include > ===> include > Setting up symlinks to kernel source tree... > ############################ > I also see the breakage with -j8 "make release", but in a different place, while building "krb5" dist. I'm currently testing this patch.
%%% Index: Makefile.inc1 =================================================================== RCS file: /home/ncvs/src/Makefile.inc1,v retrieving revision 1.273 diff -u -r1.273 Makefile.inc1 --- Makefile.inc1 12 May 2002 16:00:43 -0000 1.273 +++ Makefile.inc1 14 May 2002 06:32:01 -0000 @@ -299,7 +299,7 @@ @echo "--------------------------------------------------------------" @echo ">>> stage 4: populating ${WORLDTMP}/usr/include" @echo "--------------------------------------------------------------" - cd ${.CURDIR}; ${WMAKE} SHARED=symlinks includes incsinstall + cd ${.CURDIR}; ${WMAKE} includes; ${WMAKE} SHARED=symlinks incsinstall _libraries: @echo @echo "--------------------------------------------------------------" %%% Now I know why running "make all install" is not a good idea (in the -j case). ``.ORDER: all install'' or ``.ORDER: includes incsinstall'' do not work because these do not cause the necessary ordering for sub-dependents. What I mean here is that: all: ${PROG} ${SCRIPTS} ${FILES} _includes _manpages install: realinstall realinstall: _proginstall _scriptsinstall _filesinstall _incsinstall _maninstall And ``.ORDER: all install'' does not cause e.g. _includes and _incsinstall to be run in sequence. One might now wonder why not fix it like this: .ORDER: _includes _incsinstall The answer is that makefiles are allowed to redefine "includes" and/or "incsinstall". In that case, _includes and/or _incsinstall won't even be defined, and we'd now have to make sure (in this particular makefile) that "make includes incsinstall" works in -j case by providing the necessary .ORDER'ing, while not running "making" and "installing" parts together in the -j case will "just work". <PS> Bruce, yes I am aware of the problem with _incsinstall attempting to "make" includes if they are not built. I even attempted to fix it like this: %%% .if exists(${file}) _fooinstall: _fooinstall_${file} _fooinstall_${file}: ${file} ${INSTALL} ${.ALLSRC} ... .endif %%% But this unfortunately breaks the common "make all install" case, which is (as should be apparent from the previous paragraph) is just wrong in the -j case. </PS> Cheers, -- Ruslan Ermilov Sysadmin and DBA, [EMAIL PROTECTED] Sunbay Software AG, [EMAIL PROTECTED] FreeBSD committer, +380.652.512.251 Simferopol, Ukraine http://www.FreeBSD.org The Power To Serve http://www.oracle.com Enabling The Information Age
msg38308/pgp00000.pgp
Description: PGP signature