From eac8401f8486b7d61252831bc0bccdfb41c43896 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Mon, 17 Oct 2022 11:07:05 +1030 Subject: [PATCH] Makefile: separate bolt12 wireobjects Most things don't want them, so don't link it into everything by default. Signed-off-by: Rusty Russell --- lightningd/Makefile | 2 +- plugins/Makefile | 4 ++-- plugins/bkpr/Makefile | 2 +- wire/Makefile | 8 +++++--- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/lightningd/Makefile b/lightningd/Makefile index afea16752..661f01faa 100644 --- a/lightningd/Makefile +++ b/lightningd/Makefile @@ -142,6 +142,6 @@ lightningd/plugin.o: plugins/list_of_builtin_plugins_gen.h lightningd/channel_state_names_gen.h: lightningd/channel_state.h ccan/ccan/cdump/tools/cdump-enumstr ccan/ccan/cdump/tools/cdump-enumstr lightningd/channel_state.h > $@ -lightningd/lightningd: $(LIGHTNINGD_OBJS) $(WALLET_OBJS) $(LIGHTNINGD_COMMON_OBJS) $(BITCOIN_OBJS) $(WIRE_OBJS) $(WIRE_ONION_OBJS) $(LIGHTNINGD_CONTROL_OBJS) $(HSMD_CLIENT_OBJS) $(DB_OBJS) +lightningd/lightningd: $(LIGHTNINGD_OBJS) $(WALLET_OBJS) $(LIGHTNINGD_COMMON_OBJS) $(BITCOIN_OBJS) $(WIRE_OBJS) $(WIRE_BOLT12_OBJS) $(WIRE_ONION_OBJS) $(LIGHTNINGD_CONTROL_OBJS) $(HSMD_CLIENT_OBJS) $(DB_OBJS) include lightningd/test/Makefile diff --git a/plugins/Makefile b/plugins/Makefile index 3585a834b..b05936ae4 100644 --- a/plugins/Makefile +++ b/plugins/Makefile @@ -192,9 +192,9 @@ $(PLUGIN_KEYSEND_OBJS): $(PLUGIN_PAY_LIB_HEADER) plugins/spenderp: bitcoin/block.o bitcoin/preimage.o bitcoin/psbt.o common/psbt_open.o wire/peer${EXP}_wiregen.o $(PLUGIN_SPENDER_OBJS) $(PLUGIN_LIB_OBJS) $(PLUGIN_COMMON_OBJS) $(JSMN_OBJS) -plugins/offers: $(PLUGIN_OFFERS_OBJS) $(PLUGIN_LIB_OBJS) $(PLUGIN_COMMON_OBJS) common/bolt12.o common/bolt12_merkle.o common/bolt11_json.o common/iso4217.o $(WIRE_OBJS) bitcoin/block.o common/channel_id.o bitcoin/preimage.o $(JSMN_OBJS) +plugins/offers: $(PLUGIN_OFFERS_OBJS) $(PLUGIN_LIB_OBJS) $(PLUGIN_COMMON_OBJS) common/bolt12.o common/bolt12_merkle.o common/bolt11_json.o common/iso4217.o $(WIRE_OBJS) $(WIRE_BOLT12_OBJS) bitcoin/block.o common/channel_id.o bitcoin/preimage.o $(JSMN_OBJS) -plugins/fetchinvoice: $(PLUGIN_FETCHINVOICE_OBJS) $(PLUGIN_LIB_OBJS) $(PLUGIN_COMMON_OBJS) common/bolt12.o common/bolt12_merkle.o common/iso4217.o $(WIRE_OBJS) bitcoin/block.o common/channel_id.o bitcoin/preimage.o $(JSMN_OBJS) common/gossmap.o common/fp16.o common/dijkstra.o common/route.o common/blindedpath.o common/hmac.o common/blinding.o +plugins/fetchinvoice: $(PLUGIN_FETCHINVOICE_OBJS) $(PLUGIN_LIB_OBJS) $(PLUGIN_COMMON_OBJS) common/bolt12.o common/bolt12_merkle.o common/iso4217.o $(WIRE_OBJS) $(WIRE_BOLT12_OBJS) bitcoin/block.o common/channel_id.o bitcoin/preimage.o $(JSMN_OBJS) common/gossmap.o common/fp16.o common/dijkstra.o common/route.o common/blindedpath.o common/hmac.o common/blinding.o plugins/funder: bitcoin/psbt.o common/psbt_open.o $(PLUGIN_FUNDER_OBJS) $(PLUGIN_LIB_OBJS) $(PLUGIN_COMMON_OBJS) $(JSMN_OBJS) diff --git a/plugins/bkpr/Makefile b/plugins/bkpr/Makefile index 47d622c84..b55a22bb6 100644 --- a/plugins/bkpr/Makefile +++ b/plugins/bkpr/Makefile @@ -37,7 +37,7 @@ PLUGIN_ALL_HEADER += $(BOOKKEEPER_HEADER) C_PLUGINS += plugins/bookkeeper PLUGINS += plugins/bookkeeper -plugins/bookkeeper: common/bolt12.o common/bolt12_merkle.o $(BOOKKEEPER_OBJS) $(PLUGIN_LIB_OBJS) $(JSMN_OBJTS) $(PLUGIN_COMMON_OBJS) $(WIRE_OBJS) $(DB_OBJS) +plugins/bookkeeper: common/bolt12.o common/bolt12_merkle.o $(BOOKKEEPER_OBJS) $(PLUGIN_LIB_OBJS) $(JSMN_OBJTS) $(PLUGIN_COMMON_OBJS) $(WIRE_OBJS) $(WIRE_BOLT12_OBJS) $(DB_OBJS) # The following files contain SQL-annotated statements that we need to extact BOOKKEEPER_SQL_FILES := \ diff --git a/wire/Makefile b/wire/Makefile index d6f1bf5f5..239dadf7a 100644 --- a/wire/Makefile +++ b/wire/Makefile @@ -15,18 +15,19 @@ WIRE_HEADERS := wire/onion_defs.h \ wire/peer$(EXP)_printgen.h \ wire/onion$(EXP)_printgen.h -# We don't include peer_printgen/onion_printgen here since most don't need it. +# We don't include peer_printgen/onion_printgen or bolt12 here since most don't need it. WIRE_SRC := wire/wire_sync.c \ wire/wire_io.c \ wire/fromwire.c \ wire/peer_wire.c \ wire/tlvstream.c \ wire/towire.c \ - wire/bolt12$(EXP)_wiregen.c \ wire/peer$(EXP)_wiregen.c \ wire/channel_type_wiregen.c \ wire/onion$(EXP)_wiregen.c +WIRE_BOLT12_SRC := wire/bolt12$(EXP)_wiregen.c + WIRE_PRINT_SRC := \ wire/onion$(EXP)_printgen.c \ wire/peer$(EXP)_printgen.c \ @@ -35,7 +36,8 @@ WIRE_PRINT_SRC := \ WIRE_OBJS := $(WIRE_SRC:.c=.o) WIRE_PRINT_OBJS := $(WIRE_PRINT_SRC:.c=.o) -$(WIRE_OBJS) $(WIRE_PRINT_OBJS): $(WIRE_HEADERS) +WIRE_BOLT12_OBJS := $(WIRE_BOLT12_SRC:.c=.o) +$(WIRE_OBJS) $(WIRE_PRINT_OBJS) $(WIRE_BOLT12_OBJS): $(WIRE_HEADERS) # Make sure these depend on everything: in case we're experimental, # include non-experimental ones here so they get rebuilt.