Force exit from a Makefile target without raising an error

后端 未结 2 1862
清酒与你
清酒与你 2021-02-18 16:37

I work with a Makefile generated by an external tool (Netbeans), where I can not change the logic of the main target, but I am able to \"inject\" logic in a target that is execu

2条回答
  •  醉话见心
    2021-02-18 17:07

    You can have the all target do nothing if a variable is not set:

    ifeq ($(SOME_VAR),)
    $(info SOME_VAR not set!)
    all:
    else
    all: target1 target2 targetetc
    endif
    

提交回复
热议问题