【问题标题】:Can we include another Makefile in a GNU Makefile by using the relative path?我们可以使用相对路径在 GNU Makefile 中包含另一个 Makefile 吗?
【发布时间】:2009-08-25 11:49:06
【问题描述】:

我有一个 Makefile 在:

project/all_app/myapp/src/Makefile

我也有一个master Depend.mk 在

project/Depend.mk

我可以使用相对路径包含主 Makefile 吗?

include ../../../../Depend.mk

【问题讨论】:

标签: makefile gnu


【解决方案1】:

请注意,make 的包含从 pwd 开始,不是 Makefile 的路径。 (所以make -f 可能会导致问题)

【讨论】:

    【解决方案2】:

    make 中包含的规则有点复杂 - 请参阅 GNU make 手册的this section。但是是的 - 你可以按照你的要求去做。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-11-14
      • 1970-01-01
      • 2011-04-29
      • 2013-10-18
      • 2010-09-24
      • 2011-03-21
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多