The make command provides the -n parameter for debugging makefiles. When make is run with the -n parameter, it only prints the commands that would be executed, but does not actually execute them.
For example, with the following makefile, running make all -n
will print the commands to be executed but will not actually execute them.
However, if the command contains a + sign or uses ${MAKE}, then the -n option will not take effect. The make tool will still execute that command.
1. Makefile with + Sign
For example, if the command in the makefile starts with a + sign.
At this point, when running make -n, the echo command is still executed.
2. Makefile with ${MAKE}
For example, in the following makefile, the make command is used to execute another makefile within the all target, but the make command is replaced with the variable MAKE.
Running make -n
reveals that the command make -f a.make all is executed.
Training Information
You can also directly click the URL to access
http://gk.chinaaet.com