]> git.ozlabs.org Git - ccan/blob - tools/ccanlint/Makefile
ccanlint: run tests in parallel
[ccan] / tools / ccanlint / Makefile
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)
4
5 CORE_OBJS := \
6         ccan/asort/asort.o \
7         ccan/btree/btree.o \
8         ccan/foreach/foreach.o \
9         ccan/grab_file/grab_file.o \
10         ccan/hash/hash.o \
11         ccan/htable/htable.o \
12         ccan/lbalance/lbalance.o \
13         ccan/noerr/noerr.o \
14         ccan/opt/helpers.o \
15         ccan/opt/opt.o \
16         ccan/opt/parse.o \
17         ccan/opt/usage.o \
18         ccan/read_write_all/read_write_all.o \
19         ccan/str/str.o ccan/str/debug.o \
20         ccan/str_talloc/str_talloc.o \
21         ccan/talloc/talloc.o \
22         ccan/talloc_link/talloc_link.o \
23         ccan/time/time.o \
24         tools/ccanlint/async.o \
25         tools/ccanlint/ccanlint.o \
26         tools/ccanlint/file_analysis.o \
27         tools/ccanlint/licenses.o \
28         tools/compile.o \
29         tools/depends.o \
30         tools/doc_extract-core.o \
31         tools/tools.o
32
33 OBJS := $(CORE_OBJS) $(TEST_OBJS)
34
35 # FIXME: write a trivial C program to do this
36 tools/ccanlint/generated-normal-tests: $(NORMAL_TEST_CFILES)
37         cat $^ | grep ^REGISTER_TEST > $@
38 tools/ccanlint/generated-compulsory-tests: $(COMPULSORY_TEST_CFILES)
39         cat $^ | grep ^REGISTER_TEST > $@
40
41 $(TEST_OBJS): tools/ccanlint/generated-normal-tests tools/ccanlint/generated-compulsory-tests
42
43 # Otherwise, ccanlint.c et al. may fail to build
44 $(CORE_OBJS): tools/ccanlint/generated-normal-tests tools/ccanlint/generated-compulsory-tests config.h
45
46 tools/ccanlint/ccanlint: $(OBJS)
47
48 ccanlint-clean:
49         $(RM) tools/ccanlint/generated-compulsory-tests
50         $(RM) tools/ccanlint/generated-normal-tests
51         $(RM) tools/ccanlint/ccanlint
52