X-Git-Url: https://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=tools%2Fccanlint%2FMakefile;h=043c3fd2c7d17b82063350fa7c0fb52a67ee789e;hp=cd507e5d08d8237ba06b0c138a85c39dd39d25c4;hb=b55c668069884a1dd0078fb7598c7371ce6c98a9;hpb=8f61c0bccb152b2365baf70deac1e59264d7feb7 diff --git a/tools/ccanlint/Makefile b/tools/ccanlint/Makefile index cd507e5d..043c3fd2 100644 --- a/tools/ccanlint/Makefile +++ b/tools/ccanlint/Makefile @@ -1,23 +1,41 @@ -TEST_CFILES := $(wildcard tools/ccanlint/compulsory_tests/*.c) \ - $(wildcard tools/ccanlint/tests/*.c) -TEST_OBJS := $(TEST_CFILES:.c=.o) +COMPULSORY_TEST_CFILES := $(wildcard tools/ccanlint/compulsory_tests/*.c) +NORMAL_TEST_CFILES := $(wildcard tools/ccanlint/tests/*.c) +TEST_OBJS := $(NORMAL_TEST_CFILES:.c=.o) $(COMPULSORY_TEST_CFILES:.c=.o) CORE_OBJS := tools/ccanlint/ccanlint.o \ tools/ccanlint/file_analysis.o \ tools/doc_extract-core.o \ + tools/depends.o \ + tools/tools.o \ + tools/compile.o \ ccan/str_talloc/str_talloc.o ccan/grab_file/grab_file.o \ - ccan/talloc/talloc.o ccan/noerr/noerr.o + ccan/str/str.o \ + ccan/asort/asort.o \ + ccan/btree/btree.o \ + ccan/talloc/talloc.o ccan/noerr/noerr.o \ + ccan/talloc_link/talloc_link.o ccan/noerr/noerr.o \ + ccan/foreach/foreach.o \ + ccan/hash/hash.o ccan/htable/htable.o \ + ccan/read_write_all/read_write_all.o \ + ccan/opt/opt.o ccan/opt/usage.o ccan/opt/helpers.o ccan/opt/parse.o OBJS := $(CORE_OBJS) $(TEST_OBJS) -tools/ccanlint/generated-init-tests: $(OBJS) - cat $(OBJS:.o=.c) | sed -n 's/^struct ccanlint \([A-Za-z0-9_]*\) = {/{ extern struct ccanlint \1; list_add(\&tests, \&\1.list); }/p' >$@ +# FIXME: write a trivial C program to do this +tools/ccanlint/generated-normal-tests: $(NORMAL_TEST_CFILES) + cat $^ | grep ^REGISTER_TEST > $@ +tools/ccanlint/generated-compulsory-tests: $(COMPULSORY_TEST_CFILES) + cat $^ | grep ^REGISTER_TEST > $@ -tools/ccanlint/ccanlint.o: tools/ccanlint/generated-init-tests +$(TEST_OBJS): tools/ccanlint/generated-normal-tests tools/ccanlint/generated-compulsory-tests + +# Otherwise, ccanlint.c et al. may fail to build +$(CORE_OBJS): tools/ccanlint/generated-normal-tests tools/ccanlint/generated-compulsory-tests config.h tools/ccanlint/ccanlint: $(OBJS) ccanlint-clean: - $(RM) tools/ccanlint/generated-init-tests + $(RM) tools/ccanlint/generated-compulsory-tests + $(RM) tools/ccanlint/generated-normal-tests $(RM) tools/ccanlint/ccanlint