2017-08-23 03:52:17 +02:00
|
|
|
#! /usr/bin/make
|
|
|
|
|
|
|
|
# Designed to be run one level up
|
2017-08-29 06:12:04 +02:00
|
|
|
onchaind-wrongdir:
|
|
|
|
$(MAKE) -C ../.. onchaind-all
|
2017-08-23 03:52:17 +02:00
|
|
|
|
2017-08-29 06:12:04 +02:00
|
|
|
default: onchaind-all
|
2017-08-23 03:52:17 +02:00
|
|
|
|
2017-08-29 06:12:04 +02:00
|
|
|
onchaind-all: lightningd/lightning_onchaind
|
2017-08-23 03:52:17 +02:00
|
|
|
|
2017-08-29 06:12:04 +02:00
|
|
|
onchaind/gen_onchain_types_names.h: onchaind/onchain_types.h ccan/ccan/cdump/tools/cdump-enumstr
|
|
|
|
ccan/ccan/cdump/tools/cdump-enumstr onchaind/onchain_types.h > $@
|
2017-08-23 03:52:17 +02:00
|
|
|
|
2017-08-29 06:12:04 +02:00
|
|
|
# onchaind needs these:
|
2017-08-23 03:52:17 +02:00
|
|
|
LIGHTNINGD_ONCHAIN_HEADERS_GEN := \
|
2017-08-29 06:12:04 +02:00
|
|
|
onchaind/gen_onchain_wire.h \
|
|
|
|
onchaind/gen_onchain_types_names.h
|
2017-08-23 03:52:17 +02:00
|
|
|
|
|
|
|
LIGHTNINGD_ONCHAIN_HEADERS_NOGEN := \
|
2017-08-29 06:12:04 +02:00
|
|
|
onchaind/onchain_types.h \
|
|
|
|
onchaind/onchain_wire.h
|
2017-08-23 03:52:17 +02:00
|
|
|
|
|
|
|
LIGHTNINGD_ONCHAIN_HEADERS := $(LIGHTNINGD_ONCHAIN_HEADERS_GEN) $(LIGHTNINGD_ONCHAIN_HEADERS_NOGEN)
|
|
|
|
|
2018-09-03 05:40:00 +02:00
|
|
|
LIGHTNINGD_ONCHAIN_SRC := onchaind/onchaind.c \
|
2017-08-29 06:12:04 +02:00
|
|
|
onchaind/gen_onchain_wire.c \
|
|
|
|
onchaind/onchain_wire.c
|
2017-08-23 03:52:17 +02:00
|
|
|
|
|
|
|
LIGHTNINGD_ONCHAIN_OBJS := $(LIGHTNINGD_ONCHAIN_SRC:.c=.o)
|
|
|
|
|
|
|
|
# Control daemon uses this:
|
|
|
|
LIGHTNINGD_ONCHAIN_CONTROL_HEADERS := \
|
2017-08-29 06:12:04 +02:00
|
|
|
onchaind/gen_onchain_wire.h \
|
|
|
|
onchaind/onchain_wire.h
|
2017-08-23 03:52:17 +02:00
|
|
|
LIGHTNINGD_ONCHAIN_CONTROL_SRC := $(LIGHTNINGD_ONCHAIN_CONTROL_HEADERS:.h=.c)
|
|
|
|
LIGHTNINGD_ONCHAIN_CONTROL_OBJS := $(LIGHTNINGD_ONCHAIN_CONTROL_SRC:.c=.o)
|
|
|
|
|
2017-08-29 06:12:04 +02:00
|
|
|
LIGHTNINGD_ONCHAIN_GEN_SRC := $(filter onchaind/gen_%, $(LIGHTNINGD_ONCHAIN_SRC) $(LIGHTNINGD_ONCHAIN_CONTROL_SRC))
|
2017-08-23 03:52:17 +02:00
|
|
|
|
2017-08-29 06:12:04 +02:00
|
|
|
LIGHTNINGD_ONCHAIN_SRC_NOGEN := $(filter-out onchaind/gen_%, $(LIGHTNINGD_ONCHAIN_SRC))
|
2017-08-23 03:52:17 +02:00
|
|
|
|
|
|
|
# Add to headers which any object might need.
|
|
|
|
LIGHTNINGD_HEADERS_GEN += $(LIGHTNINGD_ONCHAIN_HEADERS_GEN)
|
|
|
|
LIGHTNINGD_HEADERS_NOGEN += $(LIGHTNINGD_ONCHAIN_HEADERS_NOGEN)
|
|
|
|
|
|
|
|
$(LIGHTNINGD_ONCHAIN_OBJS): $(LIGHTNINGD_HEADERS)
|
|
|
|
|
2017-08-28 18:02:01 +02:00
|
|
|
# Common source we use.
|
|
|
|
ONCHAIND_COMMON_OBJS := \
|
2019-02-20 12:31:48 +01:00
|
|
|
common/amount.o \
|
2019-07-30 07:25:12 +02:00
|
|
|
common/bigsize.o \
|
2018-07-23 04:23:02 +02:00
|
|
|
common/bip32.o \
|
2020-04-02 04:16:32 +02:00
|
|
|
common/coin_mvt.o \
|
2020-05-15 12:29:53 +02:00
|
|
|
common/channel_id.o \
|
2018-03-29 04:06:45 +02:00
|
|
|
common/daemon.o \
|
2017-08-28 18:05:01 +02:00
|
|
|
common/daemon_conn.o \
|
2017-08-28 18:02:01 +02:00
|
|
|
common/derive_basepoints.o \
|
2017-08-28 18:05:01 +02:00
|
|
|
common/dev_disconnect.o \
|
2018-02-08 02:25:12 +01:00
|
|
|
common/gen_status_wire.o \
|
2017-08-28 18:02:01 +02:00
|
|
|
common/htlc_tx.o \
|
2017-08-28 18:05:01 +02:00
|
|
|
common/htlc_wire.o \
|
|
|
|
common/initial_commit_tx.o \
|
|
|
|
common/keyset.o \
|
|
|
|
common/key_derive.o \
|
2017-12-15 11:22:57 +01:00
|
|
|
common/memleak.o \
|
2017-08-28 18:05:01 +02:00
|
|
|
common/msg_queue.o \
|
2020-05-16 03:29:05 +02:00
|
|
|
common/node_id.o \
|
2020-01-23 00:38:04 +01:00
|
|
|
common/onionreply.o \
|
2018-02-23 06:53:47 +01:00
|
|
|
common/peer_billboard.o \
|
2017-08-28 18:02:01 +02:00
|
|
|
common/permute_tx.o \
|
2020-05-16 00:13:22 +02:00
|
|
|
common/setup.o \
|
2017-08-28 18:05:01 +02:00
|
|
|
common/status.o \
|
2018-02-08 02:25:12 +01:00
|
|
|
common/status_wire.o \
|
2018-01-08 11:01:09 +01:00
|
|
|
common/subdaemon.o \
|
2017-08-28 18:02:01 +02:00
|
|
|
common/type_to_string.o \
|
|
|
|
common/utils.o \
|
2018-07-23 04:23:02 +02:00
|
|
|
common/utxo.o \
|
2018-09-20 05:06:42 +02:00
|
|
|
common/version.o \
|
2020-08-25 03:55:38 +02:00
|
|
|
common/wallet.o
|
2017-08-28 18:02:01 +02:00
|
|
|
|
2017-08-29 06:12:04 +02:00
|
|
|
onchaind/gen_onchain_wire.h: $(WIRE_GEN) onchaind/onchain_wire.csv
|
2019-07-24 00:51:11 +02:00
|
|
|
$(WIRE_GEN) --page header $@ onchain_wire_type < onchaind/onchain_wire.csv > $@
|
2017-08-23 03:52:17 +02:00
|
|
|
|
2017-08-29 06:12:04 +02:00
|
|
|
onchaind/gen_onchain_wire.c: $(WIRE_GEN) onchaind/onchain_wire.csv
|
2019-07-24 00:51:11 +02:00
|
|
|
$(WIRE_GEN) --page impl ${@:.c=.h} onchain_wire_type < onchaind/onchain_wire.csv > $@
|
2017-08-23 03:52:17 +02:00
|
|
|
|
|
|
|
LIGHTNINGD_ONCHAIN_OBJS := $(LIGHTNINGD_ONCHAIN_SRC:.c=.o) $(LIGHTNINGD_ONCHAIN_GEN_SRC:.c=.o)
|
|
|
|
|
2017-08-28 18:13:01 +02:00
|
|
|
# Make sure these depend on everything.
|
|
|
|
ALL_OBJS += $(LIGHTNINGD_ONCHAIN_OBJS)
|
2017-08-29 06:12:04 +02:00
|
|
|
ALL_PROGRAMS += lightningd/lightning_onchaind
|
|
|
|
ALL_GEN_HEADERS += $(LIGHTNINGD_ONCHAIN_HEADERS_GEN)
|
2017-08-28 18:13:01 +02:00
|
|
|
|
2018-07-23 04:23:02 +02:00
|
|
|
lightningd/lightning_onchaind: $(LIGHTNINGD_ONCHAIN_OBJS) $(WIRE_ONION_OBJS) $(ONCHAIND_COMMON_OBJS) $(WIRE_OBJS) $(BITCOIN_OBJS) $(LIGHTNINGD_HSM_CLIENT_OBJS)
|
2017-08-23 03:52:17 +02:00
|
|
|
|
|
|
|
check-source: $(LIGHTNINGD_ONCHAIN_SRC_NOGEN:%=check-src-include-order/%)
|
|
|
|
check-source-bolt: $(LIGHTNINGD_ONCHAIN_SRC:%=bolt-check/%) $(LIGHTNINGD_ONCHAIN_HEADERS:%=bolt-check/%)
|
|
|
|
|
|
|
|
check-whitespace: $(LIGHTNINGD_ONCHAIN_SRC_NOGEN:%=check-whitespace/%) $(LIGHTNINGD_ONCHAIN_HEADERS_NOGEN:%=check-whitespace/%)
|
|
|
|
|
2017-08-29 06:12:04 +02:00
|
|
|
clean: onchaind-clean
|
2017-08-23 03:52:17 +02:00
|
|
|
|
2017-08-29 06:12:04 +02:00
|
|
|
onchaind-clean:
|
2017-11-23 04:03:07 +01:00
|
|
|
$(RM) $(LIGHTNINGD_ONCHAIN_OBJS) onchaind/gen_*
|
2017-08-23 03:52:17 +02:00
|
|
|
|
2017-12-10 13:41:10 +01:00
|
|
|
-include onchaind/test/Makefile
|