Przeglądaj źródła

[build] Avoid deleting config header files if build is interrupted

With extremely unlucky timing, it is possible to interrupt a build and
cause make to delete config/named.h (and possibly any local
configuration headers).

Mark config/named.h and all local configuration headers as .PRECIOUS
to prevent make from ever deleting them.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 9 lat temu
rodzic
commit
bfe9f06f9b
1 zmienionych plików z 15 dodań i 2 usunięć
  1. 15
    2
      src/Makefile.housekeeping

+ 15
- 2
src/Makefile.housekeeping Wyświetl plik

@@ -717,6 +717,8 @@ endif
717 717
 config/named.h : $(CONFIG_LIST)
718 718
 	$(Q)$(TOUCH) $@
719 719
 
720
+.PRECIOUS : config/named.h
721
+
720 722
 # These files use .incbin inline assembly to include a binary file.
721 723
 # Unfortunately ccache does not detect this dependency and caches
722 724
 # builds even when the binary file has changed.
@@ -1289,14 +1291,25 @@ CLEANUP += $(EINFO)
1289 1291
 # Local configs
1290 1292
 #
1291 1293
 CONFIG_HEADERS := $(patsubst config/%,%,$(wildcard config/*.h))
1294
+CONFIG_LOCAL_HEADERS := $(foreach HEADER,$(CONFIG_HEADERS),\
1295
+				  config/local/$(HEADER))
1292 1296
 
1293
-$(foreach HEADER,$(CONFIG_HEADERS),config/local/$(HEADER)) :
1297
+$(CONFIG_LOCAL_HEADERS) :
1294 1298
 	$(Q)$(TOUCH) $@
1295 1299
 
1300
+.PRECIOUS : $(CONFIG_LOCAL_HEADERS)
1301
+
1296 1302
 ifneq ($(CONFIG),)
1297
-$(foreach HEADER,$(CONFIG_HEADERS),config/local/$(CONFIG)/$(HEADER)) :
1303
+
1304
+CONFIG_LOCAL_NAMED_HEADERS := $(foreach HEADER,$(CONFIG_HEADERS),\
1305
+					config/local/$(CONFIG)/$(HEADER))
1306
+
1307
+$(CONFIG_LOCAL_NAMED_HEADERS) :
1298 1308
 	$(Q)$(MKDIR) -p $(dir $@)
1299 1309
 	$(Q)$(TOUCH) $@
1310
+
1311
+.PRECIOUS : $(CONFIG_LOCAL_NAMED_HEADERS)
1312
+
1300 1313
 endif
1301 1314
 
1302 1315
 ###############################################################################

Ładowanie…
Anuluj
Zapisz