Bump to 1.14.1
[platform/upstream/augeas.git] / Makefile.inc
1 # -*- Makefile-automake -*-
2 #
3 # Support for running programs with failmalloc preloaded. Include in other
4 # automake files and make sure the following variables are set:
5 #
6 # FAILMALLOC_START - number of first FAILMALLOC_INTERVAL
7 # FAILMALLOC_REP   - how often to repeat with increasing FAILMALLOC_INTERVAL
8 # FAILMALLOC_PROG  - the program to run with linfailmalloc preloaded
9
10 if WITH_FAILMALLOC
11 failmalloc: failmalloc-run
12 else
13 failmalloc: failmalloc-error
14 endif
15
16 failmalloc-run: $(FAILMALLOC_PROG)
17         @(echo "Running $(FAILMALLOC_PROG) with failmalloc";    \
18       for i in $$(seq $(FAILMALLOC_START) $$(expr $(FAILMALLOC_START) + $(FAILMALLOC_REP) - 1)) ; do \
19           resp=$$(libtool --mode=execute env LD_PRELOAD=$(LIBFAILMALLOC) FAILMALLOC_INTERVAL=$$i $(FAILMALLOC_PROG));        \
20           status=$$?;                                          \
21           if [ $$status -ne 0 -a $$status -ne 2 ] ;     then       \
22             printf "%5d FAIL %3d %s\n" $$i $$status "$$resp" ; \
23           elif [ x$(V) = x1 -o $$(( $$i % 100 )) -eq 0 ] ; then \
24             printf "%5d PASS %s\n" $$i "$$resp" ;              \
25           fi                                                   \
26         done)
27
28 failmalloc-error:
29         @(echo "You need to turn on failmalloc support with --with-failmalloc"; \
30           exit 1)