Date: Sun, 14 Jul 1996 21:36:37 +0000 From: mark@linus.demon.co.uk (Mark Valentine) To: Bruce Evans <bde@zeta.org.au>, pst@freefall.freebsd.org Cc: hackers@freebsd.org Subject: Re: cvs commit: src/share/mk bsd.obj.mk Message-ID: <199607142136.VAA02271@linus.demon.co.uk> In-Reply-To: Bruce Evans's message of Jul 14, 12:45pm
next in thread | raw e-mail | index | archive | help
> From: Bruce Evans <bde@zeta.org.au> > Date: Sun 14 Jul, 1996 > Subject: Re: cvs commit: src/share/mk bsd.obj.mk > >For example, for /usr/src/games/boggle/Makefile: > > > MKDICTOBJ != cd ${.CURDIR}/mkdict; make -V .OBJDIR > > MKINDXOBJ != cd ${.CURDIR}/mkindex; make -V .OBJDIR > > > MKDICT = ${MKDICTOBJ}/mkdict > > MKINDX = ${MKINDXOBJ}/mkindex > > >The old version of the Makefile failed for most obj directory configurations; > >the -current version of the Makefile (and the new build system in general) only > >allows one (broken) way to do obj directories. > > I think the old way worked provided the source directories contained the > correct obj links. (Or indeed with none at all, or with obj directories instead of links.) It would break for people using the Makefile in other source trees, or for anyone who fixed the FreeBSD build system to work with arbitrary values of MAKEOBJDIR (no, I haven't done this...), or even to allow multi-platform obj directories. > I think the above method is too slow except in special > cases. It is probably most useful for nightmare cases like tn3270. Sure, it's slower than I would like a good fix to be, but _too_ slow? (Bruce will now give an example where it slows the build down by a large fraction of 1%. :-) It's a bit faster than the solution which I saw in the random OpenBSD makefile (the first one I looked at - I don't have OpenBSD or NetBSD sources to hand to see if it's the solution they use throughout). The following version has less bugs (it assumes MAKEOBJDIR is the same for each directory), but I prefer the slow way to .if spaghetti! .if defined(MAKEOBJDIR) MKDICT= ${.CURDIR}/mkdict/${MAKEOBJDIR}/mkdict .elif exists(${.CURDIR}/mkdict/obj.${MACHINE}) MKDICT= ${.CURDIR}/mkdict/obj.${MACHINE}/mkdict .elif exists(${.CURDIR}/mkdict/obj) MKDICT= ${.CURDIR}/mkdict/obj/mkdict .else MKDICT= ${.CURDIR}/mkdict/mkdict .endif .if defined(MAKEOBJDIR) MKINDX= ${.CURDIR}/mkindex/${MAKEOBJDIR}/mkindex .elif exists(${.CURDIR}/mkindex/obj.${MACHINE}) MKINDX= ${.CURDIR}/mkindex/obj.${MACHINE}/mkindex .elif exists(${.CURDIR}/mkindex/obj) MKINDX= ${.CURDIR}/mkindex/obj/mkindex .else MKINDX= ${.CURDIR}/mkindex/mkindex .endif Cheers, Mark. -- Mark Valentine at Home <mailto:mv@pobox.com> <http://www.pobox.com/~mv/>
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199607142136.VAA02271>