Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 27 Jun 1996 20:12:55 +1000
From:      Bruce Evans <bde@zeta.org.au>
To:        bde@zeta.org.au, freebsd-current@FreeBSD.ORG, mark@linus.demon.co.uk, nate@sri.MT.net
Subject:   Re: Building inside of /usr/src?
Message-ID:  <199606271012.UAA05121@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
>> Fix: restore the old behaviour of make and introduce a new environment
>> variable MAKEOBJTREE to control the new behaviour.  The priorities should
>> be:
>> 
>> 	$MAKEOBJDIR		(if MAKEOBJDIR is set) (highest)
>> 	obj.$machine
>> 	obj
>> 	$MAKEOBJTREE/`pwd`	(if MAKEOBJTREE is set)
>> 	.

>I dislike the redundant MAKEOBJTREE (since BSDOBJDIR already contains
>that location).  Actually, isn't the only thing required here a *boolean*
>variable, complementary to NOOBJ and NOOBJLINK in bsd.obj.mk?

MAKEOBJTREE is named to suggest that it belongs to make(1).  BSDOBJDIR
was only a little-known variable in the (Free?)BSD makefiles.  Now it is
only a little-used variable in bsd.port.mk.  There has to be such a
(tree) variable if make knows nothing about object trees.  The reason
for putting this knowledge in make is that builtins are easier to use.
Getting the current behaviour using the old MAKEOBJDIR semantics would
involve lots of substitutions:

MAKEOBJDIR=	${.CURDIR:S;^;/usr/obj;}		# current behaviour
MAKEOBJDIR=	${.CURDIR:S;^/usr/src;/usr/obj;}	# old behaviour
MAKEOBJDIR=	${.CURDIR:S${BSDOBJTREESUBST}}	# I couldn't get this to work

Hmm, this isn't very hard.  Put this in bsd.src.mk (a new file that
centralizes common stuff for building /usr/src) and avoid touching make(1)
or *.mk.  Why did the old way use all those shell commands with pwd's? :-)

Bruce



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199606271012.UAA05121>