将“覆盖目标的命令”变为错误

时间:2015-04-29 10:39:50

标签: makefile

如果单个目标有多个配方,则GNU会发出警告。这可以将警告转换为错误以使其更加明显吗?

1 个答案:

答案 0 :(得分:0)

我最终修补了GNU make并从源代码重建它(GIT标签4.1):

diff --git a/read.c b/read.c
index 6ff4bcc..f227681 100644
--- a/read.c
+++ b/read.c
@@ -2121,7 +2121,7 @@ record_files (struct nameseq *filenames, const char *pattern,
               error (&cmds->fileinfo, l,
                      _("warning: overriding recipe for target '%s'"),
                      f->name);
-              error (&f->cmds->fileinfo, l,
+              fatal (&f->cmds->fileinfo, l,
                      _("warning: ignoring old recipe for target '%s'"),
                      f->name);
             }