makefile - GNU make differences in multiline variable declarations -
i read question, , surprised wasn't working:
why gnu make canned recipe doesn't work?
so tried myself , got same results. here's example makefile:
define foo bar baz endef define bar = foo baz endef $(info foo: $(foo)) $(info bar: $(bar)) all:
and here's output running it:
$ make foo: bar baz bar: make: nothing done `all'.
what's happening here? gnu make manual seems indicate these 2 variable declarations should same - missing here?
edit:
some quotations manual referring to:
define immediate deferred endef define immediate = deferred endef
here example of defining canned recipe:
define run-yacc = yacc $(firstword $^) mv y.tab.c $@ endef
6.8 defining multi-line variables
... may omit variable assignment operator if prefer. if omitted, make assumes ‘=’ , creates recursively-expanded variable...
as can see, canned recipes section explicitly uses =
case. i'm using gnu make 3.81.
it's make
version. tested makefile on machine using make 3.81 in cygwin , got:
$ make foo: bar baz bar: make: nothing done `all'.
i tested same makefile using make 3.82 (native windows build) , got:
c:\>c:\make\make.exe foo: bar baz bar: foo baz make: nothing done `all'.
i believe online make
manual v3.82.
Comments
Post a Comment