@@ -21,7 +21,6 @@ ECHO := echo
2121SUPPRESS_OUTPUT :=
2222endif
2323
24- CARGO := cargo
2524DISTRO =$(shell lsb_release -is 2>/dev/null || echo unknown) -$(shell lsb_release -rs 2>/dev/null || echo unknown)
2625OS =$(shell uname -s)
2726ARCH =$(shell uname -m)
@@ -105,7 +104,6 @@ CCAN_OBJS := \
105104 ccan-bitmap.o \
106105 ccan-bitops.o \
107106 ccan-breakpoint.o \
108- ccan-cdump.o \
109107 ccan-closefrom.o \
110108 ccan-crc32c.o \
111109 ccan-crypto-hmac.o \
@@ -231,6 +229,8 @@ CCAN_HEADERS := \
231229 $(CCANDIR ) /ccan/typesafe_cb/typesafe_cb.h \
232230 $(CCANDIR ) /ccan/utf8/utf8.h
233231
232+ CDUMP_OBJS := ccan-cdump.o ccan-strmap.o
233+
234234BOLT_GEN := tools/generate-wire.py
235235WIRE_GEN := $(BOLT_GEN )
236236
@@ -468,7 +468,6 @@ PKGLIBEXEC_PROGRAMS = \
468468 lightningd/lightning_connectd \
469469 lightningd/lightning_dualopend \
470470 lightningd/lightning_gossipd \
471- lightningd/lightning_gossip_compactd \
472471 lightningd/lightning_hsmd \
473472 lightningd/lightning_onchaind \
474473 lightningd/lightning_openingd \
@@ -483,17 +482,16 @@ mkdocs.yml: $(MANPAGES:=.md)
483482 )
484483
485484
486- # Every single object file.
487- ALL_OBJS := $(ALL_C_SOURCES:.c=.o )
488485
489- WIREGEN_FILES := $(filter % printgen.h % printgen.c % wiregen.h % wiregen.c, $(ALL_C_HEADERS ) $(ALL_C_SOURCES ) )
486+ # Don't delete these intermediaries.
487+ .PRECIOUS : $(ALL_GEN_HEADERS ) $(ALL_GEN_SOURCES ) $(PYTHON_GENERATED )
490488
491- # Always make wiregen files before any object file
492- $( ALL_OBJS ) : $(WIREGEN_FILES )
489+ # Every single object file.
490+ ALL_OBJS := $(ALL_C_SOURCES:.c=.o )
493491
494492# We always regen wiregen and printgen files, since SHA256STAMP protects against
495493# spurious rebuilds.
496- $(WIREGEN_FILES ) : $(FORCE )
494+ $(filter % printgen.h % printgen.c % wiregen.h % wiregen.c, $( ALL_C_HEADERS ) $( ALL_C_SOURCES ) ) : $(FORCE )
497495
498496ifneq ($(TEST_GROUP_COUNT ) ,)
499497PYTEST_OPTS += --test-group=$(TEST_GROUP ) --test-group-count=$(TEST_GROUP_COUNT )
@@ -645,8 +643,10 @@ update-doc-examples:
645643check-doc-examples : update-doc-examples
646644 git diff --exit-code HEAD
647645
648- # This should NOT compile things!
649- check-source : check-makefile check-whitespace check-spelling check-python-flake8 check-includes check-shellcheck check-setup_locale check-tmpctx check-discouraged-functions check-amount-access check-bad-sprintf
646+ # For those without working cppcheck
647+ check-source-no-cppcheck : check-makefile check-source-bolt check-whitespace check-spelling check-python check-includes check-shellcheck check-setup_locale check-tmpctx check-discouraged-functions check-amount-access check-bad-sprintf
648+
649+ check-source : check-source-no-cppcheck
650650
651651full-check : check check-source
652652
@@ -719,7 +719,7 @@ TAGS:
719719tags :
720720 $(RM ) tags; find * -name test -type d -prune -o \( -name ' *.[ch]' -o -name ' *.py' \) -print0 | xargs -0 ctags --append
721721
722- ccan/ccan/cdump/tools/cdump-enumstr : ccan/ccan/cdump/tools/cdump-enumstr.o libccan.a
722+ ccan/ccan/cdump/tools/cdump-enumstr : ccan/ccan/cdump/tools/cdump-enumstr.o $( CDUMP_OBJS ) $( CCAN_OBJS )
723723
724724ALL_PROGRAMS += ccan/ccan/cdump/tools/cdump-enumstr
725725# Can't add to ALL_OBJS, as that makes a circular dep.
@@ -741,9 +741,6 @@ endif
741741header_versions_gen.h : tools/headerversions $(FORCE )
742742 @tools/headerversions $@
743743
744- # Once you have libccan.a, you don't need these.
745- .INTERMEDIATE : $(CCAN_OBJS )
746-
747744# We make a static library, this way linker can discard unused parts.
748745libccan.a : $(CCAN_OBJS )
749746 @$(call VERBOSE, "ar $@ ", $(AR ) r $@ $(CCAN_OBJS ) )
@@ -965,21 +962,25 @@ install-data: installdirs $(MAN1PAGES) $(MAN5PAGES) $(MAN7PAGES) $(MAN8PAGES) $(
965962
966963install : install-program install-data
967964
968- # We exclude most of target/ and external, but we need:
969- # 1. config files (we only tar up files *newer* than these)
970- # 2. $(DEFAULT_TARGETS) for rust stuff.
971- # 3. $(EXTERNAL_LIBS) for prebuild external libraries .
972- TESTPACK_EXTRAS := \
973- config.vars ccan/config.h \
974- header_versions_gen.h \
975- $( DEFAULT_TARGETS ) \
976- $( EXTERNAL_LIBS )
965+ # Non-artifacts that are needed for testing. These are added to the
966+ # testpack.tar, used to transfer things between builder and tester
967+ # phase. If you get a missing file/executable while testing on CI it
968+ # is likely missing from this variable .
969+ TESTBINS = \
970+ $( CLN_PLUGIN_EXAMPLES ) \
971+ tests/plugins/test_libplugin \
972+ tests/plugins/channeld_fakenet \
973+ tests/plugins/test_selfdisable_after_getmanifest
977974
978975# The testpack is used in CI to transfer built artefacts between the
979- # build and the test phase. Only useful on a freshly build tree!
980- # We use Posix format for timestamps with subsecond accuracy.
981- testpack.tar.gz : all-programs all-fuzz-programs all-test-programs default-targets
982- (find * -path external -prune -o -path target -prune -o -newer config.vars -type f -print; ls $( TESTPACK_EXTRAS) ) | tar --verbatim-files-from -T- -c --format=posix -f - | gzip -5 > $@
976+ # build and the test phase. This is necessary because the fixtures in
977+ # `tests/` explicitly use the binaries built in the current directory
978+ # rather than using `$PATH`, as that may pick up some other installed
979+ # version of `lightningd` leading to bogus results. We bundle up all
980+ # built artefacts here, and will unpack them on the tester (overlaying
981+ # on top of the checked out repo as if we had just built it in place).
982+ testpack.tar.bz2 : $(BIN_PROGRAMS ) $(PKGLIBEXEC_PROGRAMS ) $(PLUGINS ) $(PY_PLUGINS ) $(MAN1PAGES ) $(MAN5PAGES ) $(MAN7PAGES ) $(MAN8PAGES ) $(DOC_DATA ) config.vars $(TESTBINS ) $(DEVTOOLS ) $(TOOLS )
983+ tar -caf $@ $^
983984
984985uninstall :
985986 @$(NORMAL_UNINSTALL )
@@ -1155,9 +1156,6 @@ ccan-rune-rune.o: $(CCANDIR)/ccan/rune/rune.c
11551156ccan-rune-coding.o : $(CCANDIR ) /ccan/rune/coding.c
11561157 @$(call VERBOSE, "cc $< ", $(CC ) $(CFLAGS ) -c -o $@ $< )
11571158
1158- canned-gossmap : devtools/gossmap-compress
1159- DATE=` date +%Y-%m-%d` && devtools/gossmap-compress compress --output-node-map /tmp/gossip_store tests/data/gossip-store-$$ DATE.compressed > tests/data/gossip-store-$$ DATE-node-map && xz -9 tests/data/gossip-store-$$ DATE-node-map && ls -l tests/data/gossip-store-$$ DATE*
1160-
11611159print-binary-sizes : $(ALL_PROGRAMS ) $(ALL_TEST_PROGRAMS ) $(BIN_PROGRAMS )
11621160 @echo User programs:
11631161 @size -t $(PKGLIBEXEC_PROGRAMS ) $(filter-out tools/reckless,$(BIN_PROGRAMS ) ) $(PLUGINS )
0 commit comments