Try to fix an issue where make fails if a header file disappears

Currently, when a header file is removed (or renamed), there is a stale
dependency file still referring to the header, and GNU make aborts, because
the header is missing.  Attempt to work around this by adding a pattern
rule to generate any header in `src/`.  The rule prints a warning message.

The C source file whose header was missing will be recompiled because a
dependency was rebuilt.  Once it is, the removed header should be removed
from the dependency file.

(Aside: FWIW, the "ninja" build tool knows directly about depfiles, and it
does not have this problem.)
This commit is contained in:
Ryan Prichard 2016-02-29 02:58:30 -06:00
parent 483aeffee6
commit e390c8775c

View File

@ -96,3 +96,6 @@ build/unix/%.o : src/%.cc VERSION.txt | $$(@D)/.mkdir
%.mkdir :
@mkdir -p $(dir $@)
@touch $@
src/%.h :
@echo "Missing header file $@ (stale dependency file?)"