From owner-freebsd-hackers@FreeBSD.ORG Fri Oct 29 06:50:50 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 0C32716A4CE for ; Fri, 29 Oct 2004 06:50:50 +0000 (GMT) Received: from n33.kp.t-systems-sfr.com (n33.kp.t-systems-sfr.com [129.247.16.33]) by mx1.FreeBSD.org (Postfix) with ESMTP id 207FE43D46 for ; Fri, 29 Oct 2004 06:50:49 +0000 (GMT) (envelope-from harti@freebsd.org) Received: from n81.sp.op.dlr.de (n81g.sp.op.dlr.de [129.247.163.1]) i9T6oTU265968; Fri, 29 Oct 2004 08:50:30 +0200 Received: from zeus.nt.op.dlr.de (zeus.nt.op.dlr.de [129.247.173.3]) i9T6oSI132194; Fri, 29 Oct 2004 08:50:28 +0200 Received: from beagle.kn.op.dlr.de (opkndnwsbsd178 [129.247.173.178]) by zeus.nt.op.dlr.de (8.11.7+Sun/8.9.1) with ESMTP id i9T6ohe03024; Fri, 29 Oct 2004 08:50:44 +0200 (MET DST) Date: Fri, 29 Oct 2004 08:50:29 +0200 (CEST) From: Harti Brandt X-X-Sender: brandt@beagle.kn.op.dlr.de To: Dan Strick In-Reply-To: <200410281201.i9SC1Vk8002007@mist.nodomain> Message-ID: <20041029084715.C52069@beagle.kn.op.dlr.de> References: <200410281201.i9SC1Vk8002007@mist.nodomain> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: 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 Reply-To: Harti Brandt List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Oct 2004 06:50:50 -0000 On Thu, 28 Oct 2004, Dan Strick wrote: DS>On Thu, 28 Oct 2004 03:23:02 -0700, I wrote: DS>> DS>> I just spent a *very* frustrating hour trying to figure out why the DS>> FreeBSD make program was invoking all commands to make things in a DS>> subdirectory named "obj". I eventually discovered this gem in the DS>> make man page: DS>> DS>> In addition, make sets or knows about the following internal DS>> variables or environment variables: DS>> DS>> ... DS>> DS>> .OBJDIR A path to the directory where the targets are built. At DS>> startup, make searches for an alternate directory to place DS>> target files. It will attempt to change into this special DS>> directory and will search this directory for DS>> found in the current directory. The following directories DS>> are tried in order: DS>> DS>> 1. ${MAKEOBJDIRPREFIX}/`pwd` DS>> 2. ${MAKEOBJDIR} DS>> 3. obj.${MACHINE} DS>> 4. obj DS>> 5. /usr/obj/`pwd` DS>> ... DS>> DS> DS>A little while later Peter Pentchev responded: DS>> DS>> Actually, this feature lies at the base of the FreeBSD base system build DS>> infrastructure, and it is pretty much The Feature that allows us to DS>> build from read-only and/or NFS-mounted sources shared among wide swarms DS>> of machines :) DS>> DS>and DS>> DS>> Oh, and let's not forget cross-platform builds, too. DS>> DS> DS>It is clear that a great deal of current FreeBSD OS makefile practice DS>depends on the feature. The tragedy is that it was never necessary to DS>make the feature unavoidable. Its invocation should have been dependent DS>on using a special environment variable or make command option or makefile DS>command or makefile variable. Unfortunately, it seems that its invocation DS>depends only on the presence of a subdirectory named "obj" in the directory DS>in which the make command is invoked and there is NO WAY to avoid it. DS>There seems to be absolutely nothing that I can put in my makefile to DS>turn the feature off or to undo its effect. I think this should be made conditional on the .POSIX target in the makefile. This way we don't loose this feature for system build but make our make more useable for outside packages. I have not yet looked into this. harti DS> DS>It seems that I have no alternative but to rename my "obj" directory. DS>Can someone suggest an alternative? Note that it is not possible for me DS>to set an environment variable (i.e. MAKEOBJDIR) before running make or DS>to add an option to the make command line. Any fix must be contained DS>entirely within the makefile. Setting .OBJDIR or MAKEOBJDIR within the DS>makefile does not work. Placing a "cd .." or "cd $(.CURDIR)" in front of DS>every set of makefile shell commands is unthinkable. DS> DS>Dan Strick DS>strick@covad.net DS> DS>(now *immensely* frustrated) DS>_______________________________________________ DS>freebsd-hackers@freebsd.org mailing list DS>http://lists.freebsd.org/mailman/listinfo/freebsd-hackers DS>To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" DS> DS> DS>