shell - Makefile - unterminated call to function `foreach': missing `)'. Stop -


this problem driving me nuts! here simple makefile:

sources = b c  $(foreach var,$(sources),echo $(var);)  all:     @echo done 

with make 3.8, makefile:3: *** unterminated call function 'foreach': missing ')'. stop.

with make 3.81, makefile:3: *** missing separator. stop.

but, if put foreach line within 'all' target, runs fine. help!!

that foreach yield bunch of echo commands. can't have @ top level of makefile. use $(info) instead:

$(foreach var,$(sources),$(info $(var))) 

example:

$ make b c done 

Comments

Popular posts from this blog

c# - How Configure Devart dotConnect for SQLite Code First? -

java - Copying object fields -

c++ - Clear the memory after returning a vector in a function -