Makefile 1.5 KB

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