f027e20af102f2ee706dba12ab453ffb7c94a34b
[ccan] / tools / ccanlint / Makefile
1 OBJS := tools/ccanlint/no_info.o \
2         tools/ccanlint/has_main_header.o \
3         tools/ccanlint/has_tests.o \
4         tools/ccanlint/trailing_whitespace.o \
5         tools/ccanlint/idempotent.o \
6
7 FUTURE:=tools/ccanlint/if_have_not_ifdef.o \
8         tools/ccanlint/needs_depends.o \
9         tools/ccanlint/has_info_documentation.o \
10         tools/ccanlint/has_header_documentation.o \
11         tools/ccanlint/has_tests.o \
12         tools/ccanlint/builds_ok.o \
13         tools/ccanlint/builds_ok_all_have_variants.o \
14         tools/ccanlint/run_tests.o \
15         tools/ccanlint/test_coverage.o \
16
17 tools/ccanlint/generated-init-tests: $(OBJS)
18         cat $(OBJS:.o=.c) | sed -n 's/^struct ccanlint \([A-Za-z0-9_]*\) = {/{ extern struct ccanlint \1; list_add(\&tests, \&\1.list); }/p' >$@
19
20 tools/ccanlint/ccanlint.o: tools/ccanlint/generated-init-tests
21
22 tools/ccanlint/ccanlint: \
23         $(OBJS)                 \
24         tools/ccanlint/ccanlint.o \
25         tools/ccanlint/file_analysis.o \
26         tools/doc_extract-core.o \
27         ccan/str_talloc/str_talloc.o ccan/grab_file/grab_file.o \
28         ccan/talloc/talloc.o ccan/noerr/noerr.o
29
30 ccanlint-clean:
31         $(RM) tools/ccanlint/generated-init-tests
32         $(RM) tools/ccanlint/ccanlint
33