bug-make
[Top][All Lists]
Advanced

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

MAKEFLAGS and -e


From: dann frazier
Subject: MAKEFLAGS and -e
Date: Wed, 13 May 2009 02:09:11 -0600
User-agent: Mutt/1.5.18 (2008-05-17)

hey,
I noticed that when setting a variable on the commandline and using
-e, the variable is set in the environment instead of in
MAKEFLAGS. Should it not also be set in MAKEFLAGS?

I found that this was causing unexpected results in a situation where
three levels of makefiles were being called like this:

-------- Makefile.1----------
all:
        $(MAKE) FOO=bar -e -f Makefile.2
-------- Makefile.1----------

-------- Makefile.2----------
all:
        $(MAKE) -f Makefile.3
-------- Makefile.2----------

-------- Makefile.3----------
FOO = baz

all:
        @echo FOO is $(FOO)
-------- Makefile.3----------

make -f Makefile.1 will output "FOO is baz"
But, if we remove the -e in Makefile.1, we get "FOO is bar".
It seems strange to me that -e would affect this when $FOO is not part
of the initial environment, but maybe that is by design?

(Using make 3.81)
-- 
dann frazier





reply via email to

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