>
foo: create_files 
        $(call MY_VAR2, ls)
        @rm -f *.foo 

>My question is: call is a make built in function and not a bash command. How
than it is being executed by shell? 


Anything of the form $(foobar ...) is "expanded" by make at some time.  
"Expanded" means, $(foobar ...) is replaced with some "value" (the exact 
meaning of "value" depends on what "foobar" is - if "foobar" is "built-in", it 
has the meaning defined in the manual, if it's defined by you, it has your 
meaning).

At what time the expansion happens?  - it depends.  Read section 3.7 of the 
manual.  You will find that $(foobar  ... ) in a recipe (the part of a rule 
that gets executed), is expanded at the time that the recipe needs to be 
executed.  

Although I can't find it written anywhere in the manual, I guess it is obvious 
and understood, that that expansion happens first, then the expanded (possibly 
recursively) recipe, is given to the shell for execution.  

Mark  

_______________________________________________
Help-make mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/help-make

Reply via email to