]> git.ozlabs.org Git - ccan/blob - Makefile
a8a6103ae9cdf88f1975dfde2799e649a0cc5b53
[ccan] / Makefile
1 CFLAGS=-O3 -Wall -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-declarations -Werror -I.
2
3 ALL=$(patsubst %/test, %, $(wildcard */test))
4 ALL_DEPENDS=$(patsubst %, %/.depends, $(ALL))
5
6 default: test-all
7
8 test-all: $(ALL_DEPENDS)
9         @$(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`
10
11 $(ALL_DEPENDS): %/.depends: %/_info
12         @$< depends > $@ || ( rm -f $@; exit 1 )
13
14 test-%: FORCE run_tests
15         @echo Testing $*...
16         @if ./run_tests $* | grep ^'not ok'; then exit 1; else exit 0; fi
17
18 FORCE:
19
20 run_tests: run_tests.o tap/tap.o talloc/talloc.o 
21
22 clean:
23         rm -f run_tests run_tests.o