From owner-freebsd-current Mon Sep 9 14:18:00 1996 Return-Path: owner-current Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id OAA19837 for current-outgoing; Mon, 9 Sep 1996 14:18:00 -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 OAA19827 for ; Mon, 9 Sep 1996 14:17:49 -0700 (PDT) Received: (from bde@localhost) by godzilla.zeta.org.au (8.6.12/8.6.9) id HAA27432; Tue, 10 Sep 1996 07:00:19 +1000 Date: Tue, 10 Sep 1996 07:00:19 +1000 From: Bruce Evans Message-Id: <199609092100.HAA27432@godzilla.zeta.org.au> To: bde@zeta.org.au, swallace@ece.uci.edu Subject: Re: Object directory changes to make Cc: freebsd-current@freebsd.org Sender: owner-current@freebsd.org X-Loop: FreeBSD.org Precedence: bulk >>>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. Why .machine in one case and /machine in the other case? >> 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. >I put that there for easy reading...not in code. OK. >> 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. >> >I agree it should be done away with. Do we want to do that now? Just don't use it for now. >> 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'. >Huh? `make' is sure to use "." when you want "/", etc. The naming policy shouldn't be there. >> 6) `make's builtin search path should go away. The effect of its >It would be nice if the object directory could be set by the makefile >or an include file, but until then the search path is needed. >With MAKEOBJDIRPREFIX, MAKEOBJDIR is not needed to build the src tree. >However, it is still needed for compatability for other trees users >have built using previous FreeBSD releases. Except it didn't work :-). It worked if it was a relative path, but MAKEOBJDIR=/any resulted in objdir == obpath == "" after a successful chdir(path) in the non-mdpath case. >I am confused. What would you like to do? >I would like to put my changes into place until major changes >to allow the makefile/include to determine the object directory. Just make some minor changes: 1) Nuke .TARGETOBJDIR. It can be defined as .TARGETOBJDIR= ${MAKEOBJTREE}${.CURDIR} for a quick fix (it should be renamed CANONICALOBJDIR or something like that). 2) Give MAKEOBJDIRPREFIX priority over both the "obj" and the "/usr/obj" prefixes. 3) Warn in a central makefile when ${.OBJDIR} != ${CANONICALOBJDIR} (&& maybe ${.OBJDIR} != ${.CURDIR} or maybe if ${.OBJDIR} = ${.CURDIR}/obj). This will be useful for detecting stale ./obj directories and links. If you really want to use a nonstandard CANONICALOBJDIR and not get a warning, then you can set MAKEOBJDIR or MAKEOBJDIRPREFIX. I like to a ./obj directory for debugging without touch the object tree, and a warning for the ./obj's that I forget about would be useful. Bruce