help-make
[Top][All Lists]
Advanced

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

Variable confusion


From: Gary
Subject: Variable confusion
Date: Tue, 15 Jun 2010 14:23:41 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (cygwin)

Actually the level of my confusion seems to be constant, but this time
is about variables...

With a makefile like:
,----
| CC=gpp
| LIB_ROOT=../lib
| INCL=`find ${LIB_ROOT} -type d \! \( -name '.*' -prune \) | sed -e 's/^/-I /'`
| CFLAGS=-x --curdirinclast ${INCL}
| SRCS=$(wildcard *.gpp)
| TARGETS=$(SRCS:.gpp=.php)
| 
| .SUFFIXES : .gpp .php
| 
| .gpp.php :
| »       @echo ${CFLAGS}
| »       $(CC) $(CFLAGS) -o $@ $<
| 
| all: $(TARGETS)
| 
| clean:
| »       rm -f $(MAKEDEPEND_OUTPUT)
| »       rm -f *.php
| 
| echo:
| »       @echo ${CFLAGS}
`----

Why do the following produce different output in terms of the CFLAGS content?

,----
| $ make echo
| -x --curdirinclast -I ../lib -I ../lib/db -I ../lib/ewz -I ../lib/ewz/ws -I 
../lib/net -I ../lib/net/protocol -I ../lib/net/protocol/http
`----

,----
| $ make all
| [snip]
| -x --curdirinclast -I ../lib -I ../lib/db -I ../lib/ewz -I ../lib/ewz/ws -I 
../lib/net -I ../lib/net/protocol -I ../lib/net/protocol/http
| gpp -x --curdirinclast `find ../lib -type d \! \( -name '.*' -prune \) | sed 
-e 's/^/-I /'` -o FOO.php FOO.gpp
`----

The 'make all' works fine, I'm just trying to understand what's going
on, i.e. why one call to echo produces one output and another produces
different output.




reply via email to

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