Makefile: force regeneration of manpages, wire source.

Now that SHA256STAMP protects us, we can avoid timestamps altogether
so we don't get missing builds.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2020-08-31 10:43:25 +09:30 committed by neil saitug
parent 1746406e41
commit bb250358ae
2 changed files with 8 additions and 2 deletions

View File

@ -256,9 +256,9 @@ config.vars:
# Git doesn't maintain timestamps, so we only regen if sources actually changed:
# We place the SHA inside some generated files so we can tell if they need updating.
# Usage: $(call SHA256STAMP_CHANGED,prefix)
SHA256STAMP_CHANGED = [ x"`sed -n 's/.*SHA256STAMP://p' $@ 2>/dev/null`" != x"$(1)`cat $^ | sha256sum | cut -c1-64`" ]
SHA256STAMP_CHANGED = [ x"`sed -n 's/.*SHA256STAMP://p' $@ 2>/dev/null`" != x"$(1)`cat $(filter-out FORCE,$^) | sha256sum | cut -c1-64`" ]
# Usage: $(call SHA256STAMP,prefix,commentprefix)
SHA256STAMP = echo '$(2) SHA256STAMP:$(1)'`cat $^ | sha256sum | cut -c1-64` >> $@
SHA256STAMP = echo '$(2) SHA256STAMP:$(1)'`cat $(filter-out FORCE,$^) | sha256sum | cut -c1-64` >> $@
# generate-wire.py --page [header|impl] hdrfilename wirename < csv > file
%_wiregen.h: %_wire.csv $(WIRE_GEN_DEPS)
@ -300,6 +300,10 @@ ALL_NONGEN_SRCFILES := $(filter-out gen%.h %printgen.h %wiregen.h,$(ALL_C_HEADER
# Every single object file.
ALL_OBJS := $(ALL_C_SOURCES:.c=.o)
# We always regen wiregen and printgen files, since SHA256STAMP protects against
# spurious rebuilds.
$(filter %printgen.h %printgen.c %wiregen.h %wiregen.c, $(ALL_C_HEADERS) $(ALL_C_SOURCES)): FORCE
# Generated from PLUGINS definition in plugins/Makefile
gen_list_of_builtin_plugins.h : plugins/Makefile Makefile
@echo GEN $@

View File

@ -60,6 +60,8 @@ doc-all: $(MANPAGES) doc/index.rst
$(MANPAGES): doc/%: doc/%.md
@if $(call SHA256STAMP_CHANGED,); then $(call VERBOSE, "mrkd $<", mrkd $< $@ && $(call SHA256STAMP,,\")); else touch $@; fi
$(MANPAGES): FORCE
doc/protocol-%.svg: test/test_protocol
test/test_protocol --svg < test/commits/$*.script > $@