Browse Source

lightningd/Makefile: fix check-source

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
ppa-0.6.1
Rusty Russell 8 years ago
parent
commit
6bf3c30a10
  1. 6
      daemon/Makefile
  2. 32
      lightningd/Makefile
  3. 2
      lightningd/gossip/Makefile
  4. 2
      lightningd/handshake/Makefile
  5. 2
      lightningd/hsm/Makefile
  6. 2
      lightningd/test/Makefile

6
daemon/Makefile

@ -123,10 +123,10 @@ check-source: $(DAEMON_LIB_SRC:%=check-src-include-order/%)
check-source: $(DAEMON_CLI_SRC:%=check-src-include-order/%) check-source: $(DAEMON_CLI_SRC:%=check-src-include-order/%)
check-source: $(DAEMON_HEADERS:%=check-hdr-include-order/%) check-source: $(DAEMON_HEADERS:%=check-hdr-include-order/%)
check-daemon-makefile: check-daemon-makefile:
echo $(DAEMON_HEADERS) | tr ' ' '\012' > /tmp/daemon-headers-makefile @echo $(DAEMON_HEADERS) | tr ' ' '\012' > /tmp/daemon-headers-makefile
ls daemon/*.h | grep -v daemon/gen > /tmp/daemon-headers-file @ls daemon/*.h | grep -v daemon/gen > /tmp/daemon-headers-file
@if [ "`diff -w /tmp/daemon-headers-makefile /tmp/daemon-headers-file`" != "" ]; then echo DAEMON_HEADERS incorrect; diff -w --context=2 /tmp/daemon-headers-makefile /tmp/daemon-headers-file; exit 1; fi @if [ "`diff -w /tmp/daemon-headers-makefile /tmp/daemon-headers-file`" != "" ]; then echo DAEMON_HEADERS incorrect; diff -w --context=2 /tmp/daemon-headers-makefile /tmp/daemon-headers-file; exit 1; fi
rm /tmp/daemon-headers-makefile /tmp/daemon-headers-file @rm /tmp/daemon-headers-makefile /tmp/daemon-headers-file
check-source-bolt: $(DAEMON_SRC:%=bolt-check/%) $(DAEMON_HEADERS:%=bolt-check/%) check-source-bolt: $(DAEMON_SRC:%=bolt-check/%) $(DAEMON_HEADERS:%=bolt-check/%)

32
lightningd/Makefile

@ -43,23 +43,34 @@ 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 these three:
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.
include lightningd/hsm/Makefile include lightningd/hsm/Makefile
@ -71,13 +82,14 @@ $(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) $(LIBBASE58_OBJS) libsecp256k1.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) $(LIBBASE58_OBJS) libsecp256k1.a libsodium.a

2
lightningd/gossip/Makefile

@ -25,7 +25,7 @@ LIGHTNINGD_GOSSIP_ALLSRC_NOGEN := $(filter-out lightningd/gossip/gen_%, $(LIGHTN
LIGHTNINGD_GOSSIP_ALLHEADERS_NOGEN := $(filter-out lightningd/gossip/gen_%, $(LIGHTNINGD_GOSSIP_CLIENT_HEADERS) $(LIGHTNINGD_GOSSIP_HEADERS)) LIGHTNINGD_GOSSIP_ALLHEADERS_NOGEN := $(filter-out lightningd/gossip/gen_%, $(LIGHTNINGD_GOSSIP_CLIENT_HEADERS) $(LIGHTNINGD_GOSSIP_HEADERS))
# Add to headers which any object might need. # Add to headers which any object might need.
LIGHTNINGD_HEADERS += $(LIGHTNINGD_GOSSIP_HEADERS) LIGHTNINGD_HEADERS_GEN += $(LIGHTNINGD_GOSSIP_HEADERS)
$(LIGHTNINGD_GOSSIP_OBJS) $(LIGHTNINGD_GOSSIP_CLIENT_OBJS): $(LIGHTNINGD_HEADERS) $(LIGHTNINGD_GOSSIP_OBJS) $(LIGHTNINGD_GOSSIP_CLIENT_OBJS): $(LIGHTNINGD_HEADERS)

2
lightningd/handshake/Makefile

@ -26,7 +26,7 @@ LIGHTNINGD_HANDSHAKE_GEN_SRC := $(filter lightningd/handshake/gen_%, $(LIGHTNING
LIGHTNINGD_HANDSHAKE_SRC_NOGEN := $(filter-out lightningd/handshake/gen_%, $(LIGHTNINGD_HANDSHAKE_SRC)) LIGHTNINGD_HANDSHAKE_SRC_NOGEN := $(filter-out lightningd/handshake/gen_%, $(LIGHTNINGD_HANDSHAKE_SRC))
# Add to headers which any object might need. # Add to headers which any object might need.
LIGHTNINGD_HEADERS += $(LIGHTNINGD_HANDSHAKE_HEADERS) LIGHTNINGD_HEADERS_GEN += $(LIGHTNINGD_HANDSHAKE_HEADERS)
$(LIGHTNINGD_HANDSHAKE_OBJS): $(LIGHTNINGD_HEADERS) $(LIGHTNINGD_HANDSHAKE_OBJS): $(LIGHTNINGD_HEADERS)

2
lightningd/hsm/Makefile

@ -31,7 +31,7 @@ LIGHTNINGD_HSM_ALLSRC_NOGEN := $(filter-out lightningd/hsm/gen_%, $(LIGHTNINGD_H
LIGHTNINGD_HSM_ALLHEADERS_NOGEN := $(filter-out lightningd/hsm/gen_%, $(LIGHTNINGD_HSM_CLIENT_HEADERS) $(LIGHTNINGD_HSM_HEADERS)) LIGHTNINGD_HSM_ALLHEADERS_NOGEN := $(filter-out lightningd/hsm/gen_%, $(LIGHTNINGD_HSM_CLIENT_HEADERS) $(LIGHTNINGD_HSM_HEADERS))
# Add to headers which any object might need. # Add to headers which any object might need.
LIGHTNINGD_HEADERS += $(LIGHTNINGD_HSM_HEADERS) LIGHTNINGD_HEADERS_GEN += $(LIGHTNINGD_HSM_HEADERS) $(LIGHTNINGD_HSM_CLIENT_HEADERS)
$(LIGHTNINGD_HSM_OBJS) $(LIGHTNINGD_HSM_CLIENT_OBJS): $(LIGHTNINGD_HEADERS) $(LIGHTNINGD_HSM_OBJS) $(LIGHTNINGD_HSM_CLIENT_OBJS): $(LIGHTNINGD_HEADERS)

2
lightningd/test/Makefile

@ -13,7 +13,7 @@ update-mocks: $(LIGHTNINGD_TEST_SRC:%=update-mocks/%)
$(LIGHTNINGD_TEST_PROGRAMS): $(CCAN_OBJS) $(BITCOIN_OBJS) $(WIRE_OBJS) $(LIBBASE58_OBJS) $(LIGHTNINGD_HANDSHAKE_GEN_SRC:.c=.o) utils.o libsecp256k1.a libsodium.a $(LIGHTNINGD_TEST_PROGRAMS): $(CCAN_OBJS) $(BITCOIN_OBJS) $(WIRE_OBJS) $(LIBBASE58_OBJS) $(LIGHTNINGD_HANDSHAKE_GEN_SRC:.c=.o) utils.o libsecp256k1.a libsodium.a
$(LIGHTNINGD_TEST_OBJS): $(LIGHTNINGD_HEADERS) $(BITCOIN_HEADERS) $(CORE_HEADERS) $(GEN_HEADERS) $(WIRE_HEADERS) $(CCAN_HEADERS) $(LIBBASE58_HEADERS) $(LIGHTNINGD_TEST_OBJS): $(LIGHTNINGD_HEADERS)
lightningd/tests: $(LIGHTNINGD_TEST_PROGRAMS:%=unittest/%) lightningd/tests: $(LIGHTNINGD_TEST_PROGRAMS:%=unittest/%)

Loading…
Cancel
Save