Mon 20 Jan 2003 05:09:38 PM UTC, comment #2:
If a variable that is intended to be a function is exported it seems to be evaluated when exported.
Sample output & Makefiles:
Good:
tcsh> make --warn-undefined-variables all
Echoing call to FOO: $(call FOO,a,b)
b a
tcsh> cat Makefile
REVERSE=$(2) $(1)
FOO=$(call REVERSE,$(1),$(2))
all:
@echo "Echoing call to FOO: \$$(call FOO,a,b)"
@echo "$(call FOO,a,b)"
Bad:
tcsh> make --warn-undefined-variables all
make: warning: undefined variable `2'
make: warning: undefined variable `1'
make: warning: undefined variable `1'
make: warning: undefined variable `2'
Echoing call to FOO: $(call FOO,a,b)
b a
tcsh> cat Makefile
REVERSE=$(2) $(1)
FOO=$(call REVERSE,$(1),$(2))
export REVERSE FOO
all:
@echo "Echoing call to FOO: \$$(call FOO,a,b)"
@echo "$(call FOO,a,b)"
I have also seen failure by the call function to evaluate correctly if the variables have been exported, but do not have a simple reproducer.
|
Mon 20 Jan 2003 04:36:46 PM UTC, original submission:
Version is 3.79.1 from Red Hat Linux 7.2 on i386. No re-compilation of make, using as is from RH 7.2
Can't see any problems in Makefile. Usin --warn-undefined-variables can see that '1' is an undefined variable.
Can't get call function to work in even the simplest example from the documentation.
|