I read this question, and I was surprised it wasn't working:
Why GNU Make canned recipe doesn't work?
So I tried it myself and got the same results. Here's an example makefile:
define foo
bar
baz
endef
define bar =
foo
baz
endef
$(info foo: $(foo))
$(info bar: $(bar))
all:
And here's the output from running it:
$ make
foo: bar
baz
bar:
make: Nothing to be done for `all'.
What's happening here? The GNU make manual seems to indicate that these two variable declarations should be the same - what am I missing here?
Edit:
Some quotations from the manual that I was referring to:
define immediate deferred endef define immediate = deferred endefHere is an example of defining a canned recipe:
define run-yacc = yacc $(firstword $^) mv y.tab.c $@ endef6.8 Defining Multi-Line Variables
... You may omit the variable assignment operator if you prefer. If omitted, make assumes it to be ‘=’ and creates a recursively-expanded variable...
As you can see, the canned recipes section explicitly uses the = case. I'm using GNU Make 3.81.
apt-get upgrade ; apt-get install makewas telling me that v3.81 was the latest so I was becoming furiouser and furiouser... Thanks so much! - j_random_hacker