david/ipxe
david
/
ipxe
Archived
1
0
Fork 0

[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>
This commit is contained in:
Michael Brown 2014-08-26 15:05:48 +01:00
parent df202b3f4d
commit bfe9f06f9b
1 changed files with 15 additions and 2 deletions

View File

@ -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
###############################################################################