X-Git-Url: https://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=Makefile;h=2e12ce83cbe4cc10897d29f8f88cedaec9f29cca;hp=a8a6103ae9cdf88f1975dfde2799e649a0cc5b53;hb=53edefb8b2de84c873f8ecc35b61003d559b18dd;hpb=fdfcdafbfa7957b6ca393bb4000fbaad3813a61a;ds=inline diff --git a/Makefile b/Makefile index a8a6103a..2e12ce83 100644 --- a/Makefile +++ b/Makefile @@ -1,23 +1,26 @@ +# Hacky makefile to compile everything and run the tests in some kind of sane order. +# V=--verbose for verbose tests. + CFLAGS=-O3 -Wall -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-declarations -Werror -I. ALL=$(patsubst %/test, %, $(wildcard */test)) ALL_DEPENDS=$(patsubst %, %/.depends, $(ALL)) -default: test-all - test-all: $(ALL_DEPENDS) - @$(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` + $(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` + +distclean: clean + rm -f */_info + rm -f $(ALL_DEPENDS) $(ALL_DEPENDS): %/.depends: %/_info @$< depends > $@ || ( rm -f $@; exit 1 ) -test-%: FORCE run_tests +test-%: ccan_tools/run_tests @echo Testing $*... - @if ./run_tests $* | grep ^'not ok'; then exit 1; else exit 0; fi - -FORCE: + @if ccan_tools/run_tests $(V) $* | grep ^'not ok'; then exit 1; else exit 0; fi -run_tests: run_tests.o tap/tap.o talloc/talloc.o +clean: ccan_tools-clean + rm -f `find . -name '*.o'` -clean: - rm -f run_tests run_tests.o +include ccan_tools/Makefile