2015-05-26 06:38:12 +02:00
|
|
|
#! /usr/bin/make
|
2016-11-21 01:09:13 +01:00
|
|
|
NAME=Bitcoin Savings & Trust Daily Interest II
|
2015-05-26 06:38:12 +02:00
|
|
|
|
|
|
|
# Needs to have oneof support: Ubuntu vivid's is too old :(
|
|
|
|
PROTOCC:=protoc-c
|
|
|
|
|
2016-01-21 21:08:08 +01:00
|
|
|
# We use our own internal ccan copy.
|
|
|
|
CCANDIR := ccan
|
|
|
|
|
2016-05-02 08:28:56 +02:00
|
|
|
# Where we keep the BOLT RFCs
|
2016-05-04 08:33:04 +02:00
|
|
|
BOLTDIR := ../lightning-rfc/
|
2016-11-10 23:42:39 +01:00
|
|
|
BOLTVERSION := master
|
2016-05-02 08:28:56 +02:00
|
|
|
|
2016-05-17 06:19:54 +02:00
|
|
|
# If you don't have (working) valgrind.
|
|
|
|
#NO_VALGRIND := 1
|
|
|
|
|
2016-11-10 14:00:35 +01:00
|
|
|
# This is where we add new features as bitcoin adds them.
|
2016-11-11 00:02:04 +01:00
|
|
|
FEATURES :=
|
2015-06-25 06:20:16 +02:00
|
|
|
|
2015-09-25 04:21:18 +02:00
|
|
|
TEST_PROGRAMS := \
|
2016-05-17 06:17:44 +02:00
|
|
|
test/test_protocol \
|
2016-06-23 02:45:43 +02:00
|
|
|
test/test_sphinx
|
2015-09-25 04:21:18 +02:00
|
|
|
|
2016-01-21 21:08:08 +01:00
|
|
|
BITCOIN_SRC := \
|
|
|
|
bitcoin/base58.c \
|
2016-04-24 12:10:29 +02:00
|
|
|
bitcoin/block.c \
|
2016-01-21 21:08:08 +01:00
|
|
|
bitcoin/locktime.c \
|
|
|
|
bitcoin/pubkey.c \
|
2016-08-18 06:53:45 +02:00
|
|
|
bitcoin/pullpush.c \
|
2016-01-21 21:08:08 +01:00
|
|
|
bitcoin/script.c \
|
|
|
|
bitcoin/shadouble.c \
|
|
|
|
bitcoin/signature.c \
|
2016-04-12 05:37:03 +02:00
|
|
|
bitcoin/tx.c \
|
|
|
|
bitcoin/varint.c
|
2016-06-23 02:45:43 +02:00
|
|
|
|
2016-01-21 21:08:08 +01:00
|
|
|
BITCOIN_OBJS := $(BITCOIN_SRC:.c=.o)
|
|
|
|
|
|
|
|
CORE_SRC := \
|
|
|
|
close_tx.c \
|
|
|
|
find_p2sh_out.c \
|
|
|
|
lightning.pb-c.c \
|
|
|
|
opt_bits.c \
|
|
|
|
permute_tx.c \
|
|
|
|
protobuf_convert.c \
|
2016-05-03 03:29:20 +02:00
|
|
|
utils.c \
|
2016-01-21 21:08:08 +01:00
|
|
|
version.c
|
|
|
|
CORE_OBJS := $(CORE_SRC:.c=.o)
|
|
|
|
|
2015-09-24 07:33:20 +02:00
|
|
|
CCAN_OBJS := \
|
|
|
|
ccan-crypto-ripemd160.o \
|
|
|
|
ccan-crypto-sha256.o \
|
|
|
|
ccan-crypto-shachain.o \
|
2016-06-14 17:25:07 +02:00
|
|
|
ccan-asort.o \
|
2016-06-28 23:19:20 +02:00
|
|
|
ccan-crypto-siphash24.o \
|
2015-09-24 07:33:20 +02:00
|
|
|
ccan-err.o \
|
2016-01-21 21:11:46 +01:00
|
|
|
ccan-htable.o \
|
2016-01-21 21:08:09 +01:00
|
|
|
ccan-ilog.o \
|
2016-01-21 21:11:45 +01:00
|
|
|
ccan-io-io.o \
|
|
|
|
ccan-io-poll.o \
|
2016-01-21 21:08:09 +01:00
|
|
|
ccan-isaac.o \
|
|
|
|
ccan-isaac64.o \
|
2015-09-24 07:33:20 +02:00
|
|
|
ccan-list.o \
|
2016-05-04 08:44:22 +02:00
|
|
|
ccan-mem.o \
|
2015-09-24 07:33:20 +02:00
|
|
|
ccan-noerr.o \
|
|
|
|
ccan-opt-helpers.o \
|
|
|
|
ccan-opt-parse.o \
|
|
|
|
ccan-opt-usage.o \
|
|
|
|
ccan-opt.o \
|
2016-01-21 21:11:45 +01:00
|
|
|
ccan-pipecmd.o \
|
2015-09-24 07:33:20 +02:00
|
|
|
ccan-read_write_all.o \
|
|
|
|
ccan-str-hex.o \
|
|
|
|
ccan-str.o \
|
|
|
|
ccan-take.o \
|
|
|
|
ccan-tal-grab_file.o \
|
2016-01-21 21:11:48 +01:00
|
|
|
ccan-tal-path.o \
|
2015-09-24 07:33:20 +02:00
|
|
|
ccan-tal-str.o \
|
2016-01-21 21:08:09 +01:00
|
|
|
ccan-tal.o \
|
2016-01-21 21:11:45 +01:00
|
|
|
ccan-time.o \
|
|
|
|
ccan-timer.o
|
2015-09-24 07:33:20 +02:00
|
|
|
|
2016-01-21 21:08:08 +01:00
|
|
|
CCAN_HEADERS := \
|
|
|
|
$(CCANDIR)/config.h \
|
|
|
|
$(CCANDIR)/ccan/alignof/alignof.h \
|
|
|
|
$(CCANDIR)/ccan/array_size/array_size.h \
|
|
|
|
$(CCANDIR)/ccan/asort/asort.h \
|
|
|
|
$(CCANDIR)/ccan/build_assert/build_assert.h \
|
|
|
|
$(CCANDIR)/ccan/cast/cast.h \
|
|
|
|
$(CCANDIR)/ccan/cdump/cdump.h \
|
|
|
|
$(CCANDIR)/ccan/check_type/check_type.h \
|
|
|
|
$(CCANDIR)/ccan/compiler/compiler.h \
|
|
|
|
$(CCANDIR)/ccan/container_of/container_of.h \
|
2016-09-06 06:17:07 +02:00
|
|
|
$(CCANDIR)/ccan/cppmagic/cppmagic.h \
|
2016-01-21 21:08:08 +01:00
|
|
|
$(CCANDIR)/ccan/crypto/ripemd160/ripemd160.h \
|
|
|
|
$(CCANDIR)/ccan/crypto/sha256/sha256.h \
|
|
|
|
$(CCANDIR)/ccan/crypto/shachain/shachain.h \
|
2016-06-28 23:19:20 +02:00
|
|
|
$(CCANDIR)/ccan/crypto/siphash24/siphash24.h \
|
2016-01-21 21:08:08 +01:00
|
|
|
$(CCANDIR)/ccan/endian/endian.h \
|
|
|
|
$(CCANDIR)/ccan/err/err.h \
|
|
|
|
$(CCANDIR)/ccan/htable/htable.h \
|
|
|
|
$(CCANDIR)/ccan/htable/htable_type.h \
|
|
|
|
$(CCANDIR)/ccan/ilog/ilog.h \
|
2016-01-21 21:11:45 +01:00
|
|
|
$(CCANDIR)/ccan/io/backend.h \
|
|
|
|
$(CCANDIR)/ccan/io/io.h \
|
|
|
|
$(CCANDIR)/ccan/io/io_plan.h \
|
2016-01-21 21:08:09 +01:00
|
|
|
$(CCANDIR)/ccan/isaac/isaac.h \
|
|
|
|
$(CCANDIR)/ccan/isaac/isaac64.h \
|
2016-01-21 21:08:08 +01:00
|
|
|
$(CCANDIR)/ccan/likely/likely.h \
|
|
|
|
$(CCANDIR)/ccan/list/list.h \
|
|
|
|
$(CCANDIR)/ccan/mem/mem.h \
|
|
|
|
$(CCANDIR)/ccan/noerr/noerr.h \
|
|
|
|
$(CCANDIR)/ccan/opt/opt.h \
|
|
|
|
$(CCANDIR)/ccan/opt/private.h \
|
|
|
|
$(CCANDIR)/ccan/order/order.h \
|
2016-01-21 21:11:45 +01:00
|
|
|
$(CCANDIR)/ccan/pipecmd/pipecmd.h \
|
2016-01-21 21:08:08 +01:00
|
|
|
$(CCANDIR)/ccan/ptrint/ptrint.h \
|
|
|
|
$(CCANDIR)/ccan/read_write_all/read_write_all.h \
|
|
|
|
$(CCANDIR)/ccan/short_types/short_types.h \
|
|
|
|
$(CCANDIR)/ccan/str/hex/hex.h \
|
|
|
|
$(CCANDIR)/ccan/str/str.h \
|
|
|
|
$(CCANDIR)/ccan/str/str_debug.h \
|
|
|
|
$(CCANDIR)/ccan/strmap/strmap.h \
|
|
|
|
$(CCANDIR)/ccan/structeq/structeq.h \
|
|
|
|
$(CCANDIR)/ccan/take/take.h \
|
|
|
|
$(CCANDIR)/ccan/tal/grab_file/grab_file.h \
|
|
|
|
$(CCANDIR)/ccan/tal/path/path.h \
|
|
|
|
$(CCANDIR)/ccan/tal/str/str.h \
|
|
|
|
$(CCANDIR)/ccan/tal/tal.h \
|
|
|
|
$(CCANDIR)/ccan/tcon/tcon.h \
|
2016-01-21 21:08:09 +01:00
|
|
|
$(CCANDIR)/ccan/time/time.h \
|
2016-01-21 21:11:45 +01:00
|
|
|
$(CCANDIR)/ccan/timer/timer.h \
|
2016-01-21 21:08:08 +01:00
|
|
|
$(CCANDIR)/ccan/typesafe_cb/typesafe_cb.h
|
|
|
|
|
|
|
|
BITCOIN_HEADERS := bitcoin/address.h \
|
|
|
|
bitcoin/base58.h \
|
2016-04-24 12:10:29 +02:00
|
|
|
bitcoin/block.h \
|
2016-01-21 21:08:08 +01:00
|
|
|
bitcoin/locktime.h \
|
|
|
|
bitcoin/privkey.h \
|
|
|
|
bitcoin/pubkey.h \
|
2016-08-18 06:53:45 +02:00
|
|
|
bitcoin/pullpush.h \
|
2016-01-21 21:08:08 +01:00
|
|
|
bitcoin/script.h \
|
|
|
|
bitcoin/shadouble.h \
|
|
|
|
bitcoin/signature.h \
|
2016-04-12 05:37:03 +02:00
|
|
|
bitcoin/tx.h \
|
|
|
|
bitcoin/varint.h
|
2016-01-21 21:08:08 +01:00
|
|
|
|
|
|
|
CORE_HEADERS := close_tx.h \
|
|
|
|
find_p2sh_out.h \
|
2016-10-07 05:26:57 +02:00
|
|
|
irc.h \
|
2016-01-21 21:08:08 +01:00
|
|
|
opt_bits.h \
|
|
|
|
overflows.h \
|
|
|
|
permute_tx.h \
|
|
|
|
protobuf_convert.h \
|
2016-05-02 08:36:56 +02:00
|
|
|
remove_dust.h \
|
2016-05-03 03:29:20 +02:00
|
|
|
utils.h \
|
2016-01-21 21:08:08 +01:00
|
|
|
version.h
|
|
|
|
|
2016-11-08 22:34:27 +01:00
|
|
|
GEN_HEADERS := gen_version.h \
|
2016-01-21 21:08:08 +01:00
|
|
|
lightning.pb-c.h
|
|
|
|
|
2015-09-25 04:21:18 +02:00
|
|
|
CDUMP_OBJS := ccan-cdump.o ccan-strmap.o
|
|
|
|
|
2016-09-06 09:17:41 +02:00
|
|
|
MANPAGES := doc/lightning-cli.1 \
|
|
|
|
doc/lightning-delinvoice.7 \
|
|
|
|
doc/lightning-getroute.7 \
|
|
|
|
doc/lightning-invoice.7 \
|
|
|
|
doc/lightning-listinvoice.7 \
|
|
|
|
doc/lightning-sendpay.7 \
|
|
|
|
doc/lightning-waitinvoice.7
|
|
|
|
|
2016-03-08 01:07:15 +01:00
|
|
|
PROGRAMS := $(TEST_PROGRAMS)
|
2015-05-26 06:38:12 +02:00
|
|
|
|
2016-01-21 21:11:37 +01:00
|
|
|
CWARNFLAGS := -Werror -Wall -Wundef -Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes -Wold-style-definition
|
|
|
|
CDEBUGFLAGS := -g -fstack-protector
|
2016-01-21 21:11:47 +01:00
|
|
|
CFLAGS := $(CWARNFLAGS) $(CDEBUGFLAGS) -I $(CCANDIR) -I secp256k1/include/ -I . $(FEATURES)
|
2016-01-21 21:11:37 +01:00
|
|
|
|
2016-08-18 06:55:13 +02:00
|
|
|
LDLIBS := -lprotobuf-c -lgmp -lsodium -lbase58 -lsqlite3
|
2015-06-12 04:49:59 +02:00
|
|
|
$(PROGRAMS): CFLAGS+=-I.
|
2015-05-26 06:38:12 +02:00
|
|
|
|
2016-09-06 09:17:41 +02:00
|
|
|
default: $(PROGRAMS) $(MANPAGES) daemon-all
|
|
|
|
|
2016-10-07 05:27:57 +02:00
|
|
|
# Git doesn't maintain timestamps, so we only regen if git says we should.
|
2016-11-08 12:30:55 +01:00
|
|
|
CHANGED_FROM_GIT = [ x"`git log $@ | head -n1`" != x"`git log $< | head -n1`" -o x"`git diff $<`" != x"" ]
|
|
|
|
|
2016-09-06 09:17:41 +02:00
|
|
|
$(MANPAGES): doc/%: doc/%.txt
|
2016-11-08 12:30:55 +01:00
|
|
|
@if $(CHANGED_FROM_GIT); then echo a2x --format=manpage $<; a2x --format=manpage $<; else touch $@; fi
|
2015-05-26 06:38:12 +02:00
|
|
|
|
2016-01-21 21:08:08 +01:00
|
|
|
# Everything depends on the CCAN headers.
|
2016-09-08 08:27:33 +02:00
|
|
|
$(CCAN_OBJS) $(CDUMP_OBJS) $(HELPER_OBJS) $(BITCOIN_OBJS) $(TEST_PROGRAMS:=.o) ccan/ccan/cdump/tools/cdump-enumstr.o: $(CCAN_HEADERS)
|
2016-01-21 21:08:08 +01:00
|
|
|
|
|
|
|
# Except for CCAN, everything depends on bitcoin/ and core headers.
|
2016-08-09 05:41:13 +02:00
|
|
|
$(HELPER_OBJS) $(CORE_OBJS) $(BITCOIN_OBJS) $(TEST_PROGRAMS:=.o): $(BITCOIN_HEADERS) $(CORE_HEADERS) $(CCAN_HEADERS) $(GEN_HEADERS)
|
2016-01-21 21:08:08 +01:00
|
|
|
|
2016-05-17 06:17:44 +02:00
|
|
|
test-protocol: test/test_protocol
|
2016-05-17 06:19:54 +02:00
|
|
|
set -e; TMP=`mktemp`; [ -n "$(NO_VALGRIND)" ] || PREFIX="valgrind -q --error-exitcode=7"; for f in test/commits/*.script; do if ! $$PREFIX test/test_protocol < $$f > $$TMP; then echo "test/test_protocol < $$f FAILED" >&2; exit 1; fi; diff -u $$TMP $$f.expected; done; rm $$TMP
|
2016-05-17 06:17:44 +02:00
|
|
|
|
2016-05-17 07:32:08 +02:00
|
|
|
doc/protocol-%.svg: test/test_protocol
|
|
|
|
test/test_protocol --svg < test/commits/$*.script > $@
|
|
|
|
|
|
|
|
protocol-diagrams: $(patsubst %.script, doc/protocol-%.svg, $(notdir $(wildcard test/commits/*.script)))
|
|
|
|
|
2016-10-16 16:24:28 +02:00
|
|
|
check: test-protocol bitcoin-tests
|
2016-04-11 09:12:53 +02:00
|
|
|
|
|
|
|
include bitcoin/Makefile
|
2015-09-29 09:32:02 +02:00
|
|
|
|
2016-01-21 21:08:09 +01:00
|
|
|
# Keep includes in alpha order.
|
|
|
|
check-src-include-order/%: %
|
|
|
|
@if [ "$$(grep '^#include' < $<)" != "$$(grep '^#include' < $< | LC_ALL=C sort)" ]; then echo "$<:1: includes out of order"; grep '^#include' < $<; echo VERSUS; grep '^#include' < $< | LC_ALL=C sort; exit 1; fi
|
|
|
|
|
|
|
|
# Keep includes in alpha order, after including "config.h"
|
|
|
|
check-hdr-include-order/%: %
|
|
|
|
@if [ "$$(grep '^#include' < $< | head -n1)" != '#include "config.h"' ]; then echo "$<:1: doesn't include config.h first"; exit 1; fi
|
|
|
|
@if [ "$$(grep '^#include' < $< | tail -n +2)" != "$$(grep '^#include' < $< | tail -n +2 | LC_ALL=C sort)" ]; then echo "$<:1: includes out of order"; exit 1; fi
|
|
|
|
|
|
|
|
# Make sure Makefile includes all headers.
|
2016-01-21 21:11:47 +01:00
|
|
|
check-makefile: check-daemon-makefile
|
2016-01-21 21:08:09 +01:00
|
|
|
@if [ "`echo bitcoin/*.h`" != "$(BITCOIN_HEADERS)" ]; then echo BITCOIN_HEADERS incorrect; exit 1; fi
|
|
|
|
@if [ x"`ls *.h | grep -v ^gen_ | fgrep -v lightning.pb-c.h | tr '\n' ' '`" != x"$(CORE_HEADERS) " ]; then echo CORE_HEADERS incorrect; exit 1; fi
|
|
|
|
@if [ x"$(CCANDIR)/config.h `find $(CCANDIR)/ccan -name '*.h' | grep -v /test/ | LC_ALL=C sort | tr '\n' ' '`" != x"$(CCAN_HEADERS) " ]; then echo CCAN_HEADERS incorrect; exit 1; fi
|
|
|
|
|
2016-05-02 08:28:56 +02:00
|
|
|
# Any mention of BOLT# must be followed by an exact quote, modulo whitepace.
|
|
|
|
check-source-bolt: check-bolt
|
2016-11-10 23:42:39 +01:00
|
|
|
@if [ ! -d $(BOLTDIR) ]; then echo Not checking BOLT references: BOLTDIR $(BOLTDIR) does not exist >&2; else rm -rf .tmp.lightningrfc; git clone -q -b $(BOLTVERSION) $(BOLTDIR) .tmp.lightningrfc && ./check-bolt .tmp.lightningrfc $(CORE_SRC) $(BITCOIN_SRC) $(DAEMON_SRC) $(CORE_HEADERS) $(BITCOIN_HEADERS) $(DAEMON_HEADERS) $(TEST_PROGRAMS:=.c); fi
|
2016-05-02 08:28:56 +02:00
|
|
|
|
|
|
|
check-bolt: check-bolt.o $(CCAN_OBJS)
|
|
|
|
|
|
|
|
check-bolt.o: $(CCAN_HEADERS)
|
|
|
|
|
2016-11-11 00:06:10 +01:00
|
|
|
check-whitespace:
|
|
|
|
if grep -n '[ ]$$' Makefile daemon/test/Makefile daemon/Makefile bitcoin/Makefile check-bolt.c $(CORE_SRC) $(BITCOIN_SRC) $(DAEMON_SRC); then echo Extraneous whitespace found >&2; exit 1; fi
|
|
|
|
|
|
|
|
check-source: check-makefile check-source-bolt check-whitespace \
|
2016-01-21 21:08:09 +01:00
|
|
|
$(CORE_SRC:%=check-src-include-order/%) \
|
|
|
|
$(BITCOIN_SRC:%=check-src-include-order/%) \
|
|
|
|
$(CORE_HEADERS:%=check-hdr-include-order/%) \
|
|
|
|
$(BITCOIN_HEADERS:%=check-hdr-include-order/%)
|
|
|
|
|
|
|
|
full-check: check $(TEST_PROGRAMS) check-source
|
2015-09-29 09:32:02 +02:00
|
|
|
|
2015-06-04 08:16:39 +02:00
|
|
|
TAGS: FORCE
|
2016-06-28 23:19:20 +02:00
|
|
|
$(RM) TAGS; find * -name '*.[ch]' | xargs etags --append
|
2015-06-04 08:16:39 +02:00
|
|
|
FORCE::
|
|
|
|
|
2015-09-25 04:21:18 +02:00
|
|
|
ccan/ccan/cdump/tools/cdump-enumstr: ccan/ccan/cdump/tools/cdump-enumstr.o $(CDUMP_OBJS) $(CCAN_OBJS)
|
|
|
|
|
2016-04-11 09:02:43 +02:00
|
|
|
# We build a static libsecpk1, since we need ecdh
|
2015-06-25 07:32:50 +02:00
|
|
|
# (and it's not API stable yet!).
|
2015-09-30 03:24:54 +02:00
|
|
|
libsecp256k1.a: secp256k1/libsecp256k1.la
|
|
|
|
|
|
|
|
secp256k1/libsecp256k1.la:
|
2016-11-16 04:29:20 +01:00
|
|
|
cd secp256k1 && ./autogen.sh && ./configure CC="$(CC)" --enable-static=yes --enable-shared=no --enable-tests=no --enable-experimental=yes --enable-module-ecdh=yes --libdir=`pwd`/..
|
2015-06-25 07:32:50 +02:00
|
|
|
$(MAKE) -C secp256k1 install-exec
|
|
|
|
|
2015-05-26 06:38:12 +02:00
|
|
|
lightning.pb-c.c lightning.pb-c.h: lightning.proto
|
2016-11-08 12:30:55 +01:00
|
|
|
@if $(CHANGED_FROM_GIT); then echo $(PROTOCC) lightning.proto --c_out=.; $(PROTOCC) lightning.proto --c_out=.; else touch $@; fi
|
2015-05-26 06:38:12 +02:00
|
|
|
|
2016-07-01 03:49:28 +02:00
|
|
|
$(TEST_PROGRAMS): % : %.o $(BITCOIN_OBJS) $(CCAN_OBJS) utils.o version.o libsecp256k1.a
|
2015-06-12 05:59:06 +02:00
|
|
|
|
|
|
|
ccan/config.h: ccan/tools/configurator/configurator
|
2016-05-02 08:24:56 +02:00
|
|
|
if $< > $@.new; then mv $@.new $@; else rm $@.new; exit 1; fi
|
2015-06-12 05:59:06 +02:00
|
|
|
|
2015-07-18 03:16:01 +02:00
|
|
|
doc/deployable-lightning.pdf: doc/deployable-lightning.lyx doc/bitcoin.bib
|
|
|
|
lyx -E pdf $@ $<
|
|
|
|
|
|
|
|
doc/deployable-lightning.tex: doc/deployable-lightning.lyx
|
|
|
|
lyx -E latex $@ $<
|
|
|
|
|
2015-09-25 04:21:18 +02:00
|
|
|
state-diagrams: doc/normal-states.svg doc/simplified-states.svg doc/error-states.svg doc/full-states.svg
|
|
|
|
|
|
|
|
%.svg: %.dot
|
|
|
|
dot -Tsvg $< > $@ || (rm -f $@; false)
|
|
|
|
|
|
|
|
doc/simplified-states.dot: test/test_state_coverage
|
|
|
|
test/test_state_coverage --dot --dot-simplify > $@
|
|
|
|
|
|
|
|
doc/normal-states.dot: test/test_state_coverage
|
|
|
|
test/test_state_coverage --dot > $@
|
|
|
|
|
|
|
|
doc/error-states.dot: test/test_state_coverage
|
|
|
|
test/test_state_coverage --dot-all --dot-include-errors > $@
|
|
|
|
|
|
|
|
doc/full-states.dot: test/test_state_coverage
|
|
|
|
test/test_state_coverage --dot-all --dot-include-errors --dot-include-nops > $@
|
|
|
|
|
2015-08-08 13:15:49 +02:00
|
|
|
gen_version.h: FORCE
|
|
|
|
@(echo "#define VERSION \"`git describe --always --dirty`\"" && echo "#define VERSION_NAME \"$(NAME)\"" && echo "#define BUILD_FEATURES \"$(FEATURES)\"") > $@.new
|
2016-09-13 21:52:41 +02:00
|
|
|
@if cmp $@.new $@ >/dev/null 2>&2; then rm -f $@.new; else mv $@.new $@; echo Version updated; fi
|
2015-08-08 13:15:49 +02:00
|
|
|
|
|
|
|
version.o: gen_version.h
|
|
|
|
|
2015-07-09 07:38:17 +02:00
|
|
|
update-ccan:
|
|
|
|
mv ccan ccan.old
|
|
|
|
DIR=$$(pwd)/ccan; cd ../ccan && ./tools/create-ccan-tree -a $$DIR `cd $$DIR.old/ccan && find * -name _info | sed s,/_info,, | sort` $(CCAN_NEW)
|
|
|
|
mkdir -p ccan/tools/configurator
|
|
|
|
cp ../ccan/tools/configurator/configurator.c ccan/tools/configurator/
|
|
|
|
$(MAKE) ccan/config.h
|
|
|
|
grep -v '^CCAN version:' ccan.old/README > ccan/README
|
|
|
|
echo CCAN version: `git -C ../ccan describe` >> ccan/README
|
|
|
|
$(RM) -r ccan.old
|
2016-07-01 03:57:57 +02:00
|
|
|
|
|
|
|
update-secp256k1:
|
|
|
|
mv secp256k1 secp256k1.old
|
|
|
|
cp -a ../secp256k1 secp256k1
|
|
|
|
rm -rf secp256k1/.git
|
|
|
|
grep -v '^secp256k1 version:' secp256k1.old/README > secp256k1/README
|
|
|
|
echo secp256k1 version: `git -C ../secp256k1 describe 2>/dev/null || git -C ../secp256k1 show HEAD --format=%H` >> secp256k1/README
|
|
|
|
$(RM) -r secp256k1.old
|
2015-07-09 07:38:17 +02:00
|
|
|
|
2015-05-26 06:38:12 +02:00
|
|
|
distclean: clean
|
2015-09-30 03:24:54 +02:00
|
|
|
$(MAKE) -C secp256k1/ distclean || true
|
2016-07-01 03:57:34 +02:00
|
|
|
$(RM) libsecp256k1.a secp256k1/libsecp256k1.la
|
2015-09-30 07:19:42 +02:00
|
|
|
|
2016-08-09 05:41:13 +02:00
|
|
|
maintainer-clean: distclean
|
2015-09-30 07:19:42 +02:00
|
|
|
@echo 'This command is intended for maintainers to use; it'
|
|
|
|
@echo 'deletes files that may need special tools to rebuild.'
|
2016-11-08 22:34:27 +01:00
|
|
|
$(RM) lightning.pb-c.c lightning.pb-c.h
|
2015-07-18 03:16:01 +02:00
|
|
|
$(RM) doc/deployable-lightning.pdf
|
2016-09-06 09:17:41 +02:00
|
|
|
$(RM) $(MANPAGES)
|
2015-05-26 06:38:12 +02:00
|
|
|
|
2016-03-08 01:02:15 +01:00
|
|
|
clean: daemon-clean
|
2015-09-30 03:24:54 +02:00
|
|
|
$(MAKE) -C secp256k1/ clean || true
|
|
|
|
$(RM) libsecp256k1.{a,la}
|
2016-03-08 01:07:15 +01:00
|
|
|
$(RM) $(PROGRAMS)
|
2016-01-21 21:11:46 +01:00
|
|
|
$(RM) bitcoin/*.o *.o $(PROGRAMS:=.o) $(CCAN_OBJS)
|
2016-11-08 22:34:27 +01:00
|
|
|
$(RM) ccan/config.h gen_*.h
|
2016-09-08 08:27:33 +02:00
|
|
|
$(RM) ccan/ccan/cdump/tools/cdump-enumstr.o
|
2015-07-18 03:16:01 +02:00
|
|
|
$(RM) doc/deployable-lightning.{aux,bbl,blg,dvi,log,out,tex}
|
2015-05-26 06:38:12 +02:00
|
|
|
|
2016-01-21 21:11:47 +01:00
|
|
|
include daemon/Makefile
|
|
|
|
|
2015-05-26 06:38:12 +02:00
|
|
|
ccan-tal.o: $(CCANDIR)/ccan/tal/tal.c
|
|
|
|
$(CC) $(CFLAGS) -c -o $@ $<
|
|
|
|
ccan-tal-str.o: $(CCANDIR)/ccan/tal/str/str.c
|
|
|
|
$(CC) $(CFLAGS) -c -o $@ $<
|
2016-01-21 21:11:48 +01:00
|
|
|
ccan-tal-path.o: $(CCANDIR)/ccan/tal/path/path.c
|
|
|
|
$(CC) $(CFLAGS) -c -o $@ $<
|
2015-05-28 23:38:27 +02:00
|
|
|
ccan-tal-grab_file.o: $(CCANDIR)/ccan/tal/grab_file/grab_file.c
|
|
|
|
$(CC) $(CFLAGS) -c -o $@ $<
|
2015-05-26 06:38:12 +02:00
|
|
|
ccan-take.o: $(CCANDIR)/ccan/take/take.c
|
|
|
|
$(CC) $(CFLAGS) -c -o $@ $<
|
|
|
|
ccan-list.o: $(CCANDIR)/ccan/list/list.c
|
|
|
|
$(CC) $(CFLAGS) -c -o $@ $<
|
2016-06-14 17:25:07 +02:00
|
|
|
ccan-asort.o: $(CCANDIR)/ccan/asort/asort.c
|
|
|
|
$(CC) $(CFLAGS) -c -o $@ $<
|
2015-05-26 06:38:12 +02:00
|
|
|
ccan-read_write_all.o: $(CCANDIR)/ccan/read_write_all/read_write_all.c
|
|
|
|
$(CC) $(CFLAGS) -c -o $@ $<
|
|
|
|
ccan-str.o: $(CCANDIR)/ccan/str/str.c
|
|
|
|
$(CC) $(CFLAGS) -c -o $@ $<
|
|
|
|
ccan-opt.o: $(CCANDIR)/ccan/opt/opt.c
|
|
|
|
$(CC) $(CFLAGS) -c -o $@ $<
|
|
|
|
ccan-opt-helpers.o: $(CCANDIR)/ccan/opt/helpers.c
|
|
|
|
$(CC) $(CFLAGS) -c -o $@ $<
|
|
|
|
ccan-opt-parse.o: $(CCANDIR)/ccan/opt/parse.c
|
|
|
|
$(CC) $(CFLAGS) -c -o $@ $<
|
|
|
|
ccan-opt-usage.o: $(CCANDIR)/ccan/opt/usage.c
|
|
|
|
$(CC) $(CFLAGS) -c -o $@ $<
|
|
|
|
ccan-err.o: $(CCANDIR)/ccan/err/err.c
|
|
|
|
$(CC) $(CFLAGS) -c -o $@ $<
|
2015-05-28 23:38:27 +02:00
|
|
|
ccan-noerr.o: $(CCANDIR)/ccan/noerr/noerr.c
|
|
|
|
$(CC) $(CFLAGS) -c -o $@ $<
|
2015-05-26 06:38:12 +02:00
|
|
|
ccan-str-hex.o: $(CCANDIR)/ccan/str/hex/hex.c
|
|
|
|
$(CC) $(CFLAGS) -c -o $@ $<
|
|
|
|
ccan-crypto-shachain.o: $(CCANDIR)/ccan/crypto/shachain/shachain.c
|
|
|
|
$(CC) $(CFLAGS) -c -o $@ $<
|
|
|
|
ccan-crypto-sha256.o: $(CCANDIR)/ccan/crypto/sha256/sha256.c
|
|
|
|
$(CC) $(CFLAGS) -c -o $@ $<
|
2015-07-09 08:13:36 +02:00
|
|
|
ccan-crypto-ripemd160.o: $(CCANDIR)/ccan/crypto/ripemd160/ripemd160.c
|
|
|
|
$(CC) $(CFLAGS) -c -o $@ $<
|
2015-09-25 04:21:18 +02:00
|
|
|
ccan-cdump.o: $(CCANDIR)/ccan/cdump/cdump.c
|
|
|
|
$(CC) $(CFLAGS) -c -o $@ $<
|
|
|
|
ccan-strmap.o: $(CCANDIR)/ccan/strmap/strmap.c
|
|
|
|
$(CC) $(CFLAGS) -c -o $@ $<
|
2016-06-28 23:19:20 +02:00
|
|
|
ccan-crypto-siphash24.o: $(CCANDIR)/ccan/crypto/siphash24/siphash24.c
|
2015-09-25 04:21:18 +02:00
|
|
|
$(CC) $(CFLAGS) -c -o $@ $<
|
|
|
|
ccan-htable.o: $(CCANDIR)/ccan/htable/htable.c
|
|
|
|
$(CC) $(CFLAGS) -c -o $@ $<
|
2016-01-21 21:08:09 +01:00
|
|
|
ccan-ilog.o: $(CCANDIR)/ccan/ilog/ilog.c
|
|
|
|
$(CC) $(CFLAGS) -c -o $@ $<
|
|
|
|
ccan-isaac.o: $(CCANDIR)/ccan/isaac/isaac.c
|
|
|
|
$(CC) $(CFLAGS) -c -o $@ $<
|
|
|
|
ccan-isaac64.o: $(CCANDIR)/ccan/isaac/isaac64.c
|
|
|
|
$(CC) $(CFLAGS) -c -o $@ $<
|
2016-01-21 21:08:09 +01:00
|
|
|
ccan-time.o: $(CCANDIR)/ccan/time/time.c
|
|
|
|
$(CC) $(CFLAGS) -c -o $@ $<
|
2016-01-21 21:11:45 +01:00
|
|
|
ccan-timer.o: $(CCANDIR)/ccan/timer/timer.c
|
|
|
|
$(CC) $(CFLAGS) -c -o $@ $<
|
|
|
|
ccan-io-io.o: $(CCANDIR)/ccan/io/io.c
|
|
|
|
$(CC) $(CFLAGS) -c -o $@ $<
|
|
|
|
ccan-io-poll.o: $(CCANDIR)/ccan/io/poll.c
|
|
|
|
$(CC) $(CFLAGS) -c -o $@ $<
|
|
|
|
ccan-pipecmd.o: $(CCANDIR)/ccan/pipecmd/pipecmd.c
|
|
|
|
$(CC) $(CFLAGS) -c -o $@ $<
|
2016-05-04 08:44:22 +02:00
|
|
|
ccan-mem.o: $(CCANDIR)/ccan/mem/mem.c
|
|
|
|
$(CC) $(CFLAGS) -c -o $@ $<
|