From owner-freebsd-current Mon Sep 9 12:04:12 1996 Return-Path: owner-current Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id MAA12041 for current-outgoing; Mon, 9 Sep 1996 12:04:12 -0700 (PDT) Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.19]) by freefall.freebsd.org (8.7.5/8.7.3) with SMTP id MAA12025 for ; Mon, 9 Sep 1996 12:04:05 -0700 (PDT) Received: (from bde@localhost) by godzilla.zeta.org.au (8.6.12/8.6.9) id FAA24911; Tue, 10 Sep 1996 05:02:22 +1000 Date: Tue, 10 Sep 1996 05:02:22 +1000 From: Bruce Evans Message-Id: <199609091902.FAA24911@godzilla.zeta.org.au> To: freebsd-current@freebsd.org, swallace@ece.uci.edu Subject: Re: Object directory changes to make Sender: owner-current@freebsd.org X-Loop: FreeBSD.org Precedence: bulk >I like the new functionality for building the source trees, but >I do not like removing the old functionality either. Therefore, >I made changes to make so that it will accompish both. So did I :-). >First make will search for MAKEOBJDIR.machine, then MAKEOBJDIR, >as previously done. Then if both failed it will search for >MAKEOBJDIRPREFIX/`cwd`/machine and then MAKEOBJDIRPREFIX/`cwd`. >If all fails the cwd is used. I use an environment variable MAKEOBJTREE instead of the hard coded prefix MAKEOBJDIRPREFIX. Experience showed: 1) The environment variable is too inconvenient (as expected). It will have to be hard-coded for a transitional period until it can be read from an include file (`make' now doesn't read include files until after it decides the object dir. This behaviour is fundamental because ifdefs etc. to control the reading of include files may depend on the object dir). 2) There should be no slash between MAKEOBJDIRPREFIX and `cwd`. `cwd` begins with a slash (except possibly when it is actually $PWD), and the extra slash is unnecessary if MAKEOBJDIRPRFIX is nonempty and a bug otherwise. 3) .TARGETOBJDIR is bogus and unnecessary. bsd.obj.mk can easily concatenate ${MAKEOBJDIRPREFIX} and ${.CURDIR} itself provided it knows ${MAKEOBJDIR}. It needs to do this to get an unambiguous path. Chdir checks in `make' don't work because the name of the path must not depend on the existence of the path. This seems to be quite broken in your version. .TARGETOBJDIR is set ${path}.${MACHINE}, where ${path} is ${MAKEOBJDIR} if that is set in the environment, else "obj". This seems to break both the new and the old tree names. 4) MAKEOBJDIRPREFIX is a better name than MAKEOBJTREE. 5) .${MACHINE} causes similar problems to ${MAKEOBJTREE}/. It should be a general suffix, named ${MAKEOBJDIRSUFFIX} and any necessary punctuation (usually "."; perhaps "/") should be part of the suffix. It should not be decided inside `make'. 6) `make's builtin search path should go away. The effect of its builtin "obj" path can easily be obtained using the new MAKEOBJDIRPREFIX. It probably isn't necessary for the prefix to actually be a search path, and the ambiguity for a path usually gets in the way. Overriding the prefix is probably good enough doing local changes. MAKEOBJDIR didn't work before, so it won't be missed. Bruce