I just upgraded from v3.80 to 3.81 because of strange bugs when using $(eval ...) on a MacOsX os (the same makefile works fine with a 3.80 make on Linux).

But now, I am "completelly lost" with the "new" behavior of $(eval ..); to make things work, I have to sometimes use not just TWO $'s but FOUR of them.

Is there some "expert" to explain this ?, or point to a good and uptodate (3.81) tutorial for the $(eval ...) function ?.

Here is a makefile example showing the behaviour:

# -*- Makefile -*-

$(warning MAKE_VERSION=$(MAKE_VERSION))

x := x_val
$(eval $(warning 1 dollar:  x=$x))
$(eval $(warning 2 dollars: x=$$x))
$(warning looks good, with 1 and 2 dollars)

%todo := 2dollars 4dollars

.PHONY: $(%todo)

todo: $(%todo)

$(eval 2dollars: \; @echo with 2 dollars: target=$$@)
$(eval 4dollars: \; @echo with 4 dollars: target=$$$$@)

And is here what I get:

../src/makefile.eval:3: MAKE_VERSION=3.80
../src/makefile.eval:6: 1 dollar:  x=x_val
../src/makefile.eval:7: 2 dollars: x=$x
../src/makefile.eval:8: looks good, with 1 and 2 dollars
with 2 dollars: target=2dollars
with 4 dollars: target=

and

../src/makefile.eval:3: MAKE_VERSION=3.81
../src/makefile.eval:6: 1 dollar:  x=x_val
../src/makefile.eval:7: 2 dollars: x=$x
../src/makefile.eval:8: looks good, with 1 and 2 dollars
with 2 dollars: target=
with 4 dollars: target=4dollars



_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make

Reply via email to