1
2EXTRA_DIST = README.md
3SUBDIRS = doc src bin tests
4
5pkgconfigdir = $(libdir)/pkgconfig
6pkgconfig_DATA = mustache.pc
7
8ACLOCAL_AMFLAGS = -I m4
9
10
11standard: all
12	./bin/mustache -e -t tests/fixtures/standard.mustache -d tests/fixtures/standard.yml
13
14standardc: all
15	./bin/mustache -c -t tests/fixtures/standard.mustache -o tests/fixtures/standard.bin
16
17standardr: all
18	./bin/mustache -c -r -t tests/fixtures/complex.mustache -o tests/fixtures/standard.log
19	cat tests/fixtures/standard.log
20
21standardce: all standardc
22	./bin/mustache -e -t tests/fixtures/standard.bin -d tests/fixtures/standard.yml
23
24standardcr: all standardc
25	./bin/mustache -p -t tests/fixtures/standard.bin -r
26
27complexc: all
28	./bin/mustache -c -t tests/fixtures/complex.mustache -o tests/fixtures/complex.bin
29
30complexr: all
31	./bin/mustache -c -r -t tests/fixtures/complex.mustache -o tests/fixtures/complex.log
32	cat tests/fixtures/complex.log
33
34complexce: all complexc
35	./bin/mustache -e -t tests/fixtures/complex.bin -d tests/fixtures/complex.yml
36
37deepc: all
38	./bin/mustache -c -t tests/fixtures/deep.mustache -o tests/fixtures/deep.bin
39
40deepr: all
41	./bin/mustache -c -r -t tests/fixtures/deep.mustache -o tests/fixtures/deep.log
42	cat tests/fixtures/deep.log
43
44deepce: all deepc
45	./bin/mustache -e -t tests/fixtures/deep.bin -d tests/fixtures/deep.yml
46
47if GCC
48# These flags are gcc specific
49export AM_CFLAGS = -Wall -Wextra -Wdeclaration-after-statement
50endif
51
52test: all check
53
54# Coverage
55if GCOV
56clean-local:: gcov-clean lcov-clean
57
58coverage-init:
59	lcov --directory . --zerocounters -q
60
61coverage-main:
62	lcov --capture --compat-libtool --directory . --output-file libmustache_test.info
63	lcov --remove libmustache_test.info "/usr*" --compat-libtool --output-file libmustache_test.info
64	genhtml -o test_coverage -t "libmustache test coverage" --num-spaces 4 libmustache_test.info
65
66coverage: all coverage-init test coverage-main
67
68gcov-clean:
69	find . -name '*.gcda' -delete
70	find . -name '*.gcno' -delete
71
72lcov-clean:
73	rm -rf test_coverage
74	rm -f libmustache_test.info
75endif
76
77# profile
78if GPROF
79clean-local:: profile-clean
80
81profile: test
82	rm tests/gmon.out
83	EXEC_NUM=10000 tests/spec/test_spec spec/specs
84	gprof tests/spec/test_spec gmon.out > gprof.out
85
86profile-clean:
87	find . -name 'gmon.out' -delete
88	find . -name 'gprof.out' -delete
89endif
90