Nmake recursive target

When nmake is called recursively, using the $ (MAKE) macro, how can I pass the target given on the command line to the new instance?

So let's say I execute the following from the command line:

c: \ nmake clean

I want to recursively invoke nmake to pass a "clean" target to a new instance of nmake.

0


a source to share


2 answers


you can write the rule like this:

clean all:
    cd dir1 && $(MAKE) $*
    cd dir2 && $(MAKE) $*

      



$ * will be replaced by the target name ("clean" or "clean" in this example)

+2


a source


I'm not sure I understand this question, but you usually have a rule due to the fact that you are executing a specific part of the makefile, for example:

clean:
    cd dir1 && $(MAKE) clean
    cd dir2 && $(MAKE) clean

all:
    cd dir1 && $(MAKE) all
    cd dir2 && $(MAKE) all

      



If you have any other setting in your file, it is best to place it so we can analyze it better.

0


a source







All Articles