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 \
daemon/netaddr.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 \
2017-01-10 06:08:33 +01:00
daemon/timeout.c \
2017-01-10 06:07:51 +01:00
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 \
daemon/pseudorand.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-07 02:07:06 +01:00
lightningd/derive_basepoints.c \
2017-02-07 02:44:21 +01:00
lightningd/funding_tx.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-02-24 06:52:55 +01:00
lightningd/peer_failed.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-01-10 06:08:33 +01:00
lightningd/gossip_control.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-01-10 06:08:33 +01:00
lightningd/peer_control.c \
2017-01-10 06:08:33 +01:00
lightningd/subdaemon.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 \
lightningd/lightningd.h \
2017-01-10 06:08:33 +01:00
lightningd/peer_control.h \
2017-01-11 00:44:17 +01:00
lightningd/subdaemon.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 = \
$( 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-03-07 02:26:12 +01: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
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-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-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-03-07 02:31:43 +01: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 ) $( CCAN_OBJS ) $( 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