Makefile: rebuild all objects if Makefile changes.

This doesn't cover external libs in general (which *could* be effected by
CFLAGS), but at least all our own objects are rebuilt.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2018-01-20 14:57:13 +10:30 committed by Christian Decker
parent 73c31757e1
commit c22d2c8dae
2 changed files with 9 additions and 9 deletions

View File

@ -243,7 +243,7 @@ ccan/ccan/cdump/tools/cdump-enumstr: ccan/ccan/cdump/tools/cdump-enumstr.o $(CDU
ALL_PROGRAMS += ccan/ccan/cdump/tools/cdump-enumstr
# Can't add to ALL_OBJS, as that makes a circular dep.
ccan/ccan/cdump/tools/cdump-enumstr.o: $(CCAN_HEADERS)
ccan/ccan/cdump/tools/cdump-enumstr.o: $(CCAN_HEADERS) Makefile
ccan/config.h: ccan/tools/configurator/configurator
if $< > $@.new; then mv $@.new $@; else rm $@.new; exit 1; fi
@ -265,14 +265,14 @@ $(ALL_TEST_PROGRAMS): %: %.o
$(ALL_PROGRAMS) $(ALL_TEST_PROGRAMS):
$(LINK.o) $(filter-out %.a,$^) $(LOADLIBES) $(EXTERNAL_LDLIBS) $(LDLIBS) -o $@
# Everything depends on the CCAN headers.
$(CCAN_OBJS) $(CDUMP_OBJS): $(CCAN_HEADERS)
# Everything depends on the CCAN headers, and Makefile
$(CCAN_OBJS) $(CDUMP_OBJS): $(CCAN_HEADERS) Makefile
# Except for CCAN, we treat everything else as dependent on external/ bitcoin/ common/ wire/ and all generated headers.
$(ALL_OBJS): $(BITCOIN_HEADERS) $(COMMON_HEADERS) $(CCAN_HEADERS) $(WIRE_HEADERS) $(ALL_GEN_HEADERS) $(EXTERNAL_HEADERS)
# Except for CCAN, we treat everything else as dependent on external/ bitcoin/ common/ wire/ and all generated headers, and Makefile
$(ALL_OBJS): $(BITCOIN_HEADERS) $(COMMON_HEADERS) $(CCAN_HEADERS) $(WIRE_HEADERS) $(ALL_GEN_HEADERS) $(EXTERNAL_HEADERS) Makefile
# We generate headers in two ways, so regen when either changes.
$(ALL_GEN_HEADERS): ccan/ccan/cdump/tools/cdump-enumstr $(WIRE_GEN)
# We generate headers in two ways, so regen when either changes (or Makefile)
$(ALL_GEN_HEADERS): ccan/ccan/cdump/tools/cdump-enumstr $(WIRE_GEN) Makefile
update-ccan:
mv ccan ccan.old

4
external/Makefile vendored
View File

@ -49,7 +49,7 @@ external/jsmn/jsmn.h:
external/jsmn/jsmn.c: external/jsmn/jsmn.h
[ -f $@ ]
external/jsmn.o: external/jsmn/jsmn.c
external/jsmn.o: external/jsmn/jsmn.c Makefile
$(COMPILE.c) -DJSMN_STRICT=1 $(OUTPUT_OPTION) $<
external/libjsmn.a: external/jsmn.o
@ -64,7 +64,7 @@ $(LIBBASE58_HEADERS):
[ -f $@ ] || git submodule update --init external/libbase58/
# Can't be inside submodule, as that makes git think it's dirty.
external/base58.o: $(LIBBASE58_SRC)
external/base58.o: $(LIBBASE58_SRC) Makefile
$(COMPILE.c) $(OUTPUT_OPTION) $<
external/libbase58.a: external/base58.o