Remove a flag from C++FLAGS in Makefile?

前端 未结 1 510
梦如初夏
梦如初夏 2021-02-04 03:04

I\'ve got a Makefile that includes another makefile that sets a lot of defaults. I can\'t edit the included makefile and I\'d like to change the value of C++FLAGS in my makefile

相关标签:
1条回答
  • 2021-02-04 04:03
    C++FLAGS:=$(filter-out -O3,$(C++FLAGS))
    

    The := assignment immediately evaluates the rvalue and this should therefore work. = on the other hand has delayed expansion semantics (i.e. the C++FLAGS will expand whenever the lvalue gets used, which leads to recursion).

    0 讨论(0)
提交回复
热议问题