2017-01-10 06:07:51 +01:00
#! /usr/bin/make
# Designed to be run one level up
lightningd-wrongdir :
$( MAKE) -C .. lightningd-all
2017-03-07 02:26:12 +01:00
lightningd-all : lightningd /lightningd lightningd /lightningd_hsm lightningd /lightningd_handshake lightningd /lightningd_gossip lightningd /lightningd_opening lightningd /lightningd_channel
2017-01-10 06:07:51 +01:00
default : lightningd -all
2017-01-10 06:08:33 +01:00
LIGHTNINGD_OLD_SRC := \
2017-03-02 13:21:49 +01:00
daemon/bitcoind.c \
2017-01-26 22:47:52 +01:00
daemon/broadcast.c \
2017-03-07 01:56:38 +01:00
daemon/chaintopology.c \
2017-01-10 06:07:51 +01:00
daemon/configdir.c \
2017-01-10 06:08:33 +01:00
daemon/dns.c \
2017-04-01 12:58:30 +02:00
daemon/invoice.c \
2017-01-10 06:07:51 +01:00
daemon/json.c \
2017-01-10 06:08:33 +01:00
daemon/jsonrpc.c \
2017-01-10 06:07:51 +01:00
daemon/log.c \
2017-01-10 06:08:33 +01:00
daemon/netaddr.c \
2017-01-10 06:07:51 +01:00
daemon/options.c \
daemon/opt_time.c \
daemon/pseudorand.c \
daemon/routing.c \
daemon/watch.c
2017-01-10 06:08:33 +01:00
LIGHTNINGD_OLD_OBJS := $( LIGHTNINGD_OLD_SRC:.c= .o)
LIGHTNINGD_OLD_HEADERS := $( LIGHTNINGD_OLD_SRC:.c= .h)
2017-02-07 02:44:22 +01:00
LIGHTNINGD_OLD_LIB_SRC := \
2017-02-21 05:45:28 +01:00
daemon/htlc_state.c \
2017-04-01 12:26:07 +02:00
daemon/pseudorand.c \
daemon/timeout.c
2017-02-07 02:44:22 +01:00
LIGHTNINGD_OLD_LIB_OBJS := $( LIGHTNINGD_OLD_LIB_SRC:.c= .o)
LIGHTNINGD_OLD_LIB_HEADERS := $( LIGHTNINGD_OLD_LIB_SRC:.c= .h)
2017-02-24 06:52:55 +01:00
# FIXME: put in a library so we don't link all of them.
2017-01-10 06:08:33 +01:00
LIGHTNINGD_LIB_SRC := \
2017-02-21 05:45:28 +01:00
lightningd/channel.c \
2017-02-07 02:44:21 +01:00
lightningd/channel_config.c \
2017-02-07 02:44:22 +01:00
lightningd/commit_tx.c \
2017-02-07 02:44:21 +01:00
lightningd/cryptomsg.c \
2017-02-21 05:45:29 +01:00
lightningd/crypto_sync.c \
2017-02-24 06:52:56 +01:00
lightningd/debug.c \
2017-03-19 21:32:44 +01:00
lightningd/daemon_conn.c \
2017-03-07 02:07:06 +01:00
lightningd/derive_basepoints.c \
2017-02-07 02:44:21 +01:00
lightningd/funding_tx.c \
2017-03-15 10:43:03 +01:00
lightningd/gossip_msg.c \
2017-02-07 02:44:22 +01:00
lightningd/htlc_tx.c \
2017-02-21 05:45:29 +01:00
lightningd/key_derive.c \
2017-03-10 11:44:40 +01:00
lightningd/msg_queue.c \
lightningd/peer_failed.c \
2017-04-12 18:10:10 +02:00
lightningd/ping.c \
2017-04-13 19:55:14 +02:00
lightningd/sphinx.c \
2017-03-19 21:24:12 +01:00
lightningd/status.c \
2017-02-21 05:45:29 +01:00
lightningd/utxo.c
2017-01-10 06:07:51 +01:00
LIGHTNINGD_LIB_OBJS := $( LIGHTNINGD_LIB_SRC:.c= .o)
2017-01-10 06:08:33 +01:00
LIGHTNINGD_LIB_HEADERS := $( LIGHTNINGD_LIB_SRC:.c= .h)
2017-01-10 06:07:51 +01:00
LIGHTNINGD_SRC := \
2017-02-21 05:49:02 +01:00
lightningd/build_utxos.c \
2017-04-01 12:24:59 +02:00
lightningd/dev_newhtlc.c \
2017-04-12 18:10:10 +02:00
lightningd/dev_ping.c \
2017-01-10 06:08:33 +01:00
lightningd/gossip_control.c \
2017-04-01 13:01:13 +02:00
lightningd/htlc_end.c \
2017-01-10 06:08:33 +01:00
lightningd/hsm_control.c \
2017-01-10 06:08:33 +01:00
lightningd/lightningd.c \
2017-04-01 15:05:29 +02:00
lightningd/pay.c \
2017-01-10 06:08:33 +01:00
lightningd/peer_control.c \
2017-03-10 11:57:17 +01:00
lightningd/subd.c
2017-01-10 06:07:51 +01:00
LIGHTNINGD_OBJS := $( LIGHTNINGD_SRC:.c= .o)
LIGHTNINGD_JSMN_OBJS := daemon/jsmn.o
LIGHTNINGD_JSMN_HEADERS := daemon/jsmn/jsmn.h
2017-01-13 01:18:11 +01:00
# We accumulate all lightningd/ headers in these three:
LIGHTNINGD_HEADERS_NOGEN = \
2017-02-21 05:49:02 +01:00
lightningd/build_utxos.h \
2017-01-10 06:08:33 +01:00
lightningd/gossip_control.h \
2017-01-10 06:08:33 +01:00
lightningd/hsm_control.h \
2017-04-01 13:01:13 +02:00
lightningd/htlc_end.h \
2017-01-10 06:08:33 +01:00
lightningd/lightningd.h \
2017-04-03 19:44:36 +02:00
lightningd/pay.h \
2017-01-10 06:08:33 +01:00
lightningd/peer_control.h \
2017-05-22 13:24:59 +02:00
lightningd/peer_state.h \
2017-03-10 11:48:43 +01:00
lightningd/subd.h \
2017-02-07 02:44:22 +01:00
$( LIGHTNINGD_OLD_LIB_HEADERS) \
2017-01-13 01:18:11 +01:00
$( LIGHTNINGD_LIB_HEADERS) \
$( WIRE_HEADERS) \
2017-01-11 00:44:17 +01:00
$( BITCOIN_HEADERS) \
$( CORE_HEADERS) \
2017-02-07 02:44:22 +01:00
$( CORE_TX_HEADERS) \
2017-01-13 01:18:11 +01:00
$( DAEMON_HEADERS)
# Generated headers
LIGHTNINGD_HEADERS_GEN = \
2017-05-22 13:24:59 +02:00
lightningd/gen_peer_state_names.h \
2017-01-13 01:18:11 +01:00
$( WIRE_GEN_HEADERS) \
$( GEN_HEADERS)
# Headers we don't directly own (ie. don't check them)
LIGHTNINGD_EXTERNAL_HEADERS = \
$( LIGHTNINGD_JSMN_HEADERS) \
2017-01-11 00:44:17 +01:00
$( CCAN_HEADERS) \
$( LIBBASE58_HEADERS) \
$( LIBSODIUM_HEADERS)
2017-01-10 06:07:51 +01:00
2017-01-13 01:18:11 +01:00
# All together in one convenient var
LIGHTNINGD_HEADERS = $( LIGHTNINGD_HEADERS_NOGEN) $( LIGHTNINGD_HEADERS_GEN) $( LIGHTNINGD_EXTERNAL_HEADERS)
2017-01-12 14:15:30 +01:00
# These included makefiles add their headers to the LIGHTNINGD_HEADERS
# variable so the include must preceed any actual use of the variable.
2017-01-10 06:08:33 +01:00
i n c l u d e l i g h t n i n g d / h s m / M a k e f i l e
2017-01-10 06:08:33 +01:00
i n c l u d e l i g h t n i n g d / h a n d s h a k e / M a k e f i l e
2017-01-10 06:08:33 +01:00
i n c l u d e l i g h t n i n g d / g o s s i p / M a k e f i l e
2017-02-21 05:45:29 +01:00
i n c l u d e l i g h t n i n g d / o p e n i n g / M a k e f i l e
2017-04-01 12:58:30 +02:00
i n c l u d e l i g h t n i n g d / c h a n n e l / M a k e f i l e
2017-01-10 06:08:33 +01:00
2017-01-13 01:18:11 +01:00
$(LIGHTNINGD_OBJS) $(LIGHTNINGD_LIB_OBJS) : $( LIGHTNINGD_HEADERS )
2017-01-12 14:15:30 +01:00
2017-05-22 13:24:59 +02:00
lightningd/gen_peer_state_names.h : lightningd /peer_state .h ccan /ccan /cdump /tools /cdump -enumstr
ccan/ccan/cdump/tools/cdump-enumstr lightningd/peer_state.h > $@
2017-01-10 06:07:51 +01:00
check-source : $( LIGHTNINGD_SRC :%=check -src -include -order /%)
check-source : $( LIGHTNINGD_LIB_SRC :%=check -src -include -order /%)
check-source : $( LIGHTNINGD_CLI_SRC :%=check -src -include -order /%)
2017-01-13 01:18:11 +01:00
check-source : $( LIGHTNINGD_HEADERS_NOGEN :%=check -hdr -include -order /%)
2017-02-21 05:45:28 +01:00
check-source-bolt : $( LIGHTNINGD_SRC :%=bolt -check /%) $( LIGHTNINGD_LIB_SRC :%=bolt -check /%) $( LIGHTNINGD_HEADERS_NOGEN :%=bolt -check /%)
2017-01-10 06:07:51 +01:00
2017-01-13 01:18:11 +01:00
check-whitespace : $( LIGHTNINGD_SRC :%=check -whitespace /%) $( LIGHTNINGD_HEADERS_NOGEN :%=check -whitespace /%) $( LIGHTNINGD_LIB_SRC :%=check -whitespace /%) $( LIGHTNINGD_LIB_HEADERS :%=check -whitespace /%)
2017-01-10 06:07:51 +01:00
2017-01-13 01:18:11 +01:00
check-makefile : check -lightningd -makefile
2017-01-10 06:07:51 +01:00
check-lightningd-makefile :
2017-01-13 01:18:11 +01:00
@for f in lightningd/*.h lightningd/*/*.h; do if ! echo $( LIGHTNINGD_HEADERS_NOGEN) $( LIGHTNINGD_HEADERS_GEN) "" | grep -q " $$ f " ; then echo $$ f not mentioned in LIGHTNINGD_HEADERS_NOGEN or LIGHTNINGD_HEADERS_GEN >& 2; exit 1; fi ; done
2017-01-10 06:07:51 +01:00
2017-04-01 13:01:13 +02:00
lightningd/lightningd : $( LIGHTNINGD_OBJS ) $( LIGHTNINGD_OLD_OBJS ) $( LIGHTNINGD_OLD_LIB_OBJS ) $( LIGHTNINGD_LIB_OBJS ) $( LIGHTNINGD_JSMN_OBJS ) $( CORE_OBJS ) $( CORE_TX_OBJS ) $( BITCOIN_OBJS ) $( WIRE_OBJS ) $( WIRE_ONION_OBJS ) $( CCAN_OBJS ) $( CCAN_SHACHAIN 48_OBJ ) $( LIGHTNINGD_HSM_CONTROL_OBJS ) $( LIGHTNINGD_HANDSHAKE_CONTROL_OBJS ) $( LIGHTNINGD_GOSSIP_CONTROL_OBJS ) $( LIBBASE 58_OBJS ) $( LIGHTNINGD_OPENING_CONTROL_OBJS ) $( LIGHTNINGD_CHANNEL_CONTROL_OBJS ) libsecp 256k 1.a libsodium .a libwallycore .a
2017-01-10 06:07:51 +01:00
clean : lightningd -clean
lightningd-clean :
$( RM) $( LIGHTNINGD_OBJS) $( LIGHTNINGD_LIB_OBJS) $( LIGHTNINGD_JSMN_OBJS)
2017-01-10 06:08:33 +01:00
i n c l u d e l i g h t n i n g d / t e s t / M a k e f i l e