Переглянути джерело

[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 роки тому
джерело
коміт
bfe9f06f9b
1 змінених файлів з 15 додано та 2 видалено
  1. 15
    2
      src/Makefile.housekeeping

+ 15
- 2
src/Makefile.housekeeping Переглянути файл

717
 config/named.h : $(CONFIG_LIST)
717
 config/named.h : $(CONFIG_LIST)
718
 	$(Q)$(TOUCH) $@
718
 	$(Q)$(TOUCH) $@
719
 
719
 
720
+.PRECIOUS : config/named.h
721
+
720
 # These files use .incbin inline assembly to include a binary file.
722
 # These files use .incbin inline assembly to include a binary file.
721
 # Unfortunately ccache does not detect this dependency and caches
723
 # Unfortunately ccache does not detect this dependency and caches
722
 # builds even when the binary file has changed.
724
 # builds even when the binary file has changed.
1289
 # Local configs
1291
 # Local configs
1290
 #
1292
 #
1291
 CONFIG_HEADERS := $(patsubst config/%,%,$(wildcard config/*.h))
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
 	$(Q)$(TOUCH) $@
1298
 	$(Q)$(TOUCH) $@
1295
 
1299
 
1300
+.PRECIOUS : $(CONFIG_LOCAL_HEADERS)
1301
+
1296
 ifneq ($(CONFIG),)
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
 	$(Q)$(MKDIR) -p $(dir $@)
1308
 	$(Q)$(MKDIR) -p $(dir $@)
1299
 	$(Q)$(TOUCH) $@
1309
 	$(Q)$(TOUCH) $@
1310
+
1311
+.PRECIOUS : $(CONFIG_LOCAL_NAMED_HEADERS)
1312
+
1300
 endif
1313
 endif
1301
 
1314
 
1302
 ###############################################################################
1315
 ###############################################################################

Завантаження…
Відмінити
Зберегти