From 15e86f2bba827bbce2fe3421ece5953e6c1e121d Mon Sep 17 00:00:00 2001 From: Vincenzo Palazzo Date: Wed, 24 May 2023 19:42:58 +0200 Subject: [PATCH] fix: prefixing external build dir This is a simplification for our build system that allows for managing and cleaning the external build artefacts in an easy way. We have a hard time with the suffix `-modded` inside the version with some architecture when building a tagged version. Link: https://discord.com/channels/899980449231814676/899989729183940629/1110957992158965770 Reported-by: @ctrlbreak- Suggested-by: Rusty Russell Co-developed-by: @jsarenik Signed-off-by: Vincenzo Palazzo --- external/.gitignore | 19 +------------------ external/Makefile | 14 ++++---------- 2 files changed, 5 insertions(+), 28 deletions(-) diff --git a/external/.gitignore b/external/.gitignore index fd9b925c8..dd07bff2c 100644 --- a/external/.gitignore +++ b/external/.gitignore @@ -1,18 +1 @@ -x86_64-linux-gnu -aarch64-linux-gnu -arm-linux-gnueabihf -x86_64-pc-linux-gnu -arm64-apple-darwin* -x86_64-apple-darwin* - -libbacktrace-build/ -libbacktrace.a -libbacktrace.la -libbase58/ -libbase58.a -libwally-core-build/ -libjsmn.a -libsecp256k1.a -libsecp256k1.la -libwallycore.a -libwallycore.la +build-* diff --git a/external/Makefile b/external/Makefile index c922657ce..ce8310dbe 100644 --- a/external/Makefile +++ b/external/Makefile @@ -13,9 +13,9 @@ endif TOP := ../.. ifdef BUILD CROSSCOMPILE_OPTS := --host="$(MAKE_HOST)" --build="$(BUILD)" -TARGET_DIR := external/$(MAKE_HOST) +TARGET_DIR := external/build-$(MAKE_HOST) else -TARGET_DIR := external/$(shell ${CC} -dumpmachine) +TARGET_DIR := external/build-$(shell ${CC} -dumpmachine) endif LIBSODIUM_HEADERS := external/libsodium/src/libsodium/include/sodium.h @@ -123,14 +123,8 @@ distclean: external-distclean clean: external-clean external-clean: - $(RM) $(EXTERNAL_LIBS) $(TARGET_DIR)/*.la $(TARGET_DIR)/*.o - $(RM) $(TARGET_DIR)/jsmn-build/jsmn.o - $(RM) -r $(TARGET_DIR)/lowdown-build/* - if [ -f ${TARGET_DIR}/libsodium-build/Makefile ]; then make -C ${TARGET_DIR}/libsodium-build clean; fi - if [ -f ${TARGET_DIR}/libwally-core-build/Makefile ]; then make -C ${TARGET_DIR}/libwally-core-build clean; fi - if [ -f ${TARGET_DIR}/libwally-core-build/src/Makefile ]; then make -C ${TARGET_DIR}/libwally-core-build/src clean; fi - if [ -f ${TARGET_DIR}/libbacktrace-build/Makefile ]; then make -C ${TARGET_DIR}/libbacktrace-build clean; fi - if [ -f external/lowdown/Makefile.configure ]; then $(MAKE) -C external/lowdown clean; fi + $(RM) $(EXTERNAL_LIBS) + $(RM) -rf $(TARGET_DIR) external-distclean: make -C external/libsodium distclean || true