Force exit from a Makefile target without raising an error

后端 未结 2 1915
清酒与你
清酒与你 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 16:44

    Just expanding a bit on @Ken's excellent response. You can also do this:

    ifeq ("test", "test")
    postinstall:
        @echo "test = test"
    else
    postinstall:
        @echo "test != test"
    endif
    

提交回复
热议问题