From 002115fc06853f219215319b3c7769ba6881a0b4 Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Mon, 28 Feb 2011 11:32:16 +0100 Subject: [PATCH] Makefile: Stop building on ggo errors. The dependency files *.d are implicitly made by -include command during make's first pass. The "-" prefix instructs make to ignore any non-existing files *and* all errors resulting from executing the rules for the *.d targets . This prefix is necessary to avoid the warning messages about non-existing dependency files, for example after a "make clean2". This implies that make proceeds even if a dependency file could not be created due to a syntax error in a .ggo file. We'd like to stop if this happens, but unfortunately gnu make does not have an option for specifying this behaviour in an include command. This patch works around this shortcoming by letting the "all" target depend on the new phony target "dep" which depends on all .d files. This way all *.d targets are considered twice: Once during the first pass (where errors are ignored) and again due to the all->dep dependency. If no errors occur, "make dep" is a no-op, so this change should not slow down the build noticeably. A slight drawback of this solution is that, in case of an error in a ggo file, the error will be printed twice. But this it is still better than silently ignoring the error. --- Makefile.in | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Makefile.in b/Makefile.in index 3fbbce21..c64b5ae7 100644 --- a/Makefile.in +++ b/Makefile.in @@ -99,9 +99,10 @@ else Q = @ endif -.PHONY: all clean distclean maintainer-clean install man tarball\ +.PHONY: dep all clean distclean maintainer-clean install man tarball\ .FORCE-GIT-VERSION-FILE -all: @executables@ $(man_pages) +all: dep @executables@ $(man_pages) +dep: $(deps) man: $(man_pages) tarball: $(tarball) @@ -224,8 +225,10 @@ all_objs := $(recv_objs) $(filter_objs) $(client_objs) $(gui_objs) \ $(audiod_objs) $(audioc_objs) $(fade_objs) $(server_objs) \ $(write_objs) $(afh_objs) +deps := $(all_objs:.o=.d) + ifeq ($(findstring clean, $(MAKECMDGOALS)),) --include $(all_objs:.o=.d) +-include $(deps) endif para_recv: $(recv_objs) -- 2.39.5