I\'m expecting to see files foo1 and foo3 created by the makefile below. However only a file foo3 is created. To me it seems that the canned recip
I think you don't want the =
at the end of the define
line. This makefile works here for me:
define make-foo
echo making $@
touch $@
endef
.PHONY: foo1
foo1:
$(make-foo)
Example:
$ make
echo making foo1
making foo1
touch foo1
$ ls
Makefile foo1
The GNU make manual seems to indicate that the =
should be just fine, but like you, I get different behaviour if I have it there.
Edit: I just asked:
GNU make differences in multiline variable declarations
To get some clarification on what's happening here...