Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 29 Oct 2004 09:01:57 +0200 (CEST)
From:      Harti Brandt <harti@freebsd.org>
To:        Sean Farley <sean-freebsd@farley.org>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: questionable feature in FreeBSD pmake
Message-ID:  <20041029090051.M52069@beagle.kn.op.dlr.de>
In-Reply-To: <20041028225223.W44325@thor.farley.org>
References:  <200410281201.i9SC1Vk8002007@mist.nodomain> <20041028225223.W44325@thor.farley.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 28 Oct 2004, Sean Farley wrote:

SF>On Thu, 28 Oct 2004, Dan Strick wrote:
SF>
SF>> On Thu, 28 Oct 2004 03:23:02 -0700, Dan Strick wrote:
SF>> > 
SF>> > I just spent a *very* frustrating hour trying to figure out why the
SF>> > FreeBSD make program was invoking all commands to make things in a
SF>> > subdirectory named "obj".
SF>
SF>I just noticed this is in the BUGS section of make:
SF>     The determination of .OBJDIR is contorted to the point of
SF>     absurdity.
SF>
SF>> It seems that I have no alternative but to rename my "obj" directory.
SF>> Can someone suggest an alternative?  Note that it is not possible for
SF>> me to set an environment variable (i.e. MAKEOBJDIR) before running
SF>> make or to add an option to the make command line.  Any fix must be
SF>> contained entirely within the makefile.  Setting .OBJDIR or MAKEOBJDIR
SF>> within the makefile does not work.  Placing a "cd .." or "cd
SF>> $(.CURDIR)" in front of every set of makefile shell commands is
SF>> unthinkable.
SF>
SF>Why are you unable to do anything with the command-line?  Any of these
SF>will solve your problem.
SF>Bourne:
SF>MAKEOBJDIR=/no_obj_here make
SF>
SF>Bourne or CSH:
SF>env MAKEOBJDIR=/no_obj_here make
SF>
SF>Here is a Makefile that does not use obj/.  The special targets can be
SF>placed into a file to be included into all your Makefiles.  It only
SF>suffers from a failed build where it will not rename obj to tmpobj.
SF>
SF>-----------------------
SF>.BEGIN:
SF>	mv tmpobj obj || mkdir obj
SF>
SF>.INTERRUPT:
SF>	mv obj tmpobj

.INTERRUPT is dangerous at the moment, because it is not called always and 
it's sometimes called in the wrong place. I have a fix for this.

harti

SF>
SF>.END:
SF>	mv obj tmpobj
SF>
SF>all:
SF>	touch testing
SF>
SF>clean:
SF>	rm -f testing
SF>-----------------------
SF>
SF>Sean
SF>



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