1 # BEGIN: Variables to change.
3 # any additional includes to add to the compile lines
7 # any additional files to add to the distribution
11 # any additional files to clean up with 'make clean'
15 # any additional files to clean up with 'make maintainer-clean'
17 mymaintainercleanfiles =
19 # list of test programs, in dependency order
23 # list of test scripts, in dependency order
27 # END: Variables to change
28 # past here, hopefully, there is no need to edit anything
30 INCLUDES = -I../src ${myincludes}
32 check_PROGRAMS = ${mytests}
34 check_SCRIPTS = ${myscripttests}
36 # globally added to all instances of valgrind calls
37 VALGRIND_OPTS = ${myextravalgrindopts}
39 # globally added to all memcheck calls
40 VALGRIND_MEM_OPTS = --tool=memcheck \
42 ${myextravalgrindmemopts}
44 # globally added to all leakcheck calls
45 VALGRIND_LEAK_OPTS = --tool=memcheck \
48 --leak-resolution=high \
49 --show-reachable=yes \
50 ${myextravalgrindleakopts}
52 memcheck: $(check_PROGRAMS)
53 @for x in $(check_PROGRAMS); \
55 $(MAKE) memcheck-$$x; \
58 leakcheck: $(check_PROGRAMS)
59 @for x in $(check_PROGRAMS); \
61 $(MAKE) leakcheck-$$x; \
65 @echo "*****************************************"; \
66 echo "MEMCHECK: $<"; \
67 echo "ARGS: ${VALGRIND_OPTS} ${VALGRIND_MEM_OPTS} ${$<_VALGRIND_MEM_OPTS}";\
68 $(LIBTOOL) --mode=execute \
71 ${VALGRIND_MEM_OPTS} \
72 ${$<_VALGRIND_MEM_OPTS} ./$<
75 @echo "*****************************************"; \
76 echo "LEAKCHECK: $<"; \
77 echo "ARGS: ${VALGRIND_OPTS} ${VALGRIND_LEAK_OPTS} ${$<_VALGRIND_LEAK_OPTS}"; \
78 $(LIBTOOL) --mode=execute \
81 ${VALGRIND_LEAK_OPTS} \
82 ${$<_VALGRIND_LEAK_OPTS} ./$<
84 # NB: TESTS are ordered in dependency order
86 TESTS = $(patsubst %, testwrapper-%, ${mytests}) ${myscripttests}
88 testwrapper-%: % test-wrapper.sh test-wrapper.sh.in
89 @ln -sf test-wrapper.sh $@
90 @chmod +x test-wrapper.sh
106 MAINTAINERCLEANFILES = \
109 ${mymaintainercleanfiles}
111 # Tell make to ignore these any files that match these targets.
112 .PHONY: memcheck leakcheck
114 # .BEGIN is ignored by GNU make so we can use it as a guard
116 @echo "error: GNU Make is required, try aliasing gmake to make"