From owner-freebsd-hackers Sun Jul 14 13:37:17 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id NAA15574 for hackers-outgoing; Sun, 14 Jul 1996 13:37:17 -0700 (PDT) Received: from linus.demon.co.uk (linus.demon.co.uk [158.152.10.220]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id NAA15529 for ; Sun, 14 Jul 1996 13:37:08 -0700 (PDT) Received: (from mark@localhost) by linus.demon.co.uk (8.7.5/8.7.3) id VAA02271; Sun, 14 Jul 1996 21:36:37 GMT Message-Id: <199607142136.VAA02271@linus.demon.co.uk> From: mark@linus.demon.co.uk (Mark Valentine) Date: Sun, 14 Jul 1996 21:36:37 +0000 In-Reply-To: Bruce Evans's message of Jul 14, 12:45pm X-Mailer: Mail User's Shell (7.2.6 alpha(3) 7/19/95) To: Bruce Evans , pst@freefall.freebsd.org Subject: Re: cvs commit: src/share/mk bsd.obj.mk Cc: hackers@freebsd.org Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk > From: Bruce Evans > 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