external/Makefile: fix parallel build with missing secp headers.

Fixes: #4229
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2020-11-30 10:47:08 +10:30 committed by Christian Decker
parent 32de621886
commit 68c6ae67b3
2 changed files with 4 additions and 3 deletions

3
external/Makefile vendored
View File

@ -49,6 +49,7 @@ EXTERNAL_LDLIBS := -L${TARGET_DIR} $(patsubst lib%.a,-l%,$(notdir $(EXTERNAL_LIB
submodcheck: FORCE
@tools/refresh-submodules.sh $(SUBMODULES)
@cd external/libwally-core && ../../tools/refresh-submodules.sh src/secp256k1
$(EXTERNAL_HEADERS): submodcheck
@ -68,7 +69,7 @@ $(TARGET_DIR)/libsecp256k1.% $(TARGET_DIR)/libwallycore.%: $(TARGET_DIR)/libwall
# Build libwally-core.
$(TARGET_DIR)/libwally-core-build/src/libwallycore.% $(TARGET_DIR)/libwally-core-build/src/secp256k1/libsecp256k1.%: $(LIBWALLY_HEADERS) $(LIBSECP_HEADERS)
cd external/libwally-core && git submodule init && git submodule update && ./tools/autogen.sh
cd external/libwally-core && ./tools/autogen.sh
mkdir -p ${TARGET_DIR}/libwally-core-build
cd ${TARGET_DIR}/libwally-core-build && 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)

View File

@ -5,8 +5,8 @@ if [ $# = 0 ]; then
exit 1
fi
# If no git dir, forget it.
[ -d .git ] || exit 0
# If no git dir (or, if we're a submodule, git file), forget it.
[ -e .git ] || exit 0
# git submodule can't run in parallel. Really.
# Wait for it to finish if in parallel.