@ -43,41 +43,53 @@ LIGHTNINGD_OBJS := $(LIGHTNINGD_SRC:.c=.o)
LIGHTNINGD_JSMN_OBJS := daemon/jsmn.o
LIGHTNINGD_JSMN_OBJS := daemon/jsmn.o
LIGHTNINGD_JSMN_HEADERS := daemon/jsmn/jsmn.h
LIGHTNINGD_JSMN_HEADERS := daemon/jsmn/jsmn.h
# We accumulate all lightningd/ headers in here
# We accumulate all lightningd/ headers in t hese th ree:
LIGHTNINGD_HEADERS = \
LIGHTNINGD_HEADERS_NOGEN = \
lightningd/gossip_control.h \
lightningd/gossip_control.h \
lightningd/hsm_control.h \
lightningd/hsm_control.h \
lightningd/lightningd.h \
lightningd/lightningd.h \
lightningd/peer_control.h \
lightningd/peer_control.h \
lightningd/subdaemon.h \
lightningd/subdaemon.h \
$( WIRE_HEADERS) $( WIRE_GEN_HEADERS) \
$( LIGHTNINGD_LIB_HEADERS) \
$( LIGHTNINGD_JSMN_HEADERS) \
$( WIRE_HEADERS) \
$( BITCOIN_HEADERS) \
$( BITCOIN_HEADERS) \
$( CORE_HEADERS) \
$( CORE_HEADERS) \
$( GEN_HEADERS) \
$( 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) \
$( CCAN_HEADERS) \
$( CCAN_HEADERS) \
$( DAEMON_HEADERS) \
$( LIBBASE58_HEADERS) \
$( LIBBASE58_HEADERS) \
$( LIBSODIUM_HEADERS)
$( LIBSODIUM_HEADERS)
# All together in one convenient var
LIGHTNINGD_HEADERS = $( LIGHTNINGD_HEADERS_NOGEN) $( LIGHTNINGD_HEADERS_GEN) $( LIGHTNINGD_EXTERNAL_HEADERS)
# These included makefiles add their headers to the LIGHTNINGD_HEADERS
# These included makefiles add their headers to the LIGHTNINGD_HEADERS
# variable so the include must preceed any actual use of the variable.
# variable so the include must preceed any actual use of the variable.
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
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
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
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
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
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
$(LIGHTNINGD_OBJS) $(LIGHTNINGD_LIB_OBJS) : $( LIGHTNINGD_HEADERS )
$(LIGHTNINGD_OBJS) $(LIGHTNINGD_LIB_OBJS) : $( LIGHTNINGD_HEADERS )
check-source : $( LIGHTNINGD_SRC :%=check -src -include -order /%)
check-source : $( LIGHTNINGD_SRC :%=check -src -include -order /%)
check-source : $( LIGHTNINGD_LIB_SRC :%=check -src -include -order /%)
check-source : $( LIGHTNINGD_LIB_SRC :%=check -src -include -order /%)
check-source : $( LIGHTNINGD_CLI_SRC :%=check -src -include -order /%)
check-source : $( LIGHTNINGD_CLI_SRC :%=check -src -include -order /%)
check-source : $( LIGHTNINGD_HEADERS :%=check -hdr -include -order /%)
check-source : $( LIGHTNINGD_HEADERS_NOGEN :%=check -hdr -include -order /%)
check-source-bolt : $( LIGHTNINGD_SRC :%=bolt -check /%) $( LIGHTNINGD_HEADERS :%=bolt -check /%)
check-source-bolt : $( LIGHTNINGD_SRC :%=bolt -check /%) $( LIGHTNINGD_HEADERS_NOGEN :%=bolt -check /%)
check-whitespace : $( LIGHTNINGD_SRC :%=check -whitespace /%) $( LIGHTNINGD_HEADERS :%=check -whitespace /%) $( LIGHTNINGD_LIB_SRC :%=check -whitespace /%) $( LIGHTNINGD_LIB_HEADERS :%=check -whitespace /%)
check-whitespace : $( LIGHTNINGD_SRC :%=check -whitespace /%) $( LIGHTNINGD_HEADERS_NOGEN :%=check -whitespace /%) $( LIGHTNINGD_LIB_SRC :%=check -whitespace /%) $( LIGHTNINGD_LIB_HEADERS :%=check -whitespace /%)
check-makefile : check -lightningd -makefile
check-lightningd-makefile :
check-lightningd-makefile :
@if [ "`ls lightningd/*.h | grep -v lightningd/gen | tr '\012' ' '`" != " `echo $( LIGHTNINGD_HEADERS) ''` " ] ; then echo LIGHTNINGD_HEADERS incorrect ; exit 1; fi
@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
lightningd/lightningd : $( LIGHTNINGD_OBJS ) $( LIGHTNINGD_OLD_OBJS ) $( LIGHTNINGD_LIB_OBJS ) $( LIGHTNINGD_JSMN_OBJS ) $( CORE_OBJS ) $( BITCOIN_OBJS ) $( WIRE_OBJS ) $( CCAN_OBJS ) $( LIGHTNINGD_HSM_CONTROL_OBJS ) $( LIGHTNINGD_HANDSHAKE_CONTROL_OBJS ) $( LIGHTNINGD_GOSSIP_CONTROL_OBJS ) $( LIBBASE 58_OBJS ) libsecp 256k 1.a libsodium .a
lightningd/lightningd : $( LIGHTNINGD_OBJS ) $( LIGHTNINGD_OLD_OBJS ) $( LIGHTNINGD_LIB_OBJS ) $( LIGHTNINGD_JSMN_OBJS ) $( CORE_OBJS ) $( BITCOIN_OBJS ) $( WIRE_OBJS ) $( CCAN_OBJS ) $( LIGHTNINGD_HSM_CONTROL_OBJS ) $( LIGHTNINGD_HANDSHAKE_CONTROL_OBJS ) $( LIGHTNINGD_GOSSIP_CONTROL_OBJS ) $( LIBBASE 58_OBJS ) libsecp 256k 1.a libsodium .a