|
@ -45,12 +45,7 @@ BITCOIN_SRC := \ |
|
|
BITCOIN_OBJS := $(BITCOIN_SRC:.c=.o) |
|
|
BITCOIN_OBJS := $(BITCOIN_SRC:.c=.o) |
|
|
|
|
|
|
|
|
CORE_SRC := \
|
|
|
CORE_SRC := \
|
|
|
close_tx.c \
|
|
|
|
|
|
find_p2sh_out.c \
|
|
|
|
|
|
lightning.pb-c.c \
|
|
|
|
|
|
opt_bits.c \
|
|
|
opt_bits.c \
|
|
|
permute_tx.c \
|
|
|
|
|
|
protobuf_convert.c \
|
|
|
|
|
|
status.c \
|
|
|
status.c \
|
|
|
type_to_string.c \
|
|
|
type_to_string.c \
|
|
|
utils.c \
|
|
|
utils.c \
|
|
@ -58,6 +53,19 @@ CORE_SRC := \ |
|
|
|
|
|
|
|
|
CORE_OBJS := $(CORE_SRC:.c=.o) |
|
|
CORE_OBJS := $(CORE_SRC:.c=.o) |
|
|
|
|
|
|
|
|
|
|
|
CORE_TX_SRC := \
|
|
|
|
|
|
close_tx.c \
|
|
|
|
|
|
find_p2sh_out.c \
|
|
|
|
|
|
permute_tx.c |
|
|
|
|
|
|
|
|
|
|
|
CORE_TX_OBJS := $(CORE_TX_SRC:.c=.o) |
|
|
|
|
|
|
|
|
|
|
|
CORE_PROTOBUF_SRC := \
|
|
|
|
|
|
lightning.pb-c.c \
|
|
|
|
|
|
protobuf_convert.c |
|
|
|
|
|
|
|
|
|
|
|
CORE_PROTOBUF_OBJS := $(CORE_PROTOBUF_SRC:.c=.o) |
|
|
|
|
|
|
|
|
CCAN_OBJS := \
|
|
|
CCAN_OBJS := \
|
|
|
ccan-asort.o \
|
|
|
ccan-asort.o \
|
|
|
ccan-autodata.o \
|
|
|
ccan-autodata.o \
|
|
@ -168,14 +176,15 @@ BITCOIN_HEADERS := bitcoin/address.h \ |
|
|
bitcoin/tx.h \
|
|
|
bitcoin/tx.h \
|
|
|
bitcoin/varint.h |
|
|
bitcoin/varint.h |
|
|
|
|
|
|
|
|
CORE_HEADERS := close_tx.h \
|
|
|
CORE_TX_HEADERS := close_tx.h \
|
|
|
find_p2sh_out.h \
|
|
|
find_p2sh_out.h \
|
|
|
irc.h \
|
|
|
permute_tx.h \
|
|
|
|
|
|
remove_dust.h |
|
|
|
|
|
|
|
|
|
|
|
CORE_HEADERS := irc.h \
|
|
|
opt_bits.h \
|
|
|
opt_bits.h \
|
|
|
overflows.h \
|
|
|
overflows.h \
|
|
|
permute_tx.h \
|
|
|
|
|
|
protobuf_convert.h \
|
|
|
protobuf_convert.h \
|
|
|
remove_dust.h \
|
|
|
|
|
|
status.h \
|
|
|
status.h \
|
|
|
type_to_string.h \
|
|
|
type_to_string.h \
|
|
|
utils.h \
|
|
|
utils.h \
|
|
@ -221,7 +230,7 @@ $(MANPAGES): doc/%: doc/%.txt |
|
|
$(CCAN_OBJS) $(CDUMP_OBJS) $(HELPER_OBJS) $(BITCOIN_OBJS) $(TEST_PROGRAMS:=.o) ccan/ccan/cdump/tools/cdump-enumstr.o: $(CCAN_HEADERS) |
|
|
$(CCAN_OBJS) $(CDUMP_OBJS) $(HELPER_OBJS) $(BITCOIN_OBJS) $(TEST_PROGRAMS:=.o) ccan/ccan/cdump/tools/cdump-enumstr.o: $(CCAN_HEADERS) |
|
|
|
|
|
|
|
|
# Except for CCAN, everything depends on bitcoin/ and core headers.
|
|
|
# Except for CCAN, everything depends on bitcoin/ and core headers.
|
|
|
$(HELPER_OBJS) $(CORE_OBJS) $(BITCOIN_OBJS) $(LIBBASE58_OBJS) $(WIRE_OBJS) $(TEST_PROGRAMS:=.o): $(BITCOIN_HEADERS) $(CORE_HEADERS) $(CCAN_HEADERS) $(GEN_HEADERS) $(LIBBASE58_HEADERS) |
|
|
$(HELPER_OBJS) $(CORE_OBJS) $(CORE_TX_OBJS) $(CORE_PROTOBUF_OBJS) $(BITCOIN_OBJS) $(LIBBASE58_OBJS) $(WIRE_OBJS) $(TEST_PROGRAMS:=.o): $(BITCOIN_HEADERS) $(CORE_HEADERS) $(CCAN_HEADERS) $(GEN_HEADERS) $(LIBBASE58_HEADERS) |
|
|
|
|
|
|
|
|
test-protocol: test/test_protocol |
|
|
test-protocol: test/test_protocol |
|
|
set -e; TMP=`mktemp`; for f in test/commits/*.script; do if ! $(VALGRIND) test/test_protocol < $$f > $$TMP; then echo "test/test_protocol < $$f FAILED" >&2; exit 1; fi; diff -u $$TMP $$f.expected; done; rm $$TMP |
|
|
set -e; TMP=`mktemp`; for f in test/commits/*.script; do if ! $(VALGRIND) test/test_protocol < $$f > $$TMP; then echo "test/test_protocol < $$f FAILED" >&2; exit 1; fi; diff -u $$TMP $$f.expected; done; rm $$TMP |
|
@ -245,7 +254,7 @@ check-hdr-include-order/%: % |
|
|
# Make sure Makefile includes all headers.
|
|
|
# Make sure Makefile includes all headers.
|
|
|
check-makefile: check-daemon-makefile |
|
|
check-makefile: check-daemon-makefile |
|
|
@if [ "`echo bitcoin/*.h`" != "$(BITCOIN_HEADERS)" ]; then echo BITCOIN_HEADERS incorrect; exit 1; fi |
|
|
@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"`ls *.h | grep -v ^gen_ | fgrep -v lightning.pb-c.h`" != x"`echo $(CORE_HEADERS) $(CORE_TX_HEADERS) | tr ' ' '\n' | LC_ALL=C sort`" ]; 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 |
|
|
@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 |
|
|
|
|
|
|
|
|
# Any mention of BOLT# must be followed by an exact quote, modulo whitepace.
|
|
|
# Any mention of BOLT# must be followed by an exact quote, modulo whitepace.
|
|
@ -255,7 +264,7 @@ bolt-check/%: % bolt-precheck check-bolt |
|
|
bolt-precheck: |
|
|
bolt-precheck: |
|
|
@rm -rf .tmp.lightningrfc; if [ ! -d $(BOLTDIR) ]; then echo Not checking BOLT references: BOLTDIR $(BOLTDIR) does not exist >&2; exit 0; fi; set -e; if [ -n "$(BOLTVERSION)" ]; then git clone -q -b $(BOLTVERSION) $(BOLTDIR) .tmp.lightningrfc; else cp -a $(BOLTDIR) .tmp.lightningrfc; fi |
|
|
@rm -rf .tmp.lightningrfc; if [ ! -d $(BOLTDIR) ]; then echo Not checking BOLT references: BOLTDIR $(BOLTDIR) does not exist >&2; exit 0; fi; set -e; if [ -n "$(BOLTVERSION)" ]; then git clone -q -b $(BOLTVERSION) $(BOLTDIR) .tmp.lightningrfc; else cp -a $(BOLTDIR) .tmp.lightningrfc; fi |
|
|
|
|
|
|
|
|
check-source-bolt: $(CORE_SRC:%=bolt-check/%) $(CORE_HEADERS:%=bolt-check/%) $(TEST_PROGRAMS:%=bolt-check/%.c) |
|
|
check-source-bolt: $(CORE_SRC:%=bolt-check/%) $(CORE_TX_SRC:%=bolt-check/%) $(CORE_PROTOBUF_SRC:%=bolt-check/%) $(CORE_HEADERS:%=bolt-check/%) $(TEST_PROGRAMS:%=bolt-check/%.c) |
|
|
|
|
|
|
|
|
check-bolt: check-bolt.o $(CCAN_OBJS) |
|
|
check-bolt: check-bolt.o $(CCAN_OBJS) |
|
|
|
|
|
|
|
@ -264,12 +273,15 @@ check-bolt.o: $(CCAN_HEADERS) |
|
|
check-whitespace/%: % |
|
|
check-whitespace/%: % |
|
|
@if grep -Hn '[ ]$$' $<; then echo Extraneous whitespace found >&2; exit 1; fi |
|
|
@if grep -Hn '[ ]$$' $<; then echo Extraneous whitespace found >&2; exit 1; fi |
|
|
|
|
|
|
|
|
check-whitespace: check-whitespace/Makefile check-whitespace/check-bolt.c $(CORE_SRC:%=check-whitespace/%) $(CORE_HEADERS:%=check-whitespace/%) |
|
|
check-whitespace: check-whitespace/Makefile check-whitespace/check-bolt.c $(CORE_SRC:%=check-whitespace/%) $(CORE_TX_SRC:%=check-whitespace/%) $(CORE_PROTOBUF_SRC:%=check-whitespace/%) $(CORE_HEADERS:%=check-whitespace/%) |
|
|
|
|
|
|
|
|
check-source: check-makefile check-source-bolt check-whitespace \ |
|
|
check-source: check-makefile check-source-bolt check-whitespace \ |
|
|
$(CORE_SRC:%=check-src-include-order/%) \
|
|
|
$(CORE_SRC:%=check-src-include-order/%) \
|
|
|
$(BITCOIN_SRC:%=check-src-include-order/%) \
|
|
|
$(CORE_TX_SRC:%=check-src-include-order/%) \
|
|
|
$(CORE_HEADERS:%=check-hdr-include-order/%) \
|
|
|
$(CORE_PROTOBUF_SRC:%=check-src-include-order/%) \
|
|
|
|
|
|
$(BITCOIN_SRC:%=check-src-include-order/%) \
|
|
|
|
|
|
$(CORE_HEADERS:%=check-hdr-include-order/%) \
|
|
|
|
|
|
$(CORE_TX_HEADERS:%=check-hdr-include-order/%) \
|
|
|
$(BITCOIN_HEADERS:%=check-hdr-include-order/%) |
|
|
$(BITCOIN_HEADERS:%=check-hdr-include-order/%) |
|
|
|
|
|
|
|
|
full-check: check $(TEST_PROGRAMS) check-source |
|
|
full-check: check $(TEST_PROGRAMS) check-source |
|
|