Makefile 1.3 KB

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