1 COMPULSORY_TEST_CFILES := $(wildcard tools/ccanlint/compulsory_tests/*.c)
2 NORMAL_TEST_CFILES := $(wildcard tools/ccanlint/tests/*.c)
3 TEST_OBJS := $(NORMAL_TEST_CFILES:.c=.o) $(COMPULSORY_TEST_CFILES:.c=.o)
8 ccan/foreach/foreach.o \
9 ccan/grab_file/grab_file.o \
11 ccan/htable/htable.o \
17 ccan/read_write_all/read_write_all.o \
18 ccan/str/str.o ccan/str/debug.o \
19 ccan/str_talloc/str_talloc.o \
20 ccan/talloc/talloc.o \
21 ccan/talloc_link/talloc_link.o \
23 tools/ccanlint/ccanlint.o \
24 tools/ccanlint/file_analysis.o \
25 tools/ccanlint/licenses.o \
28 tools/doc_extract-core.o \
31 OBJS := $(CORE_OBJS) $(TEST_OBJS)
33 # FIXME: write a trivial C program to do this
34 tools/ccanlint/generated-normal-tests: $(NORMAL_TEST_CFILES)
35 cat $^ | grep ^REGISTER_TEST > $@
36 tools/ccanlint/generated-compulsory-tests: $(COMPULSORY_TEST_CFILES)
37 cat $^ | grep ^REGISTER_TEST > $@
39 $(TEST_OBJS): tools/ccanlint/generated-normal-tests tools/ccanlint/generated-compulsory-tests
41 # Otherwise, ccanlint.c et al. may fail to build
42 $(CORE_OBJS): tools/ccanlint/generated-normal-tests tools/ccanlint/generated-compulsory-tests config.h
44 tools/ccanlint/ccanlint: $(OBJS)
47 $(RM) tools/ccanlint/generated-compulsory-tests
48 $(RM) tools/ccanlint/generated-normal-tests
49 $(RM) tools/ccanlint/ccanlint