From af7e6158af90a2fea7fa3921aa250cb3539b73f4 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Thu, 23 Nov 2017 13:33:07 +1030 Subject: [PATCH] Makefile: clean needs to do more, distclean should remove everything. I checked this with git status --ignored after a full build and 'make distclean'. Signed-off-by: Rusty Russell --- Makefile | 2 +- bitcoin/Makefile | 4 ++++ channeld/Makefile | 2 +- closingd/Makefile | 2 +- common/Makefile | 5 +++++ external/Makefile | 6 +++--- gossipd/Makefile | 2 +- hsmd/Makefile | 2 +- lightningd/Makefile | 2 +- onchaind/Makefile | 2 +- openingd/Makefile | 2 +- 11 files changed, 20 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index aa4ce0ed2..19e71251a 100644 --- a/Makefile +++ b/Makefile @@ -285,7 +285,7 @@ clean: wire-clean $(RM) $(CCAN_OBJS) $(CDUMP_OBJS) $(ALL_OBJS) $(RM) $(ALL_PROGRAMS) $(ALL_PROGRAMS:=.o) $(RM) $(ALL_TEST_PROGRAMS) $(ALL_TEST_PROGRAMS:=.o) - $(RM) ccan/config.h gen_*.h + $(RM) ccan/config.h gen_*.h ccan/tools/configurator/configurator $(RM) ccan/ccan/cdump/tools/cdump-enumstr.o $(RM) check-bolt tools/check-bolt tools/*.o find . -name '*gcda' -delete diff --git a/bitcoin/Makefile b/bitcoin/Makefile index 47efb6f02..2250b20d3 100644 --- a/bitcoin/Makefile +++ b/bitcoin/Makefile @@ -62,3 +62,7 @@ check-whitespace: $(BITCOIN_SRC:%=check-whitespace/%) $(BITCOIN_HEADERS:%=check- bitcoin-tests: $(BITCOIN_TEST_PROGRAMS:%=unittest/%) +clean: bitcoin-clean + +bitcoin-clean: + $(RM) $(BITCOIN_OBJS) $(BITCOIN_TEST_PROGRAMS) $(BITCOIN_TEST_OBJS) diff --git a/channeld/Makefile b/channeld/Makefile index 5e2f1b538..49b47adc7 100644 --- a/channeld/Makefile +++ b/channeld/Makefile @@ -93,6 +93,6 @@ check-whitespace: $(LIGHTNINGD_CHANNEL_SRC_NOGEN:%=check-whitespace/%) $(LIGHTNI clean: lightningd/channel-clean lightningd/channel-clean: - $(RM) $(LIGHTNINGD_CHANNEL_OBJS) gen_* + $(RM) $(LIGHTNINGD_CHANNEL_OBJS) channeld/gen_* -include channeld/test/Makefile diff --git a/closingd/Makefile b/closingd/Makefile index d94bfe5a1..09b85f584 100644 --- a/closingd/Makefile +++ b/closingd/Makefile @@ -77,6 +77,6 @@ check-whitespace: $(LIGHTNINGD_CLOSING_SRC_NOGEN:%=check-whitespace/%) $(LIGHTNI clean: closingd-clean closingd-clean: - $(RM) $(LIGHTNINGD_CLOSING_OBJS) gen_* + $(RM) $(LIGHTNINGD_CLOSING_OBJS) closingd/gen_* -include closingd/test/Makefile diff --git a/common/Makefile b/common/Makefile index 8954f2a7b..9e059ea5d 100644 --- a/common/Makefile +++ b/common/Makefile @@ -65,4 +65,9 @@ check-whitespace: $(COMMON_SRC:%=check-whitespace/%) $(COMMON_HEADERS:%=check-wh check-source: $(COMMON_SRC:%=check-src-include-order/%) \ $(COMMON_HEADERS_NOGEN:%=check-hdr-include-order/%) +clean: common-clean + +common-clean: + $(RM) common/gen* + include common/test/Makefile diff --git a/external/Makefile b/external/Makefile index c0e6035ef..fb22ca5ba 100644 --- a/external/Makefile +++ b/external/Makefile @@ -84,11 +84,11 @@ distclean: external-distclean clean: external-clean external-clean: - $(RM) $(EXTERNAL_LIBS) + $(RM) $(EXTERNAL_LIBS) external/*.la external/*.o external-distclean: make -C external/libsodium distclean || true $(RM) -rf external/libbacktrace-build - $(RM) external/libsodium.la external/libsodium/src/libsodium/libsodium.la + $(RM) external/libsodium/src/libsodium/libsodium.la $(RM) external/libwally-core/src/secp256k1/libsecp256k1.la external/libwally-core/src/libwallycore.la - cd external/libwally-core && tools/cleanup.sh + $(RM) -r `git status --ignored --porcelain external/libwally-core | grep '^!! ' | cut -c3-` diff --git a/gossipd/Makefile b/gossipd/Makefile index 2111ed346..ea087313c 100644 --- a/gossipd/Makefile +++ b/gossipd/Makefile @@ -76,6 +76,6 @@ check-whitespace: $(LIGHTNINGD_GOSSIP_ALLSRC_NOGEN:%=check-whitespace/%) $(LIGHT clean: gossipd-clean gossipd-clean: - $(RM) $(LIGHTNINGD_GOSSIP_OBJS) gen_* + $(RM) $(LIGHTNINGD_GOSSIP_OBJS) gossipd/gen_* -include gossipd/test/Makefile diff --git a/hsmd/Makefile b/hsmd/Makefile index 5e5809407..8376d7fd1 100644 --- a/hsmd/Makefile +++ b/hsmd/Makefile @@ -81,6 +81,6 @@ check-whitespace: $(LIGHTNINGD_HSM_ALLSRC_NOGEN:%=check-whitespace/%) $(LIGHTNIN clean: lightningd/hsm-clean lightningd/hsm-clean: - $(RM) $(LIGHTNINGD_HSM_OBJS) gen_* + $(RM) $(LIGHTNINGD_HSM_OBJS) hsmd/gen_* -include hsmd/test/Makefile diff --git a/lightningd/Makefile b/lightningd/Makefile index 681a420fd..a5cba0fd2 100644 --- a/lightningd/Makefile +++ b/lightningd/Makefile @@ -105,6 +105,6 @@ lightningd/lightningd: $(LIGHTNINGD_OBJS) $(LIGHTNINGD_COMMON_OBJS) $(BITCOIN_OB clean: lightningd-clean lightningd-clean: - $(RM) $(LIGHTNINGD_OBJS) $(LIGHTNINGD_JSMN_OBJS) $(LIGHTNINGD_PROGRAM) + $(RM) $(LIGHTNINGD_OBJS) $(LIGHTNINGD_JSMN_OBJS) $(LIGHTNINGD_PROGRAM) lightningd/gen* include lightningd/test/Makefile diff --git a/onchaind/Makefile b/onchaind/Makefile index 48ab7266b..caf992805 100644 --- a/onchaind/Makefile +++ b/onchaind/Makefile @@ -86,6 +86,6 @@ check-whitespace: $(LIGHTNINGD_ONCHAIN_SRC_NOGEN:%=check-whitespace/%) $(LIGHTNI clean: onchaind-clean onchaind-clean: - $(RM) $(LIGHTNINGD_ONCHAIN_OBJS) gen_* + $(RM) $(LIGHTNINGD_ONCHAIN_OBJS) onchaind/gen_* -include onchaind/test/Makefile diff --git a/openingd/Makefile b/openingd/Makefile index c73ea61fd..f7d070d06 100644 --- a/openingd/Makefile +++ b/openingd/Makefile @@ -86,6 +86,6 @@ check-whitespace: $(LIGHTNINGD_OPENING_SRC_NOGEN:%=check-whitespace/%) $(LIGHTNI clean: opening-clean opening-clean: - $(RM) $(LIGHTNINGD_OPENING_OBJS) gen_* + $(RM) $(LIGHTNINGD_OPENING_OBJS) openingd/gen_* -include openingd/test/Makefile