Browse Source

Makefile: generate config.h more carefully

Don't risk reading partially-constructed files.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Rusty Russell 13 years ago
parent
commit
c07a2b209d
1 changed files with 1 additions and 1 deletions
  1. 1 1
      Makefile

+ 1 - 1
Makefile

@@ -129,7 +129,7 @@ FORCE:
 
 # 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) > $@ || rm -f $@
+	tools/configurator/configurator $(CC) $(CCAN_CFLAGS) > $@.tmp && mv $@.tmp $@
 
 include tools/Makefile
 -include inter-depends