]> git.ozlabs.org Git - ccan/blob - Makefile
Typesafe callback infrastructure.
[ccan] / Makefile
1 # Hacky makefile to compile everything and run the tests in some kind of sane order.
2 # V=--verbose for verbose tests.
3
4 CFLAGS=-O3 -Wall -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-declarations -Werror -I.
5
6 ALL=$(patsubst %/test, %, $(wildcard */test))
7 ALL_DEPENDS=$(patsubst %, %/.depends, $(ALL))
8
9 test-all: $(ALL_DEPENDS)
10         $(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`
11
12 distclean: clean
13         rm -f */_info
14         rm -f $(ALL_DEPENDS)
15
16 $(ALL_DEPENDS): %/.depends: %/_info
17         @$< depends > $@ || ( rm -f $@; exit 1 )
18
19 test-%: ccan_tools/run_tests
20         @echo Testing $*...
21         @if ccan_tools/run_tests $(V) $* | grep ^'not ok'; then exit 1; else exit 0; fi
22
23 clean: ccan_tools-clean
24         rm -f `find . -name '*.o'`
25
26 include ccan_tools/Makefile