]> git.ozlabs.org Git - ccan/blob - Makefile
Fork support.
[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 -Iccan -I.
5
6 ALL=$(patsubst ccan/%/test, ccan/%, $(wildcard ccan/*/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 tools/run_tests $(V) ccan/$* | grep ^'not ok'; then exit 1; else exit 0; fi
22
23 ccanlint: tools/ccanlint/ccanlint
24
25 clean: tools-clean
26         rm -f `find . -name '*.o'` `find . -name '.depends'`
27
28 include tools/Makefile