mirror of https://github.com/ipxe/ipxe.git
[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>pull/27/merge
parent
df202b3f4d
commit
bfe9f06f9b
|
@ -717,6 +717,8 @@ endif
|
|||
config/named.h : $(CONFIG_LIST)
|
||||
$(Q)$(TOUCH) $@
|
||||
|
||||
.PRECIOUS : config/named.h
|
||||
|
||||
# These files use .incbin inline assembly to include a binary file.
|
||||
# Unfortunately ccache does not detect this dependency and caches
|
||||
# builds even when the binary file has changed.
|
||||
|
@ -1289,14 +1291,25 @@ CLEANUP += $(EINFO)
|
|||
# Local configs
|
||||
#
|
||||
CONFIG_HEADERS := $(patsubst config/%,%,$(wildcard config/*.h))
|
||||
CONFIG_LOCAL_HEADERS := $(foreach HEADER,$(CONFIG_HEADERS),\
|
||||
config/local/$(HEADER))
|
||||
|
||||
$(foreach HEADER,$(CONFIG_HEADERS),config/local/$(HEADER)) :
|
||||
$(CONFIG_LOCAL_HEADERS) :
|
||||
$(Q)$(TOUCH) $@
|
||||
|
||||
.PRECIOUS : $(CONFIG_LOCAL_HEADERS)
|
||||
|
||||
ifneq ($(CONFIG),)
|
||||
$(foreach HEADER,$(CONFIG_HEADERS),config/local/$(CONFIG)/$(HEADER)) :
|
||||
|
||||
CONFIG_LOCAL_NAMED_HEADERS := $(foreach HEADER,$(CONFIG_HEADERS),\
|
||||
config/local/$(CONFIG)/$(HEADER))
|
||||
|
||||
$(CONFIG_LOCAL_NAMED_HEADERS) :
|
||||
$(Q)$(MKDIR) -p $(dir $@)
|
||||
$(Q)$(TOUCH) $@
|
||||
|
||||
.PRECIOUS : $(CONFIG_LOCAL_NAMED_HEADERS)
|
||||
|
||||
endif
|
||||
|
||||
###############################################################################
|
||||
|
|
Loading…
Reference in New Issue