From b175cfcf866c0f2ab72b7eb6a24aa4d13bb387e4 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Tue, 27 Mar 2012 14:15:16 +1030 Subject: [PATCH 1/1] Makefile: generate config.h in two stages This means we don't create an empty file if configurator fails. --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 570793c7..13aa195d 100644 --- a/Makefile +++ b/Makefile @@ -122,8 +122,9 @@ inter-depends: $(ALL_DEPENDS) Makefile test-depends: $(ALL_DEPENDS) Makefile for f in $(ALL_DEPENDS); do echo check-`basename \`dirname $$f\``: `sed -n 's,ccan/\(.*\),check-\1,p' < $$f`; done > $@ +# Ensure we don't end up with empty file if configurator fails! config.h: tools/configurator/configurator Makefile Makefile-ccan - @tools/configurator/configurator $(CC) $(CCAN_CFLAGS) > config.h + tools/configurator/configurator $(CC) $(CCAN_CFLAGS) > $@ || rm -f $@ include tools/Makefile -include inter-depends -- 2.39.2