Makefile 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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. CORE_OBJS := tools/ccanlint/ccanlint.o \
  5. tools/ccanlint/file_analysis.o \
  6. tools/ccanlint/licenses.o \
  7. tools/doc_extract-core.o \
  8. tools/depends.o \
  9. tools/tools.o \
  10. tools/compile.o \
  11. ccan/str_talloc/str_talloc.o ccan/grab_file/grab_file.o \
  12. ccan/str/str.o ccan/str/debug.o \
  13. ccan/asort/asort.o \
  14. ccan/btree/btree.o \
  15. ccan/talloc/talloc.o ccan/noerr/noerr.o \
  16. ccan/talloc_link/talloc_link.o ccan/noerr/noerr.o \
  17. ccan/foreach/foreach.o \
  18. ccan/hash/hash.o ccan/htable/htable.o \
  19. ccan/read_write_all/read_write_all.o \
  20. ccan/opt/opt.o ccan/opt/usage.o ccan/opt/helpers.o ccan/opt/parse.o
  21. OBJS := $(CORE_OBJS) $(TEST_OBJS)
  22. # FIXME: write a trivial C program to do this
  23. tools/ccanlint/generated-normal-tests: $(NORMAL_TEST_CFILES)
  24. cat $^ | grep ^REGISTER_TEST > $@
  25. tools/ccanlint/generated-compulsory-tests: $(COMPULSORY_TEST_CFILES)
  26. cat $^ | grep ^REGISTER_TEST > $@
  27. $(TEST_OBJS): tools/ccanlint/generated-normal-tests tools/ccanlint/generated-compulsory-tests
  28. # Otherwise, ccanlint.c et al. may fail to build
  29. $(CORE_OBJS): tools/ccanlint/generated-normal-tests tools/ccanlint/generated-compulsory-tests config.h
  30. tools/ccanlint/ccanlint: $(OBJS)
  31. ccanlint-clean:
  32. $(RM) tools/ccanlint/generated-compulsory-tests
  33. $(RM) tools/ccanlint/generated-normal-tests
  34. $(RM) tools/ccanlint/ccanlint