开发者

Check for flags in Makefile

How to ch开发者_开发技巧eck for flags in Makefile ? Suppose I run make -a, I need to be able to do certain things, How do I detect if the flag is set inside a Makefile ?


If you're using GNUMake, you can check MAKEFLAGS, like this:

someTarget: 
    ifneq (,$(findstring a,$(MAKEFLAGS)))
      do something
    else
      do something else
    endif
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜