1
2if COND_GCOV
3MAYBE_COVERAGE = --coverage
4endif
5
6CLEANFILES = *.gcno *.gcda *.gcov
7
8bin_PROGRAMS = seq2gif
9seq2gif_SOURCES = main.c util.c pseudo.c terminal.c function.c \
10				  dcs.c parse.c gifsave89.c \
11				  malloc_stub.c wcwidth.c \
12				  util.h pseudo.h terminal.h function.h \
13				  dcs.h parse.h gifsave89.h \
14				  wcwidth.h malloc_stub.h
15seq2gif_CFLAGS = $(MAYBE_COVERAGE)
16
17test: all
18	./seq2gif -i tests/data/sl.tty -o /dev/null
19
20coveralls: test
21	coveralls -E '.*\.h' -e tests -e glyph -e m4
22
23valgrind: all
24	valgrind --leak-check=full --show-reachable=no --error-limit=no ./seq2gif -i tests/data/sl.tty -o /dev/null 2>&1 \
25        | grep ^== \
26        | tee valgrind.log
27	grep "All heap blocks were freed" valgrind.log || grep "definitely lost: 0 bytes in 0 blocks" valgrind.log
28	grep "All heap blocks were freed" valgrind.log || grep "indirectly lost: 0 bytes in 0 blocks" valgrind.log
29	test ! $$(grep Invalid valgrind.log)
30