Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 29 Oct 2004 18:39:13 -0700 (PDT)
From:      Dan Strick <strick@covad.net>
To:        freebsd-hackers@freebsd.org
Cc:        sean-freebsd@farley.org
Subject:   Re: questionable feature in FreeBSD pmake
Message-ID:  <200410300139.i9U1dDnY000639@mist.nodomain>

next in thread | raw e-mail | index | archive | help
>
> Why are you unable to do anything with the command-line?  Any of these
> will solve your problem.
> Bourne:
> MAKEOBJDIR=/no_obj_here make
>
> Bourne or CSH:
> env MAKEOBJDIR=/no_obj_here make
>
> Here is a Makefile that does not use obj/.  The special targets can be
> placed into a file to be included into all your Makefiles.  It only
> suffers from a failed build where it will not rename obj to tmpobj.
>
> -----------------------
> .BEGIN:
>	mv tmpobj obj || mkdir obj
>
> .INTERRUPT:
>	mv obj tmpobj
>

My goal was to write a generic makefile that would work on almost
any mostly POSIX compliant OS.  I wanted something I could just walk
up to and say "make" without having to remember that the makefile
is special and has to be invoked in a special way.  If I could just
add some trivial magic to the makefile that suppresses the special
"obj" feature on systems that have it but has no effect on other
systems, I would do that.  It seems that there is no such magic.

Thank you all for your suggestions.  I wish to give a special award
for extra creativity to Sean Farley for his makefile enhancements
that work around the problem by temporarily renaming the "obj"
subdirectory while the makefile is not active (i.e. when you would
most care what the subdirectory was called).

I think I will work around the problem by calling the directory "objs"
instead of "obj".

This does not mean that I forgive whoever it was that invented the
feature I don't like.  He should have checked with an adult first.
(Ooh, it feels good to say that! :-)

I repeat the observation that this feature could have been implemented
in a way that would have made it unlikely to be invoked accidentally.
It seems that the feature is now so widely spread throughout the BSD
community that is way too late to get the blemish fixed now.
I will have to settle for finding some comfort in the realization
that I have far bigger problems than the inability to use the
directory name "obj" in some circumstances.

Dan Strick
strick@covad.net



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