Makefile 673 B

1234567891011121314151617181920212223
  1. CFLAGS=-O3 -Wall -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-declarations -Werror -I.
  2. ALL=$(patsubst %/test, %, $(wildcard */test))
  3. ALL_DEPENDS=$(patsubst %, %/.depends, $(ALL))
  4. default: test-all
  5. test-all: $(ALL_DEPENDS)
  6. @$(MAKE) `for f in $(ALL); do echo test-$$f test-$$f; while read d; do echo test-$$d test-$$f; done < $$f/.depends; done | tsort`
  7. $(ALL_DEPENDS): %/.depends: %/_info
  8. @$< depends > $@ || ( rm -f $@; exit 1 )
  9. test-%: FORCE run_tests
  10. @echo Testing $*...
  11. @if ./run_tests $* | grep ^'not ok'; then exit 1; else exit 0; fi
  12. FORCE:
  13. run_tests: run_tests.o tap/tap.o talloc/talloc.o
  14. clean:
  15. rm -f run_tests run_tests.o