[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
How to limit the assignment of variable from command line only to the cu
From: |
Peng Yu |
Subject: |
How to limit the assignment of variable from command line only to the current makefile? |
Date: |
Wed, 13 Jul 2011 11:06:41 -0500 |
Hi,
The variable assigned in the parent makefile will be carried on to the
child makefile. I'm wondering if there is a way to localize this
effect only to the parent.
$ cat Makefile
.PHONY: all
XX:=abc
$(info $(XX))
all:
$(MAKE) -C dir
$ cat dir/Makefile
.PHONY: all
XX:=abc
$(info $(XX))
all:
$ make XX=100
100
make -C dir
100
make[1]: Entering directory `/tmp/cmdl_arg/dir'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/tmp/cmdl_arg/dir'
--
Regards,
Peng
- How to limit the assignment of variable from command line only to the current makefile?,
Peng Yu <=