From owner-freebsd-hackers@FreeBSD.ORG Thu Oct 28 19:50:52 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 719F516A4CE for ; Thu, 28 Oct 2004 19:50:52 +0000 (GMT) Received: from mail805.megamailservers.com (mail805.carrierinternetsolutions.com [69.49.106.15]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0AD3C43D2F for ; Thu, 28 Oct 2004 19:50:52 +0000 (GMT) (envelope-from strick@covad.net) X-POP-User: strick.covad.net Received: from mist.nodomain (h-67-101-98-29.snfccasy.dynamic.covad.net [67.101.98.29])i9SC1WUs022885; Thu, 28 Oct 2004 08:01:33 -0400 Received: from mist.nodomain (localhost [127.0.0.1]) by mist.nodomain (8.12.11/8.12.11) with ESMTP id i9SC1WvB002008; Thu, 28 Oct 2004 05:01:32 -0700 (PDT) (envelope-from dan@mist.nodomain) Received: (from dan@localhost) by mist.nodomain (8.12.11/8.12.11/Submit) id i9SC1Vk8002007; Thu, 28 Oct 2004 05:01:31 -0700 (PDT) (envelope-from dan) Date: Thu, 28 Oct 2004 05:01:31 -0700 (PDT) From: Dan Strick Message-Id: <200410281201.i9SC1Vk8002007@mist.nodomain> To: freebsd-hackers@freebsd.org cc: dan@mist.nodomain Subject: Re: questionable feature in FreeBSD pmake X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Oct 2004 19:50:52 -0000 On Thu, 28 Oct 2004 03:23:02 -0700, I wrote: > > I just spent a *very* frustrating hour trying to figure out why the > FreeBSD make program was invoking all commands to make things in a > subdirectory named "obj". I eventually discovered this gem in the > make man page: > > In addition, make sets or knows about the following internal > variables or environment variables: > > ... > > .OBJDIR A path to the directory where the targets are built. At > startup, make searches for an alternate directory to place > target files. It will attempt to change into this special > directory and will search this directory for > found in the current directory. The following directories > are tried in order: > > 1. ${MAKEOBJDIRPREFIX}/`pwd` > 2. ${MAKEOBJDIR} > 3. obj.${MACHINE} > 4. obj > 5. /usr/obj/`pwd` > ... > A little while later Peter Pentchev responded: > > Actually, this feature lies at the base of the FreeBSD base system build > infrastructure, and it is pretty much The Feature that allows us to > build from read-only and/or NFS-mounted sources shared among wide swarms > of machines :) > and > > Oh, and let's not forget cross-platform builds, too. > It is clear that a great deal of current FreeBSD OS makefile practice depends on the feature. The tragedy is that it was never necessary to make the feature unavoidable. Its invocation should have been dependent on using a special environment variable or make command option or makefile command or makefile variable. Unfortunately, it seems that its invocation depends only on the presence of a subdirectory named "obj" in the directory in which the make command is invoked and there is NO WAY to avoid it. There seems to be absolutely nothing that I can put in my makefile to turn the feature off or to undo its effect. It seems that I have no alternative but to rename my "obj" directory. Can someone suggest an alternative? Note that it is not possible for me to set an environment variable (i.e. MAKEOBJDIR) before running make or to add an option to the make command line. Any fix must be contained entirely within the makefile. Setting .OBJDIR or MAKEOBJDIR within the makefile does not work. Placing a "cd .." or "cd $(.CURDIR)" in front of every set of makefile shell commands is unthinkable. Dan Strick strick@covad.net (now *immensely* frustrated)