Browse Source

external/Makefile: fix build from fresh git clone.

```
make: *** No rule to make target 'external/gheap/gheap.h', needed by 'bitcoin/chainparams.o'.  Stop.
make: *** Waiting for unfinished jobs....
```

Just simplify the Makefile to make all the external headers we use
dependent on submodcheck.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
bump-pyln-proto
Rusty Russell 4 years ago
committed by neil saitug
parent
commit
95a0249272
  1. 16
      external/Makefile

16
external/Makefile

@ -16,13 +16,15 @@ endif
LIBSODIUM_HEADERS := external/libsodium/src/libsodium/include/sodium.h LIBSODIUM_HEADERS := external/libsodium/src/libsodium/include/sodium.h
LIBWALLY_HEADERS := external/libwally-core/include/wally_bip32.h \ LIBWALLY_HEADERS := external/libwally-core/include/wally_bip32.h \
external/libwally-core/include/wally_core.h \ external/libwally-core/include/wally_core.h \
external/libwally-core/include/wally_psbt.h \
external/libwally-core/include/wally_crypto.h external/libwally-core/include/wally_crypto.h
LIBSECP_HEADERS := external/libwally-core/src/secp256k1/include/secp256k1_ecdh.h \ LIBSECP_HEADERS := external/libwally-core/src/secp256k1/include/secp256k1_ecdh.h \
external/libwally-core/src/secp256k1/include/secp256k1.h external/libwally-core/src/secp256k1/include/secp256k1.h
JSMN_HEADERS := external/jsmn/jsmn.h JSMN_HEADERS := external/jsmn/jsmn.h
GHEAP_HEADERS := external/gheap/gheap.h external/gheap/galgorithm.h GHEAP_HEADERS := external/gheap/gheap.h
LIBBACKTRACE_HEADERS := external/libbacktrace/backtrace.h
EXTERNAL_HEADERS := $(LIBSODIUM_HEADERS) $(LIBWALLY_HEADERS) $(LIBSECP_HEADERS) $(JSMN_HEADERS) $(GHEAP_HEADERS) EXTERNAL_HEADERS := $(LIBSODIUM_HEADERS) $(LIBWALLY_HEADERS) $(LIBSECP_HEADERS) $(JSMN_HEADERS) $(GHEAP_HEADERS) $(LIBBACKTRACE_HEADERS)
EXTERNAL_LIBS := ${TARGET_DIR}/libwallycore.a ${TARGET_DIR}/libsecp256k1.a ${TARGET_DIR}/libjsmn.a ${TARGET_DIR}/libbacktrace.a EXTERNAL_LIBS := ${TARGET_DIR}/libwallycore.a ${TARGET_DIR}/libsecp256k1.a ${TARGET_DIR}/libjsmn.a ${TARGET_DIR}/libbacktrace.a
EXTERNAL_INCLUDE_FLAGS := \ EXTERNAL_INCLUDE_FLAGS := \
@ -47,19 +49,17 @@ EXTERNAL_LDLIBS := -L${TARGET_DIR} $(patsubst lib%.a,-l%,$(notdir $(EXTERNAL_LIB
submodcheck: FORCE submodcheck: FORCE
@tools/refresh-submodules.sh $(SUBMODULES) @tools/refresh-submodules.sh $(SUBMODULES)
$(EXTERNAL_HEADERS): submodcheck
# We build libsodium, since Ubuntu xenial has one too old. # We build libsodium, since Ubuntu xenial has one too old.
$(TARGET_DIR)/libsodium.a: $(TARGET_DIR)/libsodium-build/src/libsodium/libsodium.la $(TARGET_DIR)/libsodium.a: $(TARGET_DIR)/libsodium-build/src/libsodium/libsodium.la
$(MAKE) -C $(TARGET_DIR)/libsodium-build DESTDIR=$$(pwd)/$(TARGET_DIR) install-exec $(MAKE) -C $(TARGET_DIR)/libsodium-build DESTDIR=$$(pwd)/$(TARGET_DIR) install-exec
external/libsodium/src/libsodium/include/sodium.h: submodcheck
$(TARGET_DIR)/libsodium-build/src/libsodium/libsodium.la: external/libsodium/src/libsodium/include/sodium.h $(TARGET_DIR)/libsodium-build/src/libsodium/libsodium.la: external/libsodium/src/libsodium/include/sodium.h
cd external/libsodium && ./autogen.sh cd external/libsodium && ./autogen.sh
mkdir -p ${TARGET_DIR}/libsodium-build mkdir -p ${TARGET_DIR}/libsodium-build
cd $(TARGET_DIR)/libsodium-build && $(TOP)/libsodium/configure CC="$(CC)" --enable-static=yes $(CROSSCOMPILE_OPTS) --enable-shared=no --prefix=/ --libdir=/ && $(MAKE) cd $(TARGET_DIR)/libsodium-build && $(TOP)/libsodium/configure CC="$(CC)" --enable-static=yes $(CROSSCOMPILE_OPTS) --enable-shared=no --prefix=/ --libdir=/ && $(MAKE)
$(LIBWALLY_HEADERS) $(LIBSECP_HEADERS): submodcheck
# libsecp included in libwally. # libsecp included in libwally.
# Wildcards here are magic. See http://stackoverflow.com/questions/2973445/gnu-makefile-rule-generating-a-few-targets-from-a-single-source-file # Wildcards here are magic. See http://stackoverflow.com/questions/2973445/gnu-makefile-rule-generating-a-few-targets-from-a-single-source-file
$(TARGET_DIR)/libsecp256k1.% $(TARGET_DIR)/libwallycore.%: $(TARGET_DIR)/libwally-core-build/src/secp256k1/libsecp256k1.la $(TARGET_DIR)/libwally-core-build/src/libwallycore.la $(TARGET_DIR)/libsecp256k1.% $(TARGET_DIR)/libwallycore.%: $(TARGET_DIR)/libwally-core-build/src/secp256k1/libsecp256k1.la $(TARGET_DIR)/libwally-core-build/src/libwallycore.la
@ -75,8 +75,6 @@ $(TARGET_DIR)/libwally-core-build/src/libwallycore.% $(TARGET_DIR)/libwally-core
mkdir -p ${TARGET_DIR}/libwally-core-build mkdir -p ${TARGET_DIR}/libwally-core-build
cd ${TARGET_DIR}/libwally-core-build && PYTHON_VERSION=3 CFLAGS=-std=c99 ${TOP}/libwally-core/configure CC="$(CC)" --enable-static=yes $(CROSSCOMPILE_OPTS) --enable-module-recovery --enable-elements --enable-shared=no --prefix=/ --libdir=/ --enable-debug && $(MAKE) cd ${TARGET_DIR}/libwally-core-build && PYTHON_VERSION=3 CFLAGS=-std=c99 ${TOP}/libwally-core/configure CC="$(CC)" --enable-static=yes $(CROSSCOMPILE_OPTS) --enable-module-recovery --enable-elements --enable-shared=no --prefix=/ --libdir=/ --enable-debug && $(MAKE)
external/jsmn/jsmn.h: submodcheck
# If we tell Make that the above builds both, it runs it twice in # If we tell Make that the above builds both, it runs it twice in
# parallel. So we lie :( # parallel. So we lie :(
external/jsmn/jsmn.c: external/jsmn/jsmn.h external/jsmn/jsmn.c: external/jsmn/jsmn.h
@ -89,8 +87,6 @@ $(TARGET_DIR)/jsmn-build/jsmn.o: external/jsmn/jsmn.c Makefile
$(TARGET_DIR)/libjsmn.a: $(TARGET_DIR)/jsmn-build/jsmn.o $(TARGET_DIR)/libjsmn.a: $(TARGET_DIR)/jsmn-build/jsmn.o
$(AR) rc $@ $< $(AR) rc $@ $<
external/libbacktrace/backtrace.h: submodcheck
# Need separate build dir: changes inside submodule make git think it's dirty. # Need separate build dir: changes inside submodule make git think it's dirty.
$(TARGET_DIR)/libbacktrace.a: external/libbacktrace/backtrace.h $(TARGET_DIR)/libbacktrace.a: external/libbacktrace/backtrace.h
@mkdir $(TARGET_DIR)/libbacktrace-build 2>/dev/null || true @mkdir $(TARGET_DIR)/libbacktrace-build 2>/dev/null || true

Loading…
Cancel
Save