mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-12-29 10:04:41 +01:00
1746406e41
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>
29 lines
879 B
Makefile
29 lines
879 B
Makefile
check-units: onchaind-tests
|
|
|
|
# Note that these actually #include everything they need, except ccan/ and bitcoin/.
|
|
# That allows for unit testing of statics, and special effects.
|
|
ONCHAIND_TEST_SRC := $(wildcard onchaind/test/run-*.c)
|
|
ONCHAIND_TEST_OBJS := $(ONCHAIND_TEST_SRC:.c=.o)
|
|
ONCHAIND_TEST_PROGRAMS := $(ONCHAIND_TEST_OBJS:.o=)
|
|
|
|
ALL_C_SOURCES += $(ONCHAIND_TEST_SRC)
|
|
ALL_TEST_PROGRAMS += $(ONCHAIND_TEST_PROGRAMS)
|
|
|
|
ONCHAIND_TEST_COMMON_OBJS := \
|
|
common/amount.o \
|
|
common/features.o \
|
|
common/pseudorand.o \
|
|
common/setup.o \
|
|
common/type_to_string.o \
|
|
common/utils.o
|
|
|
|
update-mocks: $(ONCHAIND_TEST_SRC:%=update-mocks/%)
|
|
|
|
$(ONCHAIND_TEST_PROGRAMS): $(ONCHAIND_TEST_COMMON_OBJS) $(BITCOIN_OBJS)
|
|
|
|
# Test objects depend on ../ src and headers.
|
|
$(ONCHAIND_TEST_OBJS): $(ONCHAIND_HEADERS) $(ONCHAIND_SRC)
|
|
|
|
onchaind-tests: $(ONCHAIND_TEST_PROGRAMS:%=unittest/%)
|
|
|