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-08-29 06:12:04 +02:00
LIGHTNINGD_PROGRAM := lightningd/lightningd
2017-07-05 07:33:40 +02:00
2017-08-29 06:12:04 +02:00
ALL_PROGRAMS += $( LIGHTNINGD_PROGRAM)
2017-08-28 18:11:01 +02:00
2017-08-29 06:12:04 +02:00
lightningd-all : $( LIGHTNINGD_PROGRAM )
2017-01-10 06:07:51 +01:00
default : lightningd -all
2017-08-28 18:02:01 +02:00
# Common source we use.
LIGHTNINGD_COMMON_OBJS := \
2017-08-28 18:05:01 +02:00
common/bip32.o \
common/channel_config.o \
2017-08-28 18:04:01 +02:00
common/configdir.o \
2017-10-11 11:56:50 +02:00
common/crypto_state.o \
2017-08-28 18:02:01 +02:00
common/derive_basepoints.o \
common/funding_tx.o \
2017-08-28 18:04:01 +02:00
common/htlc_state.o \
2017-08-28 18:05:01 +02:00
common/htlc_wire.o \
2017-09-28 05:41:18 +02:00
common/io_debug.o \
2017-08-28 18:05:01 +02:00
common/key_derive.o \
2017-08-28 18:04:01 +02:00
common/json.o \
2017-08-28 18:05:01 +02:00
common/msg_queue.o \
2017-08-28 18:02:01 +02:00
common/permute_tx.o \
2017-08-28 18:04:01 +02:00
common/pseudorand.o \
2017-08-28 18:05:01 +02:00
common/sphinx.o \
2017-08-28 18:04:01 +02:00
common/timeout.o \
2017-08-28 18:02:01 +02:00
common/type_to_string.o \
common/utils.o \
2017-08-28 18:05:01 +02:00
common/utxo.o \
2017-08-28 18:02:01 +02:00
common/version.o \
common/withdraw_tx.o
2017-01-10 06:07:51 +01:00
LIGHTNINGD_SRC := \
2017-08-28 18:04:01 +02:00
lightningd/bitcoind.c \
2017-02-21 05:49:02 +01:00
lightningd/build_utxos.c \
2017-08-28 18:04:01 +02:00
lightningd/chaintopology.c \
lightningd/dns.c \
2017-01-10 06:08:33 +01:00
lightningd/gossip_control.c \
2017-08-28 18:05:01 +02:00
lightningd/gossip_msg.c \
2017-01-10 06:08:33 +01:00
lightningd/hsm_control.c \
2017-08-28 18:04:01 +02:00
lightningd/htlc_end.c \
lightningd/invoice.c \
lightningd/jsonrpc.c \
2017-01-10 06:08:33 +01:00
lightningd/lightningd.c \
2017-08-28 18:04:01 +02:00
lightningd/log.c \
lightningd/netaddr.c \
2017-05-22 13:26:49 +02:00
lightningd/new_connection.c \
2017-08-28 18:04:01 +02:00
lightningd/opt_time.c \
lightningd/options.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-06-20 07:45:03 +02:00
lightningd/peer_htlcs.c \
2017-08-28 18:04:01 +02:00
lightningd/subd.c \
lightningd/watch.c
2017-01-10 06:07:51 +01:00
2017-08-28 18:04:01 +02:00
# Source files without corresponding headers
LIGHTNINGD_SRC_NOHDR := \
lightningd/dev_ping.c \
LIGHTNINGD_OBJS := $( LIGHTNINGD_SRC:.c= .o) $( LIGHTNINGD_SRC_NOHDR:.c= .o)
2017-01-10 06:07:51 +01:00
2017-08-28 18:13:01 +02:00
# Make sure these depend on everything.
ALL_OBJS += $( LIGHTNINGD_OBJS)
2017-01-13 01:18:11 +01:00
# We accumulate all lightningd/ headers in these three:
LIGHTNINGD_HEADERS_NOGEN = \
2017-08-28 18:04:01 +02:00
$( LIGHTNINGD_SRC:.c= .h) \
2017-08-28 18:13:01 +02:00
lightningd/peer_state.h
2017-01-13 01:18:11 +01:00
# Generated headers
LIGHTNINGD_HEADERS_GEN = \
2017-08-28 18:13:01 +02:00
lightningd/gen_peer_state_names.h
2017-01-13 01:18:11 +01:00
2017-08-29 06:12:04 +02:00
ALL_GEN_HEADERS += $( LIGHTNINGD_HEADERS_GEN)
2017-01-13 01:18:11 +01:00
# All together in one convenient var
2017-08-28 18:13:01 +02:00
LIGHTNINGD_HEADERS = $( LIGHTNINGD_HEADERS_NOGEN) $( LIGHTNINGD_HEADERS_GEN) $( EXTERNAL_HEADERS) $( WIRE_HEADERS) $( BITCOIN_HEADERS) $( COMMON_HEADERS) $( WALLET_LIB_HEADERS)
2017-01-13 01:18:11 +01:00
2017-08-28 18:05:01 +02:00
$(LIGHTNINGD_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-08-28 18:04:01 +02:00
check-source : $( LIGHTNINGD_SRC :%=check -src -include -order /%) $( LIGHTNINGD_SRC_NOHDR :%=check -src -include -order /%)
2017-01-13 01:18:11 +01:00
check-source : $( LIGHTNINGD_HEADERS_NOGEN :%=check -hdr -include -order /%)
2017-08-28 18:05:01 +02:00
check-source-bolt : $( LIGHTNINGD_SRC :%=bolt -check /%) $( LIGHTNINGD_HEADERS_NOGEN :%=bolt -check /%)
2017-01-10 06:07:51 +01:00
2017-08-28 18:05:01 +02:00
check-whitespace : $( LIGHTNINGD_SRC :%=check -whitespace /%) $( LIGHTNINGD_HEADERS_NOGEN :%=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-08-29 06:12:04 +02:00
lightningd/lightningd : $( LIGHTNINGD_OBJS ) $( LIGHTNINGD_COMMON_OBJS ) $( BITCOIN_OBJS ) $( WIRE_OBJS ) $( WIRE_ONION_OBJS ) $( LIGHTNINGD_HSM_CONTROL_OBJS ) $( LIGHTNINGD_HANDSHAKE_CONTROL_OBJS ) $( LIGHTNINGD_GOSSIP_CONTROL_OBJS ) $( LIGHTNINGD_OPENING_CONTROL_OBJS ) $( LIGHTNINGD_CHANNEL_CONTROL_OBJS ) $( LIGHTNINGD_CLOSING_CONTROL_OBJS ) $( LIGHTNINGD_ONCHAIN_CONTROL_OBJS ) $( WALLET_LIB_OBJS )
2017-01-10 06:07:51 +01:00
clean : lightningd -clean
lightningd-clean :
2017-08-29 06:12:04 +02:00
$( RM) $( LIGHTNINGD_OBJS) $( LIGHTNINGD_JSMN_OBJS) $( LIGHTNINGD_PROGRAM)
2017-01-10 06:07:51 +01:00
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