bug-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

CURDIR broke in make-3.79.1 & make-3.80


From: Marc Peters
Subject: CURDIR broke in make-3.79.1 & make-3.80
Date: Thu, 29 Sep 2005 01:14:27 -0500
User-agent: Mozilla Thunderbird 1.0.6 (Windows/20050716)

First, let me say the the GNU toolset is a fine product.  The tools
make it a pleasure to participate in the software development field.

Now on to the problem...

CURDIR doesn't work as advertised in make-3.79.1 and make-3.80.
Consider the following makefile in /tmp:
.PHONY:   x
x:
    @echo $(CURDIR)
Now, run it:
    bash[/tmp]$ make
    /tmp

Okay, what we expected.  Now try this.
    bash[/tmp]$ export CURDIR=uhoh
    bash[/tmp]$ make
    uhoh

Not what we expect; however, it would be what we expect if we had
type 'make -e'.  As evidence, we provide the following documentation from
http://www.gnu.org/software/make/manual/html_chapter/make_5.html:
For your convenience, GNU make sets the variable CURDIR to the pathname of the current working directory for you. If -C is in effect, it will contain the path of the new directory, not the original. The value has the same precedence it would have if it were set in the makefile (by default, an environment variable CURDIR will not override this value). Note that setting this variable has no effect on the operation of make
This paragraph directly contradicts the observed behavior.  However, it does
mention use of the -C option.  Further testing will show the faulty behavior
exists in the presence of the -C option, also.

The consequences of this misbehavior is that any makefiles that take advantage
of CURDIR (e.g., linux comes to mind) will fail if the user's environment contains
a value for the CURDIR variable.  This is unfortunate, as some other applications
require CURDIR to be set (e.g., Rational Rose) for them to function properly.

Examples of failures caused by CURDIR:
    http://lists.strongswan.org/pipermail/users/2004-October/000426.html
    http://ozlabs.org/pipermail/linuxppc-dev/2001-July/011336.html
    http://www.uclinux.org/pub/uClinux/archive/att-7664/01-error.txt

The mailing lists are full of frustrated people without the ability to chase the problem.

Your consideration of looking into this would be greatly appreciated.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]