【问题标题】:Passing compiler flags via make argument rather than Makefile通过 make 参数而不是 Makefile 传递编译器标志
【发布时间】:2015-08-03 08:09:33
【问题描述】:

是否可以通过 make 参数而不是 Makefile 将某些编译器标志添加到所有编译器调用(所有 .cpp 文件)?如果可以,那怎么做?

【问题讨论】:

    标签: makefile compiler-flags


    【解决方案1】:

    是的,这是可能的。您可以将VARIABLE=value 形式的操作数传递给make,它将make 变量VARIABLE 定义为具有value,覆盖在您的Makefile 中定义的VARIABLE 的内容。有关更多详细信息,请参阅 make 实现的文档。请注意,在 GNU make 中使用 := 赋值时,这可能会有所不同。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2020-04-12
      • 2019-05-22
      • 2016-04-02
      • 2014-03-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多