Makefile 1.1 KB

1234567891011121314151617181920212223242526272829303132
  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. ccan/str_talloc/str_talloc.o ccan/grab_file/grab_file.o \
  10. ccan/talloc/talloc.o ccan/noerr/noerr.o
  11. OBJS := $(CORE_OBJS) $(TEST_OBJS)
  12. # FIXME: write a trivial C program to do this
  13. tools/ccanlint/generated-normal-tests: $(NORMAL_TEST_CFILES)
  14. cat $^ | grep ^REGISTER_TEST > $@
  15. tools/ccanlint/generated-compulsory-tests: $(COMPULSORY_TEST_CFILES)
  16. cat $^ | grep ^REGISTER_TEST > $@
  17. $(TEST_OBJS): tools/ccanlint/generated-normal-tests tools/ccanlint/generated-compulsory-tests
  18. # Otherwise, ccanlint.c et al. may fail to build
  19. $(CORE_OBJS): tools/ccanlint/generated-normal-tests tools/ccanlint/generated-compulsory-tests
  20. tools/ccanlint/ccanlint: $(OBJS)
  21. ccanlint-clean:
  22. $(RM) tools/ccanlint/generated-compulsory-tests
  23. $(RM) tools/ccanlint/generated-normal-tests
  24. $(RM) tools/ccanlint/ccanlint