diff --git a/bitcoin/Makefile b/bitcoin/Makefile index 49e47d7c8..cb6874302 100644 --- a/bitcoin/Makefile +++ b/bitcoin/Makefile @@ -26,9 +26,11 @@ LIBBASE58_SRC := bitcoin/libbase58/base58.c # Can't be inside submodule, as that makes git think it's dirty. LIBBASE58_OBJS := bitcoin/libbase58.o -# Wildcards here are magic. See http://stackoverflow.com/questions/2973445/gnu-makefile-rule-generating-a-few-targets-from-a-single-source-file -bitcoin/libbase58/libbase58.% bitcoin/libbase58/base58.%: - git submodule update bitcoin/libbase58/ +# Wildcards trick from http://stackoverflow.com/questions/2973445/gnu-makefile-rule-generating-a-few-targets-from-a-single-source-file doesn't work with no dependency, so instead make one depend on the other: +$(LIBBASE58_SRC): $(LIBBASE58_HEADERS) + +$(LIBBASE58_HEADERS): + git submodule update bitcoin/libbase58/ || true [ -f $@ ] || git submodule update --init bitcoin/libbase58/ bitcoin/libbase58.o: bitcoin/libbase58/base58.c diff --git a/wire/Makefile b/wire/Makefile index 055ceb873..7c29bf528 100644 --- a/wire/Makefile +++ b/wire/Makefile @@ -42,8 +42,8 @@ wire/gen_onion_wire.h: $(WIRE_GEN) wire/gen_onion_wire_csv wire/gen_onion_wire.c: $(WIRE_GEN) wire/gen_onion_wire_csv $(WIRE_GEN) ${@:.c=.h} onion_type < wire/gen_onion_wire_csv > $@ -wire/gen_peer_wire.o: wire/gen_peer_wire.h -wire/gen_onion_wire.o: wire/gen_onion_wire.h +wire/gen_peer_wire.o: wire/gen_peer_wire.h $(CCAN_HEADERS) +wire/gen_onion_wire.o: wire/gen_onion_wire.h $(CCAN_HEADERS) check-source: $(WIRE_SRC:%=check-src-include-order/%) $(WIRE_HEADERS:%=check-hdr-include-order/%)