Browse Source

Makefiles: fix from-scratch parallel build.

1) Need config.h before wire/gen_ are compiled.
2) The rule to checkout the libbase58 submodule doesn't work, so use the older
   one-depends-on-the-other approach.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
ppa-0.6.1
Rusty Russell 8 years ago
parent
commit
dc562f0533
  1. 8
      bitcoin/Makefile
  2. 4
      wire/Makefile

8
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

4
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/%)

Loading…
Cancel
Save