Change Makefile variable value inside the target body

前端 未结 6 1549
夕颜
夕颜 2020-12-29 00:43

Is there a way to reassign Makefile variable value inside of the target body?

What I am trying to do is to add some extra flags for debug compilation:



        
6条回答
  •  再見小時候
    2020-12-29 01:27

    Yes, there is an easy way to do it, and without rerunning Make. Use a target-specific variable value:

    test: clean debug_compile
    
    debug_compile: ERLCFLAGS += -DTEST
    debug_compile: compile compile_test;
    

提交回复
热议问题