help-make
[Top][All Lists]
Advanced

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

How to stop a variable from being exported?


From: Alexey Neyman
Subject: How to stop a variable from being exported?
Date: Mon, 25 Oct 2004 10:41:10 +0400
User-agent: KMail/1.6.2

Hi all,

Is it possible to prevent a variable from being exported to sub-makes?
Below is the example:

============================================
$(warning "selector: $(selector)")
ifneq ($(selector),)
override selector :=
endif
$(warning "selector: $(selector)")

aaa:
        $(MAKE) selector=abc bbb

bbb:
        $(MAKE) ccc

ccc:
============================================

The "make aaa" command produces the following output:
Makefile:1: "selector: "
Makefile:5: "selector: "
make selector=abc bbb
make[1]: Entering directory `/home/avn/tmp'
Makefile:1: "selector: abc"
Makefile:5: "selector: "
make ccc
make[2]: Entering directory `/home/avn/tmp'
Makefile:1: "selector: abc"
Makefile:5: "selector: "
make[2]: Nothing to be done for `ccc'.
make[2]: Leaving directory `/home/avn/tmp'
make[1]: Leaving directory `/home/avn/tmp'

That is, the lowest sub-make receives selector=abc, though the 2nd 
sub-make overrided it with empty string. Is it right behavior? If so, 
how could one prevent a variable from being exported to sub-make 
processes? (unexport selector does not help either).

Regards,
Alexey.

-- 
All are welcome to our nest.
We are Pkunk, we cannot help but love all.
                        -- Pkunks, SC2




reply via email to

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