[quote] How to determine what target is given in Makefile from the make command-line?

 

Yes, you could get the target that is given from the make command-line by using MAKECMDGOALS

for example below,

ifneq "$(MAKECMDGOALS)" "clean"
-include config.mk
endif

 

that is when using  make clean in command-line, config.mk will not be included.

otherwise, like "make" will make config.mk be included.

[quote] How to determine what target is given in Makefile from the make command-line?

上一篇:Linux shell 执行 shell sh 脚本文件报错 解决方案


下一篇:python3 类详解教程