How can I configure my makefile for debug and release builds?

后端 未结 7 611
借酒劲吻你
借酒劲吻你 2020-12-12 08:41

I have the following makefile for my project, and I\'d like to configure it for release and debug builds. In my code, I have lots of #ifdef DEBUG macros in plac

7条回答
  •  半阙折子戏
    2020-12-12 09:37

    You could also add something simple to your Makefile such as

    ifeq ($(DEBUG),1)
       OPTS = -g
    endif
    

    Then compile it for debugging

    make DEBUG=1

提交回复
热议问题