[Top][All Lists]

[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
    @echo $(CURDIR)
Now, run it:
    bash[/tmp]$ make

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

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
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:

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]