2016-01-21 21:11:47 +01:00
|
|
|
#! /usr/bin/make
|
|
|
|
|
|
|
|
# Designed to be run one level up
|
|
|
|
daemon-wrongdir:
|
|
|
|
$(MAKE) -C .. daemon-all
|
|
|
|
|
2016-01-21 21:11:48 +01:00
|
|
|
daemon-all: daemon/lightningd daemon/lightning-cli
|
2016-01-21 21:11:47 +01:00
|
|
|
|
2016-01-21 21:11:48 +01:00
|
|
|
DAEMON_LIB_SRC := \
|
2016-01-21 21:11:48 +01:00
|
|
|
daemon/configdir.c \
|
2016-01-21 21:11:48 +01:00
|
|
|
daemon/json.c \
|
2016-01-21 21:11:48 +01:00
|
|
|
daemon/log.c \
|
|
|
|
daemon/pseudorand.c
|
|
|
|
DAEMON_LIB_OBJS := $(DAEMON_LIB_SRC:.c=.o)
|
|
|
|
|
|
|
|
DAEMON_SRC := \
|
2016-01-21 21:11:49 +01:00
|
|
|
daemon/bitcoind.c \
|
2016-04-24 12:07:13 +02:00
|
|
|
daemon/chaintopology.c \
|
2016-06-30 01:38:10 +02:00
|
|
|
daemon/channel.c \
|
2016-08-18 06:53:45 +02:00
|
|
|
daemon/commit_tx.c \
|
2016-01-21 21:15:28 +01:00
|
|
|
daemon/controlled_time.c \
|
2016-01-21 21:11:48 +01:00
|
|
|
daemon/cryptopkt.c \
|
2016-08-18 06:55:13 +02:00
|
|
|
daemon/db.c \
|
2016-01-21 21:11:48 +01:00
|
|
|
daemon/dns.c \
|
2016-08-31 07:21:41 +02:00
|
|
|
daemon/failure.c \
|
2016-08-26 08:01:19 +02:00
|
|
|
daemon/feechange.c \
|
2016-08-18 06:53:45 +02:00
|
|
|
daemon/htlc.c \
|
2016-09-06 09:17:49 +02:00
|
|
|
daemon/invoice.c \
|
2016-09-07 23:47:27 +02:00
|
|
|
daemon/irc_announce.c \
|
2016-01-21 21:11:48 +01:00
|
|
|
daemon/jsonrpc.c \
|
2016-01-21 21:11:47 +01:00
|
|
|
daemon/lightningd.c \
|
2016-01-21 21:11:48 +01:00
|
|
|
daemon/netaddr.c \
|
2016-05-09 22:58:17 +02:00
|
|
|
daemon/opt_time.c \
|
2016-08-18 06:53:45 +02:00
|
|
|
daemon/output_to_htlc.c \
|
2016-01-21 21:14:13 +01:00
|
|
|
daemon/packets.c \
|
2016-06-30 01:38:11 +02:00
|
|
|
daemon/pay.c \
|
|
|
|
daemon/peer.c \
|
2016-06-28 23:19:21 +02:00
|
|
|
daemon/routing.c \
|
2016-01-21 21:11:48 +01:00
|
|
|
daemon/secrets.c \
|
2016-10-06 22:06:20 +02:00
|
|
|
daemon/sphinx.c \
|
2016-01-21 21:11:49 +01:00
|
|
|
daemon/timeout.c \
|
2016-04-12 05:37:03 +02:00
|
|
|
daemon/wallet.c \
|
2016-01-21 21:14:13 +01:00
|
|
|
daemon/watch.c \
|
2016-11-08 22:34:27 +01:00
|
|
|
daemon/names.c \
|
2016-11-08 22:34:25 +01:00
|
|
|
irc.c
|
2016-01-21 21:14:13 +01:00
|
|
|
|
2016-01-21 21:11:47 +01:00
|
|
|
DAEMON_OBJS := $(DAEMON_SRC:.c=.o)
|
|
|
|
|
2016-01-21 21:11:48 +01:00
|
|
|
DAEMON_CLI_SRC := daemon/lightning-cli.c
|
|
|
|
DAEMON_CLI_OBJS := $(DAEMON_CLI_SRC:.c=.o)
|
|
|
|
|
2016-01-21 21:11:48 +01:00
|
|
|
DAEMON_JSMN_OBJS := daemon/jsmn.o
|
|
|
|
DAEMON_JSMN_HEADERS := daemon/jsmn/jsmn.h
|
|
|
|
|
2016-08-26 08:01:19 +02:00
|
|
|
DAEMON_GEN_HEADERS := \
|
|
|
|
daemon/gen_feechange_state_names.h \
|
2016-11-08 22:34:27 +01:00
|
|
|
daemon/gen_htlc_state_names.h \
|
|
|
|
daemon/gen_pkt_names.h \
|
|
|
|
daemon/gen_state_names.h
|
2016-08-18 06:53:45 +02:00
|
|
|
|
2016-01-21 21:11:47 +01:00
|
|
|
DAEMON_HEADERS := \
|
2016-01-21 21:11:49 +01:00
|
|
|
daemon/bitcoind.h \
|
2016-04-24 12:07:13 +02:00
|
|
|
daemon/chaintopology.h \
|
2016-06-30 01:38:10 +02:00
|
|
|
daemon/channel.h \
|
2016-08-18 06:53:45 +02:00
|
|
|
daemon/commit_tx.h \
|
2016-01-21 21:11:48 +01:00
|
|
|
daemon/configdir.h \
|
2016-01-21 21:15:28 +01:00
|
|
|
daemon/controlled_time.h \
|
2016-01-21 21:11:48 +01:00
|
|
|
daemon/cryptopkt.h \
|
2016-08-18 06:55:13 +02:00
|
|
|
daemon/db.h \
|
2016-01-21 21:11:48 +01:00
|
|
|
daemon/dns.h \
|
2016-08-31 07:21:41 +02:00
|
|
|
daemon/failure.h \
|
2016-08-26 08:01:19 +02:00
|
|
|
daemon/feechange.h \
|
|
|
|
daemon/feechange_state.h \
|
2016-06-30 01:38:11 +02:00
|
|
|
daemon/htlc.h \
|
2016-08-18 06:53:45 +02:00
|
|
|
daemon/htlc_state.h \
|
2016-09-06 09:17:49 +02:00
|
|
|
daemon/invoice.h \
|
2016-10-07 05:26:57 +02:00
|
|
|
daemon/irc_announce.h \
|
2016-01-21 21:11:48 +01:00
|
|
|
daemon/json.h \
|
2016-01-21 21:11:48 +01:00
|
|
|
daemon/jsonrpc.h \
|
2016-01-21 21:11:47 +01:00
|
|
|
daemon/lightningd.h \
|
|
|
|
daemon/log.h \
|
2016-11-08 22:34:27 +01:00
|
|
|
daemon/names.h \
|
2016-01-21 21:11:48 +01:00
|
|
|
daemon/netaddr.h \
|
2016-05-09 22:58:17 +02:00
|
|
|
daemon/opt_time.h \
|
2016-08-18 06:53:45 +02:00
|
|
|
daemon/output_to_htlc.h \
|
2016-08-18 06:53:45 +02:00
|
|
|
daemon/packets.h \
|
2016-06-30 01:38:11 +02:00
|
|
|
daemon/pay.h \
|
2016-01-21 21:11:48 +01:00
|
|
|
daemon/peer.h \
|
2016-01-21 21:11:48 +01:00
|
|
|
daemon/pseudorand.h \
|
2016-06-28 23:19:21 +02:00
|
|
|
daemon/routing.h \
|
2016-01-21 21:11:48 +01:00
|
|
|
daemon/secrets.h \
|
2016-10-06 22:06:20 +02:00
|
|
|
daemon/sphinx.h \
|
2016-01-21 21:11:49 +01:00
|
|
|
daemon/timeout.h \
|
2016-04-12 05:37:03 +02:00
|
|
|
daemon/wallet.h \
|
2016-01-21 21:11:49 +01:00
|
|
|
daemon/watch.h
|
2016-01-21 21:11:47 +01:00
|
|
|
|
2016-08-18 06:53:45 +02:00
|
|
|
daemon/gen_htlc_state_names.h: daemon/htlc_state.h ccan/ccan/cdump/tools/cdump-enumstr
|
|
|
|
ccan/ccan/cdump/tools/cdump-enumstr daemon/htlc_state.h > $@
|
|
|
|
|
2016-08-26 08:01:19 +02:00
|
|
|
daemon/gen_feechange_state_names.h: daemon/feechange_state.h ccan/ccan/cdump/tools/cdump-enumstr
|
|
|
|
ccan/ccan/cdump/tools/cdump-enumstr daemon/feechange_state.h > $@
|
|
|
|
|
2016-11-08 22:34:27 +01:00
|
|
|
daemon/gen_state_names.h: state_types.h ccan/ccan/cdump/tools/cdump-enumstr
|
|
|
|
ccan/ccan/cdump/tools/cdump-enumstr state_types.h > $@
|
|
|
|
|
|
|
|
# lightning.pb-c.h doesn't create a named enum, just a typedef. Hack it.
|
|
|
|
daemon/gen_pkt_names.h: lightning.pb-c.h ccan/ccan/cdump/tools/cdump-enumstr
|
|
|
|
(echo 'enum PktCase {'; grep '^ PKT__' lightning.pb-c.h; echo '};') | ccan/ccan/cdump/tools/cdump-enumstr - | sed 's/enum PktCase/Pkt__PktCase/' > $@
|
|
|
|
|
2016-08-18 06:53:45 +02:00
|
|
|
$(DAEMON_OBJS) $(DAEMON_LIB_OBJS) $(DAEMON_CLI_OBJS): $(DAEMON_HEADERS) $(DAEMON_JSMN_HEADERS) $(BITCOIN_HEADERS) $(CORE_HEADERS) $(GEN_HEADERS) $(DAEMON_GEN_HEADERS) $(CCAN_HEADERS)
|
2016-01-21 21:11:48 +01:00
|
|
|
$(DAEMON_JSMN_OBJS): $(DAEMON_JSMN_HEADERS)
|
2016-01-21 21:11:47 +01:00
|
|
|
|
|
|
|
check-source: $(DAEMON_SRC:%=check-src-include-order/%)
|
2016-01-21 21:11:48 +01:00
|
|
|
check-source: $(DAEMON_LIB_SRC:%=check-src-include-order/%)
|
|
|
|
check-source: $(DAEMON_CLI_SRC:%=check-src-include-order/%)
|
2016-01-21 21:11:47 +01:00
|
|
|
check-source: $(DAEMON_HEADERS:%=check-hdr-include-order/%)
|
2016-01-21 21:11:47 +01:00
|
|
|
check-daemon-makefile:
|
2016-08-18 06:53:45 +02:00
|
|
|
@if [ "`ls daemon/*.h | grep -v daemon/gen | tr '\012' ' '`" != "`echo $(DAEMON_HEADERS) ''`" ]; then echo DAEMON_HEADERS incorrect; exit 1; fi
|
2016-01-21 21:11:47 +01:00
|
|
|
|
2016-01-21 21:11:48 +01:00
|
|
|
# Git submodules are seriously broken.
|
2016-10-07 05:28:57 +02:00
|
|
|
daemon/jsmn/jsmn.h:
|
2016-01-21 21:11:48 +01:00
|
|
|
git submodule update daemon/jsmn/
|
|
|
|
[ -f $@ ] || git submodule update --init daemon/jsmn/
|
|
|
|
|
2016-10-07 05:28:57 +02:00
|
|
|
# If we tell Make that the above builds both, it runs it twice in
|
|
|
|
# parallel. So we lie :(
|
|
|
|
daemon/jsmn/jsmn.c: daemon/jsmn/jsmn.h
|
|
|
|
[ -f $@ ]
|
|
|
|
|
2016-01-21 21:11:48 +01:00
|
|
|
daemon/jsmn.o: daemon/jsmn/jsmn.c
|
|
|
|
$(COMPILE.c) -DJSMN_STRICT=1 $(OUTPUT_OPTION) $<
|
|
|
|
|
2016-01-21 21:11:48 +01:00
|
|
|
daemon/lightningd: $(DAEMON_OBJS) $(DAEMON_LIB_OBJS) $(DAEMON_JSMN_OBJS) $(CORE_OBJS) $(BITCOIN_OBJS) $(CCAN_OBJS) libsecp256k1.a
|
|
|
|
|
|
|
|
daemon/lightning-cli: $(DAEMON_CLI_OBJS) $(DAEMON_LIB_OBJS) $(DAEMON_JSMN_OBJS) $(CORE_OBJS) $(BITCOIN_OBJS) $(CCAN_OBJS) libsecp256k1.a
|
2016-03-08 01:02:15 +01:00
|
|
|
|
|
|
|
daemon-clean:
|
|
|
|
$(RM) $(DAEMON_OBJS) $(DAEMON_LIB_OBJS) $(DAEMON_CLI_OBJS) $(DAEMON_JSMN_OBJS)
|
2016-08-18 06:53:45 +02:00
|
|
|
|
|
|
|
daemon-maintainer-clean:
|
|
|
|
$(RM) $(DAEMON_GEN_HEADERS)
|
2016-08-23 05:59:02 +02:00
|
|
|
|
|
|
|
include daemon/test/Makefile
|