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