1AM_CPPFLAGS = -I$(top_builddir)/include -I$(top_srcdir)/include 2LDADD = $(top_builddir)/libxml2.la 3 4CLEANFILES = *.tmp 5 6rebuild: 7 cd $(srcdir) && $(PYTHON) index.py 8 $(MAKE) Makefile 9 cd $(srcdir) && xsltproc examples.xsl examples.xml 10 -cd $(srcdir) && xmllint --valid --noout index.html 11 12.PHONY: rebuild 13 14install-data-local: 15 $(MKDIR_P) $(DESTDIR)$(docdir)/examples 16 -$(INSTALL) -m 0644 $(srcdir)/*.html $(srcdir)/*.c $(DESTDIR)$(docdir)/examples/ 17 18uninstall-local: 19 rm -f $(DESTDIR)$(docdir)/examples/*.c 20 rm -f $(DESTDIR)$(docdir)/examples/*.html 21 -rmdir $(DESTDIR)$(docdir)/examples 22 23clean-local: 24 test -f Makefile.am || rm -f test?.xml 25 rm -f .memdump 26 27EXTRA_DIST = \ 28 examples.xml \ 29 examples.xsl \ 30 index.html \ 31 index.py \ 32 test1.xml \ 33 test2.xml \ 34 test3.xml 35 36check_PROGRAMS = \ 37 io1 \ 38 io2 \ 39 parse1 \ 40 parse2 \ 41 parse3 \ 42 parse4 \ 43 reader1 \ 44 reader2 \ 45 reader3 \ 46 reader4 \ 47 testWriter \ 48 tree1 \ 49 tree2 \ 50 xpath1 \ 51 xpath2 52 53io1_SOURCES = io1.c 54 55io2_SOURCES = io2.c 56 57parse1_SOURCES = parse1.c 58 59parse2_SOURCES = parse2.c 60 61parse3_SOURCES = parse3.c 62 63parse4_SOURCES = parse4.c 64 65reader1_SOURCES = reader1.c 66 67reader2_SOURCES = reader2.c 68 69reader3_SOURCES = reader3.c 70 71reader4_SOURCES = reader4.c 72 73testWriter_SOURCES = testWriter.c 74 75tree1_SOURCES = tree1.c 76 77tree2_SOURCES = tree2.c 78 79xpath1_SOURCES = xpath1.c 80 81xpath2_SOURCES = xpath2.c 82 83valgrind: 84 $(MAKE) CHECKER='valgrind' check 85 86check-local: 87 @test -f Makefile.am || test -f test1.xml || $(LN_S) $(srcdir)/test?.xml . 88 @(echo '## examples regression tests') 89 @(echo > .memdump) 90 @$(CHECKER) ./io1 >/dev/null 91 @grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0 92 @$(CHECKER) ./io2 >/dev/null 93 @grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0 94 @$(CHECKER) ./parse1 test1.xml 95 @grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0 96 @$(CHECKER) ./parse2 test2.xml 97 @grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0 98 @$(CHECKER) ./parse3 99 @grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0 100 @$(CHECKER) ./parse4 test3.xml 101 @grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0 102 @$(CHECKER) ./reader1 test2.xml >/dev/null 103 @grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0 104 @$(CHECKER) ./reader2 test2.xml >/dev/null 105 @grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0 106 @$(CHECKER) ./reader3 >/dev/null 107 @grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0 108 @$(CHECKER) ./reader4 test1.xml test2.xml test3.xml >/dev/null 109 @grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0 110 @$(CHECKER) ./testWriter 111 @grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0 112 @$(CHECKER) ./tree1 test2.xml >/dev/null 113 @grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0 114 @$(CHECKER) ./tree2 >/dev/null 115 @grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0 116 @$(CHECKER) ./xpath1 test3.xml '//child2' >/dev/null 117 @grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0 118 @$(CHECKER) ./xpath2 test3.xml '//discarded' discarded >/dev/null 119 @grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0" ; exit 0 120 @rm -f *.tmp 121