core-lightning/gossipd/test/Makefile
Rusty Russell 1746406e41 Makefile: normalize all the Makefiles
We create ALL_PROGRAMS, ALL_TEST_PROGRAMS, ALL_C_SOURCES and
ALL_C_HEADERS.  Then the toplevel Makefile knows which are
autogenerated (by wildcard), so it can have all the rules to clean
them or check the source as necessary.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2020-08-31 21:33:26 -05:00

35 lines
1,023 B
Makefile

check-units: gossipd-tests
# Note that these actually #include everything they need, except ccan/ and bitcoin/.
# That allows for unit testing of statics, and special effects.
GOSSIPD_TEST_SRC := $(wildcard gossipd/test/run-*.c)
GOSSIPD_TEST_OBJS := $(GOSSIPD_TEST_SRC:.c=.o)
GOSSIPD_TEST_PROGRAMS := $(GOSSIPD_TEST_OBJS:.o=)
GOSSIPD_TEST_COMMON_OBJS := \
common/amount.o \
common/bigsize.o \
common/channel_id.o \
common/features.o \
common/node_id.o \
common/json.o \
common/json_helpers.o \
common/pseudorand.o \
common/type_to_string.o \
common/utils.o \
wire/peer_wiregen.o \
wire/fromwire.o \
wire/towire.o
ALL_C_SOURCES += $(GOSSIPD_TEST_SRC)
ALL_TEST_PROGRAMS += $(GOSSIPD_TEST_PROGRAMS)
update-mocks: $(GOSSIPD_TEST_SRC:%=update-mocks/%)
$(GOSSIPD_TEST_PROGRAMS): $(GOSSIPD_TEST_COMMON_OBJS) $(BITCOIN_OBJS)
# Test objects depend on ../ src and headers.
$(GOSSIPD_TEST_OBJS): $(GOSSIPD_HEADERS) $(GOSSIPD_SRC)
gossipd-tests: $(GOSSIPD_TEST_PROGRAMS:%=unittest/%)