List Info

Thread: GNU Make: Add something to CXXFLAGS when invoking make




GNU Make: Add something to CXXFLAGS when invoking make
user name
2006-11-08 20:35:57
"Eric Lilja" <mindcoolergmail.com> wrote:
> $ make CXXFLAGS+='-DFRIEND
> but instead of adding -DFRIEND to CXXFLAGS, it replaced
it...

When I did some experiments with this I found the same:

-8<---------------------------
TEST += world
 
all:
        echo $(TEST)
-8<---------------------------

$ make
echo world
world
$ make TEST=hello
echo hello
hello
$ make TEST+=hello
echo hello
hello

So I had to use an extra variable:

-8<---------------------------
TEST2 += $(TEST) world

all:
	echo $(TEST2)
-8<---------------------------

$ make
echo  world
world
$ make TEST=hello
echo hello world
hello world

regards Henrik
-- 
The address in the header is only to prevent spam. My real
address is:
hc8(at)uthyres.com Examples of addresses which go to
spammers:
rootvariousus.net rootlocalhost

_______________________________________________
help-gnu-utils mailing list
help-gnu-utilsgnu.org

http://lists.gnu.org/mailman/listinfo/help-gnu-utils
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )