mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 15:14:23 +01:00
Makefile: make check-includes check all the non-generated files.
Note that check-whitespace and check-bolt already do this, so we can eliminate redundant lines in common/Makefile and bitcoin/Makefile. We also include the plugin headers in ALL_C_HEADERS so they get checked. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
7
Makefile
7
Makefile
@@ -380,6 +380,11 @@ check-hdr-include-order/%: %
|
|||||||
check-makefile:
|
check-makefile:
|
||||||
@if [ x"$(CCANDIR)/config.h `find $(CCANDIR)/ccan -name '*.h' | grep -v /test/ | $(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/ | $(SORT) | tr '\n' ' '`" != x"$(CCAN_HEADERS) " ]; then echo CCAN_HEADERS incorrect; exit 1; fi
|
||||||
|
|
||||||
|
# We exclude test files, which need to do weird include tricks!
|
||||||
|
SRC_TO_CHECK := $(filter-out $(ALL_TEST_PROGRAMS:=.c), $(ALL_NONGEN_SOURCES))
|
||||||
|
check-src-includes: $(SRC_TO_CHECK:%=check-src-include-order/%)
|
||||||
|
check-hdr-includes: $(ALL_NONGEN_HEADERS:%=check-hdr-include-order/%)
|
||||||
|
|
||||||
# Experimental quotes quote the exact version.
|
# Experimental quotes quote the exact version.
|
||||||
ifeq ($(EXPERIMENTAL_FEATURES),1)
|
ifeq ($(EXPERIMENTAL_FEATURES),1)
|
||||||
CHECK_BOLT_PREFIX=--prefix="BOLT-$(BOLTVERSION)"
|
CHECK_BOLT_PREFIX=--prefix="BOLT-$(BOLTVERSION)"
|
||||||
@@ -425,7 +430,7 @@ check-python: check-pyln-client check-pyln-testing
|
|||||||
|
|
||||||
PATH=$(PYLN_PATH) PYTHONPATH=$(PYTHONPATH) $(PYTEST) contrib/pyln-proto/tests/
|
PATH=$(PYLN_PATH) PYTHONPATH=$(PYTHONPATH) $(PYTEST) contrib/pyln-proto/tests/
|
||||||
|
|
||||||
check-includes:
|
check-includes: check-src-includes check-hdr-includes
|
||||||
@tools/check-includes.sh
|
@tools/check-includes.sh
|
||||||
|
|
||||||
# cppcheck gets confused by list_for_each(head, i, list): thinks i is uninit.
|
# cppcheck gets confused by list_for_each(head, i, list): thinks i is uninit.
|
||||||
|
|||||||
@@ -38,20 +38,15 @@ BITCOIN_HEADERS := bitcoin/address.h \
|
|||||||
bitcoin/tx_parts.h \
|
bitcoin/tx_parts.h \
|
||||||
bitcoin/varint.h
|
bitcoin/varint.h
|
||||||
|
|
||||||
check-source: $(BITCOIN_SRC:%=check-src-include-order/%) \
|
|
||||||
$(BITCOIN_HEADERS:%=check-hdr-include-order/%)
|
|
||||||
|
|
||||||
# Bitcoin objects depends on bitcoin/ external/ and ccan
|
# Bitcoin objects depends on bitcoin/ external/ and ccan
|
||||||
$(BITCOIN_OBJS): $(CCAN_HEADERS) $(BITCOIN_HEADERS) $(EXTERNAL_HEADERS)
|
$(BITCOIN_OBJS): $(CCAN_HEADERS) $(BITCOIN_HEADERS) $(EXTERNAL_HEADERS)
|
||||||
|
|
||||||
check-source-bolt: $(BITCOIN_SRC:%=bolt-check/%) $(BITCOIN_HEADERS:%=bolt-check/%)
|
|
||||||
|
|
||||||
check-makefile: check-bitcoin-makefile
|
check-makefile: check-bitcoin-makefile
|
||||||
|
|
||||||
check-bitcoin-makefile:
|
check-bitcoin-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
|
||||||
|
|
||||||
check-whitespace: $(BITCOIN_SRC:%=check-whitespace/%) $(BITCOIN_HEADERS:%=check-whitespace/%) check-whitespace/bitcoin/Makefile
|
check-whitespace: check-whitespace/bitcoin/Makefile
|
||||||
|
|
||||||
clean: bitcoin-clean
|
clean: bitcoin-clean
|
||||||
|
|
||||||
|
|||||||
@@ -47,9 +47,9 @@
|
|||||||
#include <common/peer_billboard.h>
|
#include <common/peer_billboard.h>
|
||||||
#include <common/peer_failed.h>
|
#include <common/peer_failed.h>
|
||||||
#include <common/ping.h>
|
#include <common/ping.h>
|
||||||
|
#include <common/private_channel_announcement.h>
|
||||||
#include <common/psbt_internal.h>
|
#include <common/psbt_internal.h>
|
||||||
#include <common/psbt_open.h>
|
#include <common/psbt_open.h>
|
||||||
#include <common/private_channel_announcement.h>
|
|
||||||
#include <common/read_peer_msg.h>
|
#include <common/read_peer_msg.h>
|
||||||
#include <common/sphinx.h>
|
#include <common/sphinx.h>
|
||||||
#include <common/status.h>
|
#include <common/status.h>
|
||||||
@@ -60,8 +60,8 @@
|
|||||||
#include <common/wire_error.h>
|
#include <common/wire_error.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <gossipd/gossipd_peerd_wiregen.h>
|
|
||||||
#include <gossipd/gossip_store_wiregen.h>
|
#include <gossipd/gossip_store_wiregen.h>
|
||||||
|
#include <gossipd/gossipd_peerd_wiregen.h>
|
||||||
#include <hsmd/hsmd_wiregen.h>
|
#include <hsmd/hsmd_wiregen.h>
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
#include <secp256k1.h>
|
#include <secp256k1.h>
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
/* Error enums separated out for easy autogen of names*/
|
/* Error enums separated out for easy autogen of names*/
|
||||||
#ifndef LIGHTNING_CHANNELD_FULL_CHANNEL_ERROR_H
|
#ifndef LIGHTNING_CHANNELD_FULL_CHANNEL_ERROR_H
|
||||||
#define LIGHTNING_CHANNELD_FULL_CHANNEL_ERROR_H
|
#define LIGHTNING_CHANNELD_FULL_CHANNEL_ERROR_H
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
enum channel_add_err {
|
enum channel_add_err {
|
||||||
/* All OK! */
|
/* All OK! */
|
||||||
|
|||||||
@@ -119,9 +119,6 @@ common/gossip_store.o: gossipd/gossip_store_wiregen.h
|
|||||||
check-source-bolt: $(COMMON_SRC_NOGEN:%=bolt-check/%) $(COMMON_HEADERS:%=bolt-check/%)
|
check-source-bolt: $(COMMON_SRC_NOGEN:%=bolt-check/%) $(COMMON_HEADERS:%=bolt-check/%)
|
||||||
check-whitespace: $(COMMON_SRC_NOGEN:%=check-whitespace/%) $(COMMON_HEADERS:%=check-whitespace/%)
|
check-whitespace: $(COMMON_SRC_NOGEN:%=check-whitespace/%) $(COMMON_HEADERS:%=check-whitespace/%)
|
||||||
|
|
||||||
check-source: $(COMMON_SRC_NOGEN:%=check-src-include-order/%) \
|
|
||||||
$(COMMON_HEADERS_NOGEN:%=check-hdr-include-order/%)
|
|
||||||
|
|
||||||
clean: common-clean
|
clean: common-clean
|
||||||
|
|
||||||
common-clean:
|
common-clean:
|
||||||
|
|||||||
@@ -15,8 +15,8 @@
|
|||||||
#include <common/version.h>
|
#include <common/version.h>
|
||||||
#include <secp256k1.h>
|
#include <secp256k1.h>
|
||||||
#include <secp256k1_ecdh.h>
|
#include <secp256k1_ecdh.h>
|
||||||
#include <sodium/crypto_auth_hmacsha256.h>
|
|
||||||
#include <sodium/crypto_aead_chacha20poly1305.h>
|
#include <sodium/crypto_aead_chacha20poly1305.h>
|
||||||
|
#include <sodium/crypto_auth_hmacsha256.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
#include <ccan/crc32c/crc32c.h>
|
#include <ccan/crc32c/crc32c.h>
|
||||||
#include <ccan/err/err.h>
|
#include <ccan/err/err.h>
|
||||||
#include <ccan/opt/opt.h>
|
#include <ccan/opt/opt.h>
|
||||||
|
#include <common/gossip_store.h>
|
||||||
#include <common/type_to_string.h>
|
#include <common/type_to_string.h>
|
||||||
#include <common/utils.h>
|
#include <common/utils.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <common/gossip_store.h>
|
|
||||||
#include <gossipd/gossipd_peerd_wiregen.h>
|
|
||||||
#include <gossipd/gossip_store_wiregen.h>
|
#include <gossipd/gossip_store_wiregen.h>
|
||||||
|
#include <gossipd/gossipd_peerd_wiregen.h>
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
|||||||
@@ -12,8 +12,8 @@
|
|||||||
#include <bitcoin/script.h>
|
#include <bitcoin/script.h>
|
||||||
#include <bitcoin/tx.h>
|
#include <bitcoin/tx.h>
|
||||||
#include <ccan/cast/cast.h>
|
#include <ccan/cast/cast.h>
|
||||||
#include <ccan/opt/opt.h>
|
|
||||||
#include <ccan/err/err.h>
|
#include <ccan/err/err.h>
|
||||||
|
#include <ccan/opt/opt.h>
|
||||||
#include <ccan/str/hex/hex.h>
|
#include <ccan/str/hex/hex.h>
|
||||||
#include <ccan/tal/str/str.h>
|
#include <ccan/tal/str/str.h>
|
||||||
#include <channeld/full_channel.h>
|
#include <channeld/full_channel.h>
|
||||||
|
|||||||
@@ -21,8 +21,8 @@
|
|||||||
#include <common/type_to_string.h>
|
#include <common/type_to_string.h>
|
||||||
#include <common/utils.h>
|
#include <common/utils.h>
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
#include <wire/peer_wire.h>
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <wire/peer_wire.h>
|
||||||
|
|
||||||
static bool verbose = false;
|
static bool verbose = false;
|
||||||
|
|
||||||
|
|||||||
@@ -11,8 +11,8 @@
|
|||||||
#include <common/gossip_constants.h>
|
#include <common/gossip_constants.h>
|
||||||
#include <common/utils.h>
|
#include <common/utils.h>
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
#include <wire/peer_wire.h>
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <wire/peer_wire.h>
|
||||||
|
|
||||||
static void usage(void)
|
static void usage(void)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -19,8 +19,8 @@
|
|||||||
#include <lightningd/lightningd.h>
|
#include <lightningd/lightningd.h>
|
||||||
#include <lightningd/log.h>
|
#include <lightningd/log.h>
|
||||||
#include <lightningd/notification.h>
|
#include <lightningd/notification.h>
|
||||||
#include <lightningd/opening_control.h>
|
|
||||||
#include <lightningd/opening_common.h>
|
#include <lightningd/opening_common.h>
|
||||||
|
#include <lightningd/opening_control.h>
|
||||||
#include <lightningd/peer_control.h>
|
#include <lightningd/peer_control.h>
|
||||||
#include <lightningd/subd.h>
|
#include <lightningd/subd.h>
|
||||||
#include <wire/wire_sync.h>
|
#include <wire/wire_sync.h>
|
||||||
|
|||||||
@@ -4,9 +4,9 @@
|
|||||||
#include <ccan/tal/str/str.h>
|
#include <ccan/tal/str/str.h>
|
||||||
#include <ccan/utf8/utf8.h>
|
#include <ccan/utf8/utf8.h>
|
||||||
#include <common/features.h>
|
#include <common/features.h>
|
||||||
|
#include <common/json_helpers.h>
|
||||||
#include <common/utils.h>
|
#include <common/utils.h>
|
||||||
#include <common/version.h>
|
#include <common/version.h>
|
||||||
#include <common/json_helpers.h>
|
|
||||||
#include <lightningd/json.h>
|
#include <lightningd/json.h>
|
||||||
#include <lightningd/notification.h>
|
#include <lightningd/notification.h>
|
||||||
#include <lightningd/options.h>
|
#include <lightningd/options.h>
|
||||||
|
|||||||
@@ -42,8 +42,8 @@
|
|||||||
#include <common/setup.h>
|
#include <common/setup.h>
|
||||||
#include <common/status.h>
|
#include <common/status.h>
|
||||||
#include <common/subdaemon.h>
|
#include <common/subdaemon.h>
|
||||||
#include <common/type_to_string.h>
|
|
||||||
#include <common/tx_roles.h>
|
#include <common/tx_roles.h>
|
||||||
|
#include <common/type_to_string.h>
|
||||||
#include <common/utils.h>
|
#include <common/utils.h>
|
||||||
#include <common/version.h>
|
#include <common/version.h>
|
||||||
#include <common/wire_error.h>
|
#include <common/wire_error.h>
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ PLUGINS := \
|
|||||||
|
|
||||||
# Make sure these depend on everything.
|
# Make sure these depend on everything.
|
||||||
ALL_C_SOURCES += $(PLUGIN_ALL_SRC)
|
ALL_C_SOURCES += $(PLUGIN_ALL_SRC)
|
||||||
ALL_C_HEADERS +=
|
ALL_C_HEADERS += $(PLUGIN_ALL_HEADER)
|
||||||
ALL_PROGRAMS += $(PLUGINS)
|
ALL_PROGRAMS += $(PLUGINS)
|
||||||
|
|
||||||
PLUGIN_COMMON_OBJS := \
|
PLUGIN_COMMON_OBJS := \
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
#include <common/utils.h>
|
#include <common/utils.h>
|
||||||
#include <plugins/libplugin.h>
|
#include <plugins/libplugin.h>
|
||||||
#include <plugins/spender/multiwithdraw.h>
|
|
||||||
#include <plugins/spender/fundchannel.h>
|
#include <plugins/spender/fundchannel.h>
|
||||||
#include <plugins/spender/multifundchannel.h>
|
#include <plugins/spender/multifundchannel.h>
|
||||||
|
#include <plugins/spender/multiwithdraw.h>
|
||||||
|
|
||||||
/*~ The spender plugin contains various commands that handle
|
/*~ The spender plugin contains various commands that handle
|
||||||
* spending from the onchain wallet. */
|
* spending from the onchain wallet. */
|
||||||
|
|||||||
@@ -8,8 +8,8 @@
|
|||||||
#include <ccan/tal/str/str.h>
|
#include <ccan/tal/str/str.h>
|
||||||
#include <ccan/tal/tal.h>
|
#include <ccan/tal/tal.h>
|
||||||
#include <common/utils.h>
|
#include <common/utils.h>
|
||||||
#include <sys/types.h>
|
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
|
#include <sys/types.h>
|
||||||
|
|
||||||
static bool verbose = false;
|
static bool verbose = false;
|
||||||
|
|
||||||
|
|||||||
@@ -3,8 +3,8 @@
|
|||||||
#include <ccan/err/err.h>
|
#include <ccan/err/err.h>
|
||||||
#include <ccan/noerr/noerr.h>
|
#include <ccan/noerr/noerr.h>
|
||||||
#include <ccan/read_write_all/read_write_all.h>
|
#include <ccan/read_write_all/read_write_all.h>
|
||||||
#include <ccan/tal/path/path.h>
|
|
||||||
#include <ccan/str/str.h>
|
#include <ccan/str/str.h>
|
||||||
|
#include <ccan/tal/path/path.h>
|
||||||
#include <common/bech32.h>
|
#include <common/bech32.h>
|
||||||
#include <common/derive_basepoints.h>
|
#include <common/derive_basepoints.h>
|
||||||
#include <common/node_id.h>
|
#include <common/node_id.h>
|
||||||
|
|||||||
@@ -14,14 +14,14 @@ TOOL_TEST_INCL_SRC := tools/test/enum.c
|
|||||||
TOOL_GEN_SRC := tools/test/test_gen.c tools/test/print_gen.c
|
TOOL_GEN_SRC := tools/test/test_gen.c tools/test/print_gen.c
|
||||||
TOOL_GEN_OBJS := $(TOOL_GEN_SRC:.c=.o)
|
TOOL_GEN_OBJS := $(TOOL_GEN_SRC:.c=.o)
|
||||||
TOOL_GEN_HEADER := tools/test/test_gen.h tools/test/print_gen.h
|
TOOL_GEN_HEADER := tools/test/test_gen.h tools/test/print_gen.h
|
||||||
TOOL_TEST_SRC := $(wildcard tools/test/run-*.c)
|
|
||||||
TOOL_TEST_OBJS := $(TOOL_TEST_SRC:.c=.o)
|
|
||||||
# Don't require update-mocks hack unless developer mode.
|
# Don't require update-mocks hack unless developer mode.
|
||||||
ifeq ($(DEVELOPER),1)
|
ifeq ($(DEVELOPER),1)
|
||||||
TOOL_TEST_PROGRAMS := $(TOOL_TEST_OBJS:.o=)
|
TOOL_TEST_SRC := $(wildcard tools/test/run-*.c)
|
||||||
else
|
else
|
||||||
TOOL_TEST_PROGRAMS :=
|
TOOL_TEST_SRC :=
|
||||||
endif
|
endif
|
||||||
|
TOOL_TEST_OBJS := $(TOOL_TEST_SRC:.c=.o)
|
||||||
|
TOOL_TEST_PROGRAMS := $(TOOL_TEST_OBJS:.o=)
|
||||||
|
|
||||||
# Get dependencies correct
|
# Get dependencies correct
|
||||||
ALL_C_SOURCES += $(TOOL_GEN_SRC) $(TOOL_TEST_SRC)
|
ALL_C_SOURCES += $(TOOL_GEN_SRC) $(TOOL_TEST_SRC)
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
#include <wallet/db_common.h>
|
|
||||||
#include "db_postgres_sqlgen.c"
|
#include "db_postgres_sqlgen.c"
|
||||||
#include <ccan/ccan/tal/str/str.h>
|
#include <ccan/ccan/tal/str/str.h>
|
||||||
#include <ccan/endian/endian.h>
|
#include <ccan/endian/endian.h>
|
||||||
#include <lightningd/log.h>
|
#include <lightningd/log.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <wallet/db_common.h>
|
||||||
|
|
||||||
#if HAVE_POSTGRES
|
#if HAVE_POSTGRES
|
||||||
/* Indented in order not to trigger the inclusion order check */
|
/* Indented in order not to trigger the inclusion order check */
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
#include <wallet/db_common.h>
|
|
||||||
#include "db_sqlite3_sqlgen.c"
|
#include "db_sqlite3_sqlgen.c"
|
||||||
#include <ccan/ccan/tal/str/str.h>
|
#include <ccan/ccan/tal/str/str.h>
|
||||||
#include <lightningd/log.h>
|
#include <lightningd/log.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <wallet/db_common.h>
|
||||||
|
|
||||||
#if HAVE_SQLITE3
|
#if HAVE_SQLITE3
|
||||||
#include <sqlite3.h>
|
#include <sqlite3.h>
|
||||||
|
|||||||
Reference in New Issue
Block a user