Browse Source

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>
travis-experimental
Rusty Russell 4 years ago
parent
commit
a8177e9013
  1. 7
      Makefile
  2. 7
      bitcoin/Makefile
  3. 4
      channeld/channeld.c
  4. 1
      channeld/full_channel_error.h
  5. 3
      common/Makefile
  6. 2
      devtools/blindedpath.c
  7. 8
      devtools/decodemsg.c
  8. 4
      devtools/dump-gossipstore.c
  9. 2
      devtools/gossipwith.c
  10. 2
      devtools/mkcommit.c
  11. 2
      devtools/mkgossip.c
  12. 2
      devtools/mkquery.c
  13. 2
      lightningd/channel.c
  14. 2
      lightningd/plugin.c
  15. 2
      openingd/dualopend.c
  16. 2
      plugins/Makefile
  17. 2
      plugins/spender/main.c
  18. 2
      tools/check-bolt.c
  19. 2
      tools/hsmtool.c
  20. 8
      tools/test/Makefile
  21. 2
      wallet/db_postgres.c
  22. 4
      wallet/db_sqlite3.c

7
Makefile

@ -380,6 +380,11 @@ check-hdr-include-order/%: %
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
# 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.
ifeq ($(EXPERIMENTAL_FEATURES),1)
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/
check-includes:
check-includes: check-src-includes check-hdr-includes
@tools/check-includes.sh
# cppcheck gets confused by list_for_each(head, i, list): thinks i is uninit.

7
bitcoin/Makefile

@ -38,20 +38,15 @@ BITCOIN_HEADERS := bitcoin/address.h \
bitcoin/tx_parts.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_OBJS): $(CCAN_HEADERS) $(BITCOIN_HEADERS) $(EXTERNAL_HEADERS)
check-source-bolt: $(BITCOIN_SRC:%=bolt-check/%) $(BITCOIN_HEADERS:%=bolt-check/%)
check-makefile: check-bitcoin-makefile
check-bitcoin-makefile:
@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

4
channeld/channeld.c

@ -47,9 +47,9 @@
#include <common/peer_billboard.h>
#include <common/peer_failed.h>
#include <common/ping.h>
#include <common/private_channel_announcement.h>
#include <common/psbt_internal.h>
#include <common/psbt_open.h>
#include <common/private_channel_announcement.h>
#include <common/read_peer_msg.h>
#include <common/sphinx.h>
#include <common/status.h>
@ -60,8 +60,8 @@
#include <common/wire_error.h>
#include <errno.h>
#include <fcntl.h>
#include <gossipd/gossipd_peerd_wiregen.h>
#include <gossipd/gossip_store_wiregen.h>
#include <gossipd/gossipd_peerd_wiregen.h>
#include <hsmd/hsmd_wiregen.h>
#include <inttypes.h>
#include <secp256k1.h>

1
channeld/full_channel_error.h

@ -1,6 +1,7 @@
/* Error enums separated out for easy autogen of names*/
#ifndef LIGHTNING_CHANNELD_FULL_CHANNEL_ERROR_H
#define LIGHTNING_CHANNELD_FULL_CHANNEL_ERROR_H
#include "config.h"
enum channel_add_err {
/* All OK! */

3
common/Makefile

@ -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-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
common-clean:

2
devtools/blindedpath.c

@ -15,8 +15,8 @@
#include <common/version.h>
#include <secp256k1.h>
#include <secp256k1_ecdh.h>
#include <sodium/crypto_auth_hmacsha256.h>
#include <sodium/crypto_aead_chacha20poly1305.h>
#include <sodium/crypto_auth_hmacsha256.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>

8
devtools/decodemsg.c

@ -6,11 +6,11 @@
#include <stdio.h>
#include <unistd.h>
#if EXPERIMENTAL_FEATURES
#include <wire/onion_exp_printgen.h>
#include <wire/peer_exp_printgen.h>
#include <wire/onion_exp_printgen.h>
#include <wire/peer_exp_printgen.h>
#else
#include <wire/onion_printgen.h>
#include <wire/peer_printgen.h>
#include <wire/onion_printgen.h>
#include <wire/peer_printgen.h>
#endif
int main(int argc, char *argv[])

4
devtools/dump-gossipstore.c

@ -1,12 +1,12 @@
#include <ccan/crc32c/crc32c.h>
#include <ccan/err/err.h>
#include <ccan/opt/opt.h>
#include <common/gossip_store.h>
#include <common/type_to_string.h>
#include <common/utils.h>
#include <fcntl.h>
#include <common/gossip_store.h>
#include <gossipd/gossipd_peerd_wiregen.h>
#include <gossipd/gossip_store_wiregen.h>
#include <gossipd/gossipd_peerd_wiregen.h>
#include <inttypes.h>
#include <stdio.h>
#include <sys/stat.h>

2
devtools/gossipwith.c

@ -42,7 +42,7 @@ static struct io_plan *simple_close(struct io_conn *conn)
return NULL;
}
#include "../connectd/handshake.c"
#include "../connectd/handshake.c"
/* This makes the handshake prototypes work. */
struct io_conn {

2
devtools/mkcommit.c

@ -12,8 +12,8 @@
#include <bitcoin/script.h>
#include <bitcoin/tx.h>
#include <ccan/cast/cast.h>
#include <ccan/opt/opt.h>
#include <ccan/err/err.h>
#include <ccan/opt/opt.h>
#include <ccan/str/hex/hex.h>
#include <ccan/tal/str/str.h>
#include <channeld/full_channel.h>

2
devtools/mkgossip.c

@ -21,8 +21,8 @@
#include <common/type_to_string.h>
#include <common/utils.h>
#include <inttypes.h>
#include <wire/peer_wire.h>
#include <stdio.h>
#include <wire/peer_wire.h>
static bool verbose = false;

2
devtools/mkquery.c

@ -11,8 +11,8 @@
#include <common/gossip_constants.h>
#include <common/utils.h>
#include <inttypes.h>
#include <wire/peer_wire.h>
#include <stdio.h>
#include <wire/peer_wire.h>
static void usage(void)
{

2
lightningd/channel.c

@ -19,8 +19,8 @@
#include <lightningd/lightningd.h>
#include <lightningd/log.h>
#include <lightningd/notification.h>
#include <lightningd/opening_control.h>
#include <lightningd/opening_common.h>
#include <lightningd/opening_control.h>
#include <lightningd/peer_control.h>
#include <lightningd/subd.h>
#include <wire/wire_sync.h>

2
lightningd/plugin.c

@ -4,9 +4,9 @@
#include <ccan/tal/str/str.h>
#include <ccan/utf8/utf8.h>
#include <common/features.h>
#include <common/json_helpers.h>
#include <common/utils.h>
#include <common/version.h>
#include <common/json_helpers.h>
#include <lightningd/json.h>
#include <lightningd/notification.h>
#include <lightningd/options.h>

2
openingd/dualopend.c

@ -42,8 +42,8 @@
#include <common/setup.h>
#include <common/status.h>
#include <common/subdaemon.h>
#include <common/type_to_string.h>
#include <common/tx_roles.h>
#include <common/type_to_string.h>
#include <common/utils.h>
#include <common/version.h>
#include <common/wire_error.h>

2
plugins/Makefile

@ -58,7 +58,7 @@ PLUGINS := \
# Make sure these depend on everything.
ALL_C_SOURCES += $(PLUGIN_ALL_SRC)
ALL_C_HEADERS +=
ALL_C_HEADERS += $(PLUGIN_ALL_HEADER)
ALL_PROGRAMS += $(PLUGINS)
PLUGIN_COMMON_OBJS := \

2
plugins/spender/main.c

@ -1,8 +1,8 @@
#include <common/utils.h>
#include <plugins/libplugin.h>
#include <plugins/spender/multiwithdraw.h>
#include <plugins/spender/fundchannel.h>
#include <plugins/spender/multifundchannel.h>
#include <plugins/spender/multiwithdraw.h>
/*~ The spender plugin contains various commands that handle
* spending from the onchain wallet. */

2
tools/check-bolt.c

@ -8,8 +8,8 @@
#include <ccan/tal/str/str.h>
#include <ccan/tal/tal.h>
#include <common/utils.h>
#include <sys/types.h>
#include <dirent.h>
#include <sys/types.h>
static bool verbose = false;

2
tools/hsmtool.c

@ -3,8 +3,8 @@
#include <ccan/err/err.h>
#include <ccan/noerr/noerr.h>
#include <ccan/read_write_all/read_write_all.h>
#include <ccan/tal/path/path.h>
#include <ccan/str/str.h>
#include <ccan/tal/path/path.h>
#include <common/bech32.h>
#include <common/derive_basepoints.h>
#include <common/node_id.h>

8
tools/test/Makefile

@ -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_OBJS := $(TOOL_GEN_SRC:.c=.o)
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.
ifeq ($(DEVELOPER),1)
TOOL_TEST_PROGRAMS := $(TOOL_TEST_OBJS:.o=)
TOOL_TEST_SRC := $(wildcard tools/test/run-*.c)
else
TOOL_TEST_PROGRAMS :=
TOOL_TEST_SRC :=
endif
TOOL_TEST_OBJS := $(TOOL_TEST_SRC:.c=.o)
TOOL_TEST_PROGRAMS := $(TOOL_TEST_OBJS:.o=)
# Get dependencies correct
ALL_C_SOURCES += $(TOOL_GEN_SRC) $(TOOL_TEST_SRC)

2
wallet/db_postgres.c

@ -1,9 +1,9 @@
#include <wallet/db_common.h>
#include "db_postgres_sqlgen.c"
#include <ccan/ccan/tal/str/str.h>
#include <ccan/endian/endian.h>
#include <lightningd/log.h>
#include <stdio.h>
#include <wallet/db_common.h>
#if HAVE_POSTGRES
/* Indented in order not to trigger the inclusion order check */

4
wallet/db_sqlite3.c

@ -1,11 +1,11 @@
#include <wallet/db_common.h>
#include "db_sqlite3_sqlgen.c"
#include <ccan/ccan/tal/str/str.h>
#include <lightningd/log.h>
#include <stdio.h>
#include <wallet/db_common.h>
#if HAVE_SQLITE3
#include <sqlite3.h>
#include <sqlite3.h>
#if !HAVE_SQLITE3_EXPANDED_SQL
/* Prior to sqlite3 v3.14, we have to use tracing to dump statements */

Loading…
Cancel
Save