1#! /usr/bin/make
2
3CHANNELD_HEADERS :=			\
4	channeld/full_channel_error_names_gen.h	\
5	channeld/channeld_wiregen.h		\
6	channeld/channeld_htlc.h		\
7	channeld/commit_tx.h			\
8	channeld/full_channel.h			\
9	channeld/full_channel_error.h		\
10	channeld/watchtower.h
11
12CHANNELD_SRC := channeld/channeld.c	\
13	channeld/commit_tx.c			\
14	channeld/full_channel.c			\
15	channeld/channeld_wiregen.c		\
16	channeld/watchtower.c
17
18CHANNELD_OBJS := $(CHANNELD_SRC:.c=.o)
19$(CHANNELD_OBJS): $(CHANNELD_HEADERS)
20
21# Make sure these depend on everything.
22ALL_C_SOURCES += $(CHANNELD_SRC)
23ALL_C_HEADERS += $(CHANNELD_HEADERS)
24ALL_PROGRAMS += lightningd/lightning_channeld
25
26# Here's what lightningd depends on
27LIGHTNINGD_CONTROL_HEADERS += channeld/channeld_wiregen.h
28LIGHTNINGD_CONTROL_OBJS += channeld/channeld_wiregen.o
29
30# Common source we use.
31CHANNELD_COMMON_OBJS :=				\
32	common/amount.o				\
33	common/autodata.o			\
34	common/base32.o				\
35	common/bigsize.o			\
36	common/billboard.o			\
37	common/bip32.o				\
38	common/blinding.o			\
39	common/blockheight_states.o		\
40	common/channel_config.o			\
41	common/channel_id.o			\
42	common/channel_type.o			\
43	common/crypto_state.o			\
44	common/crypto_sync.o			\
45	common/cryptomsg.o			\
46	common/daemon.o				\
47	common/daemon_conn.o			\
48	common/derive_basepoints.o		\
49	common/dev_disconnect.o			\
50	common/ecdh_hsmd.o			\
51	common/features.o			\
52	common/fee_states.o			\
53	common/status_wiregen.o			\
54	common/peer_status_wiregen.o		\
55	common/gossip_rcvd_filter.o		\
56	common/gossip_store.o			\
57	common/hmac.o				\
58	common/htlc_state.o			\
59	common/htlc_trim.o			\
60	common/htlc_tx.o			\
61	common/htlc_wire.o			\
62	common/initial_channel.o		\
63	common/initial_commit_tx.o		\
64	common/keyset.o				\
65	common/key_derive.o			\
66	common/memleak.o			\
67	common/msg_queue.o			\
68	common/node_id.o			\
69	common/onion.o				\
70	common/onionreply.o			\
71	common/peer_billboard.o			\
72	common/peer_failed.o			\
73	common/penalty_base.o			\
74	common/per_peer_state.o			\
75	common/permute_tx.o			\
76	common/ping.o				\
77	common/psbt_open.o			\
78	common/private_channel_announcement.o	\
79	common/pseudorand.o			\
80	common/read_peer_msg.o			\
81	common/setup.o				\
82	common/sphinx.o				\
83	common/status.o				\
84	common/status_wire.o			\
85	common/subdaemon.o			\
86	common/timeout.o			\
87	common/type_to_string.o			\
88	common/utils.o				\
89	common/utxo.o				\
90	common/version.o			\
91	common/wire_error.o			\
92	common/wireaddr.o			\
93	gossipd/gossipd_peerd_wiregen.o		\
94	gossipd/gossip_store_wiregen.o		\
95	lightningd/gossip_msg.o			\
96	wire/fromwire.o				\
97	wire/towire.o
98
99channeld/full_channel_error_names_gen.h: channeld/full_channel_error.h ccan/ccan/cdump/tools/cdump-enumstr
100	ccan/ccan/cdump/tools/cdump-enumstr channeld/full_channel_error.h > $@
101
102lightningd/lightning_channeld: $(CHANNELD_OBJS) $(WIRE_ONION_OBJS) $(CHANNELD_COMMON_OBJS) $(WIRE_OBJS) $(BITCOIN_OBJS) $(HSMD_CLIENT_OBJS)
103
104include channeld/test/Makefile
105