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