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:

3.7 how make reads makefile

define immediate   deferred endef  define immediate =   deferred endef 

5.8 defining canned recipes

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

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -