[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.

posted on 2014-01-18 14:47  Shawn X.Y. Bai  阅读(156)  评论(0编辑  收藏  举报

导航