开发者

Check for flags in Makefile

开发者 https://www.devze.com 2023-03-26 13:31 出处:网络
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 c

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

精彩评论

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

关注公众号