Reputation:
When recursively invoking nmake, via the $(MAKE) macro, how can I pass on the target specified on the command line to the new instance?
So, say I execute the following from the command line:
c:\nmake clean
I want the recursive call to nmake to pass the 'clean' target to the new nmake instance.
Upvotes: 0
Views: 1730
Reputation: 7031
you can write rule like this:
clean all:
cd dir1 && $(MAKE) $*
cd dir2 && $(MAKE) $*
$* will be substituted by target name ("clean" or "clean" in this example)
Upvotes: 2
Reputation: 882028
I'm not sure I understand the question but you normally have the rule by virtue of the fact that your executing a specific part of the makefile, such as:
clean:
cd dir1 && $(MAKE) clean
cd dir2 && $(MAKE) clean
all:
cd dir1 && $(MAKE) all
cd dir2 && $(MAKE) all
If you have some other setup in your makefile, your best bet is to post it so we can do a better analysis.
Upvotes: 0