]> git.ozlabs.org Git - ccan/blob - tools/ccanlint/Makefile
Don't run dependent tests if one fails.
[ccan] / tools / ccanlint / Makefile
1 TEST_CFILES := $(wildcard tools/ccanlint/compulsory_tests/*.c) \
2         $(wildcard tools/ccanlint/tests/*.c)
3 TEST_OBJS := $(TEST_CFILES:.c=.o)
4
5 CORE_OBJS := tools/ccanlint/ccanlint.o \
6         tools/ccanlint/file_analysis.o \
7         tools/doc_extract-core.o \
8         tools/depends.o \
9         ccan/str_talloc/str_talloc.o ccan/grab_file/grab_file.o \
10         ccan/talloc/talloc.o ccan/noerr/noerr.o
11
12 OBJS := $(CORE_OBJS) $(TEST_OBJS)
13
14 # FIXME: write a trivial C program to do this
15 tools/ccanlint/generated-init-tests: $(TEST_CFILES)
16         cat $(TEST_CFILES) | grep ^REGISTER_TEST > $@
17
18 $(TEST_OBJS): tools/ccanlint/generated-init-tests
19
20 # Otherwise, ccanlint.c et al. may fail to build
21 $(CORE_OBJS): tools/ccanlint/generated-init-tests
22
23 tools/ccanlint/ccanlint: $(OBJS)
24
25 ccanlint-clean:
26         $(RM) tools/ccanlint/generated-init-tests
27         $(RM) tools/ccanlint/ccanlint
28