Makefile.am 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452
  1. ## Process this file with automake to produce Makefile.in
  2. ACLOCAL_AMFLAGS = -I m4
  3. SUBDIRS = include . doc example fuzz xstc
  4. if WITH_PYTHON
  5. SUBDIRS += python
  6. endif
  7. DIST_SUBDIRS = include . doc example fuzz python xstc
  8. AM_CPPFLAGS = -I$(top_builddir)/include -I$(srcdir)/include -DSYSCONFDIR='"$(sysconfdir)"'
  9. AM_CFLAGS = $(EXTRA_CFLAGS)
  10. check_PROGRAMS = \
  11. runsuite \
  12. runtest \
  13. runxmlconf \
  14. testAutomata \
  15. testModule \
  16. testThreads \
  17. testapi \
  18. testchar \
  19. testdict \
  20. testlimits \
  21. testrecurse
  22. bin_PROGRAMS = xmllint xmlcatalog
  23. bin_SCRIPTS=xml2-config
  24. lib_LTLIBRARIES = libxml2.la
  25. libxml2_la_CFLAGS = $(EXTRA_CFLAGS) $(THREAD_CFLAGS) $(Z_CFLAGS) $(LZMA_CFLAGS)
  26. libxml2_la_LIBADD = $(XML_PRIVATE_LIBS)
  27. if USE_VERSION_SCRIPT
  28. LIBXML2_VERSION_SCRIPT = $(VERSION_SCRIPT_FLAGS)$(srcdir)/libxml2.syms
  29. else
  30. LIBXML2_VERSION_SCRIPT =
  31. endif
  32. libxml2_la_LDFLAGS = $(CYGWIN_EXTRA_LDFLAGS) $(WIN32_EXTRA_LDFLAGS) \
  33. $(LIBXML2_VERSION_SCRIPT) \
  34. -version-info $(LIBXML_VERSION_INFO) \
  35. $(MODULE_PLATFORM_LIBS)
  36. if WITH_TRIO_SOURCES
  37. trio_sources = triostr.c trio.c
  38. else
  39. trio_sources =
  40. endif
  41. libxml2_la_SOURCES = SAX.c entities.c encoding.c error.c parserInternals.c \
  42. parser.c tree.c hash.c list.c xmlIO.c xmlmemory.c uri.c \
  43. valid.c xlink.c HTMLparser.c HTMLtree.c debugXML.c xpath.c \
  44. xpointer.c xinclude.c nanohttp.c nanoftp.c \
  45. catalog.c globals.c threads.c c14n.c xmlstring.c buf.c \
  46. xmlregexp.c xmlschemas.c xmlschemastypes.c xmlunicode.c \
  47. $(trio_sources) \
  48. xmlreader.c relaxng.c dict.c SAX2.c \
  49. xmlwriter.c legacy.c chvalid.c pattern.c xmlsave.c \
  50. xmlmodule.c schematron.c xzlib.c
  51. DEPS = $(top_builddir)/libxml2.la
  52. LDADDS = $(top_builddir)/libxml2.la
  53. m4datadir = $(datadir)/aclocal
  54. m4data_DATA = libxml.m4
  55. runtest_SOURCES=runtest.c
  56. runtest_CFLAGS = $(EXTRA_CFLAGS) $(THREAD_CFLAGS)
  57. runtest_LDFLAGS =
  58. runtest_DEPENDENCIES = $(DEPS)
  59. runtest_LDADD= $(BASE_THREAD_LIBS) $(THREAD_LIBS) $(LDADDS)
  60. testrecurse_SOURCES=testrecurse.c
  61. testrecurse_LDFLAGS =
  62. testrecurse_DEPENDENCIES = $(DEPS)
  63. testrecurse_LDADD= $(LDADDS)
  64. testlimits_SOURCES=testlimits.c
  65. testlimits_LDFLAGS =
  66. testlimits_DEPENDENCIES = $(DEPS)
  67. testlimits_LDADD= $(LDADDS)
  68. testchar_SOURCES=testchar.c
  69. testchar_LDFLAGS =
  70. testchar_DEPENDENCIES = $(DEPS)
  71. testchar_LDADD= $(LDADDS)
  72. testdict_SOURCES=testdict.c
  73. testdict_LDFLAGS =
  74. testdict_DEPENDENCIES = $(DEPS)
  75. testdict_LDADD= $(LDADDS)
  76. runsuite_SOURCES=runsuite.c
  77. runsuite_LDFLAGS =
  78. runsuite_DEPENDENCIES = $(DEPS)
  79. runsuite_LDADD= $(LDADDS)
  80. xmllint_SOURCES=xmllint.c
  81. xmllint_LDFLAGS =
  82. xmllint_DEPENDENCIES = $(DEPS)
  83. xmllint_LDADD= $(RDL_LIBS) $(LDADDS)
  84. xmlcatalog_SOURCES=xmlcatalog.c
  85. xmlcatalog_LDFLAGS =
  86. xmlcatalog_DEPENDENCIES = $(DEPS)
  87. xmlcatalog_LDADD = $(RDL_LIBS) $(LDADDS)
  88. testThreads_SOURCES = testThreads.c
  89. testThreads_CFLAGS = $(EXTRA_CFLAGS) $(THREAD_CFLAGS)
  90. testThreads_LDFLAGS =
  91. testThreads_DEPENDENCIES = $(DEPS)
  92. testThreads_LDADD= $(BASE_THREAD_LIBS) $(THREAD_LIBS) $(LDADDS)
  93. testAutomata_SOURCES=testAutomata.c
  94. testAutomata_LDFLAGS =
  95. testAutomata_DEPENDENCIES = $(DEPS)
  96. testAutomata_LDADD= $(LDADDS)
  97. testModule_SOURCES=testModule.c
  98. testModule_LDFLAGS =
  99. testModule_DEPENDENCIES = $(DEPS)
  100. testModule_LDADD= $(LDADDS)
  101. noinst_LTLIBRARIES = testdso.la
  102. testdso_la_SOURCES = testdso.c
  103. testdso_la_LDFLAGS = -module -no-undefined -avoid-version -rpath $(libdir)
  104. # that one forces the rebuild when "make rebuild" is run on doc/
  105. rebuild_testapi:
  106. -@(if [ "$(PYTHON)" != "" ] ; then \
  107. $(PYTHON) $(srcdir)/gentest.py $(srcdir) ; fi )
  108. # that one is just to make sure it is rebuilt if missing
  109. # but adding the dependances generate mess
  110. testapi.c: $(srcdir)/gentest.py
  111. -@(if [ "$(PYTHON)" != "" ] ; then \
  112. $(PYTHON) $(srcdir)/gentest.py $(srcdir) ; fi )
  113. BUILT_SOURCES = testapi.c
  114. testapi_SOURCES=testapi.c
  115. testapi_LDFLAGS =
  116. testapi_DEPENDENCIES = $(DEPS)
  117. testapi_LDADD= $(LDADDS)
  118. runxmlconf_SOURCES=runxmlconf.c
  119. runxmlconf_LDFLAGS =
  120. runxmlconf_DEPENDENCIES = $(DEPS)
  121. runxmlconf_LDADD= $(LDADDS)
  122. #testOOM_SOURCES=testOOM.c testOOMlib.h testOOMlib.c
  123. #testOOM_LDFLAGS =
  124. #testOOM_DEPENDENCIES = $(DEPS)
  125. #testOOM_LDADD= $(LDADDS)
  126. check-local:
  127. [ -d test ] || $(LN_S) $(srcdir)/test .
  128. [ -d result ] || $(LN_S) $(srcdir)/result .
  129. $(CHECKER) ./runtest$(EXEEXT)
  130. $(CHECKER) ./testrecurse$(EXEEXT)
  131. ASAN_OPTIONS="$$ASAN_OPTIONS:detect_leaks=0" $(CHECKER) ./testapi$(EXEEXT)
  132. $(CHECKER) ./testchar$(EXEEXT)
  133. $(CHECKER) ./testdict$(EXEEXT)
  134. $(CHECKER) ./testModule$(EXEEXT)
  135. $(CHECKER) ./testThreads$(EXEEXT)
  136. $(CHECKER) ./runxmlconf$(EXEEXT)
  137. # Compatibility name of the check target
  138. runtests: check
  139. check-valgrind valgrind:
  140. @echo '## Running the regression tests under Valgrind'
  141. @echo '## Go get a cup of coffee it is gonna take a while ...'
  142. $(MAKE) CHECKER='valgrind -q' check
  143. asan:
  144. @echo '## rebuilding for ASAN'
  145. ./configure CFLAGS="-fsanitize=address,undefined -Wformat -Werror=format-security -Werror=array-bounds -g" CXXFLAGS="-fsanitize=address,undefined -Wformat -Werror=format-security -Werror=array-bounds -g" LDFLAGS="-fsanitize=address,undefined" CC="clang" CXX="clang++" --disable-shared ; OptimOff ; $(MAKE) clean ; $(MAKE)
  146. # Old test suite. This should be ported to C.
  147. tests: $(TEST_DEBUG) $(TEST_CATALOG) $(TEST_REGEXPS) $(TEST_SCHEMATRON) Timingtests $(TEST_VTIME) $(PYTHON_TESTS)
  148. Scripttests : xmllint$(EXEEXT)
  149. @(echo > .memdump)
  150. @echo "## Scripts regression tests"
  151. @echo "## Some of the base computations may be different if srcdir != ."
  152. -@(for i in $(srcdir)/test/scripts/*.script ; do \
  153. name=`basename $$i .script`; \
  154. xml=$(srcdir)/test/scripts/`basename $$i .script`.xml; \
  155. if [ -f $$xml ] ; then \
  156. if [ ! -f $(srcdir)/result/scripts/$$name ] ; then \
  157. echo New test file $$name ; \
  158. $(CHECKER) $(top_builddir)/xmllint --shell $$xml < $$i > $(srcdir)/result/scripts/$$name 2> $(srcdir)/result/scripts/$$name.err ; \
  159. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
  160. else \
  161. log=`$(CHECKER) $(top_builddir)/xmllint --shell $$xml < $$i > result.$$name 2> result.$$name.err ; \
  162. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
  163. diff $(srcdir)/result/scripts/$$name result.$$name ; \
  164. diff $(srcdir)/result/scripts/$$name.err result.$$name.err` ; \
  165. if [ -n "$$log" ] ; then echo $$name result ; echo "$$log" ; fi ; \
  166. rm result.$$name result.$$name.err ; \
  167. fi ; fi ; done)
  168. Catatests : xmlcatalog$(EXEEXT)
  169. @(echo > .memdump)
  170. @echo "## Catalog regression tests"
  171. -@(for i in $(srcdir)/test/catalogs/*.script ; do \
  172. name=`basename $$i .script`; \
  173. xml=$(srcdir)/test/catalogs/`basename $$i .script`.xml; \
  174. if [ -f $$xml ] ; then \
  175. if [ ! -f $(srcdir)/result/catalogs/$$name ] ; then \
  176. echo New test file $$name ; \
  177. $(CHECKER) $(top_builddir)/xmlcatalog --shell $$xml < $$i 2>&1 > $(srcdir)/result/catalogs/$$name ; \
  178. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
  179. else \
  180. log=`$(CHECKER) $(top_builddir)/xmlcatalog --shell $$xml < $$i 2>&1 > result.$$name ; \
  181. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
  182. diff $(srcdir)/result/catalogs/$$name result.$$name` ; \
  183. if [ -n "$$log" ] ; then echo $$name result ; echo "$$log" ; fi ; \
  184. rm result.$$name ; \
  185. fi ; fi ; done)
  186. -@(for i in $(srcdir)/test/catalogs/*.script ; do \
  187. name=`basename $$i .script`; \
  188. sgml=$(srcdir)/test/catalogs/`basename $$i .script`.sgml; \
  189. if [ -f $$sgml ] ; then \
  190. if [ ! -f $(srcdir)/result/catalogs/$$name ] ; then \
  191. echo New test file $$name ; \
  192. $(CHECKER) $(top_builddir)/xmlcatalog --shell $$sgml < $$i > $(srcdir)/result/catalogs/$$name ; \
  193. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
  194. else \
  195. log=`$(CHECKER) $(top_builddir)/xmlcatalog --shell $$sgml < $$i > result.$$name ; \
  196. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
  197. diff $(srcdir)/result/catalogs/$$name result.$$name` ; \
  198. if [ -n "$$log" ] ; then echo $$name result ; echo "$$log" ; fi ; \
  199. rm result.$$name ; \
  200. fi ; fi ; done)
  201. @echo "## Add and del operations on XML Catalogs"
  202. -@($(CHECKER) $(top_builddir)/xmlcatalog --create --noout $(srcdir)/result/catalogs/mycatalog; \
  203. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
  204. $(CHECKER) $(top_builddir)/xmlcatalog --noout --add public Pubid sysid $(srcdir)/result/catalogs/mycatalog; \
  205. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
  206. $(CHECKER) $(top_builddir)/xmlcatalog --noout --add public Pubid2 sysid2 $(srcdir)/result/catalogs/mycatalog; \
  207. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
  208. $(CHECKER) $(top_builddir)/xmlcatalog --noout --add public Pubid3 sysid3 $(srcdir)/result/catalogs/mycatalog; \
  209. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
  210. diff result/catalogs/mycatalog.full $(srcdir)/result/catalogs/mycatalog; \
  211. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
  212. $(CHECKER) $(top_builddir)/xmlcatalog --noout --del sysid $(srcdir)/result/catalogs/mycatalog; \
  213. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
  214. $(CHECKER) $(top_builddir)/xmlcatalog --noout --del sysid3 $(srcdir)/result/catalogs/mycatalog; \
  215. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
  216. $(CHECKER) $(top_builddir)/xmlcatalog --noout --del sysid2 $(srcdir)/result/catalogs/mycatalog; \
  217. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
  218. diff result/catalogs/mycatalog.empty $(srcdir)/result/catalogs/mycatalog; \
  219. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
  220. rm -f $(srcdir)/result/catalogs/mycatalog)
  221. Automatatests: testAutomata$(EXEEXT)
  222. @(echo > .memdump)
  223. @echo "## Automata regression tests"
  224. -@(for i in $(srcdir)/test/automata/* ; do \
  225. name=`basename $$i`; \
  226. if [ ! -d $$i ] ; then \
  227. if [ ! -f $(srcdir)/result/automata/$$name ] ; then \
  228. echo New test file $$name ; \
  229. $(CHECKER) $(top_builddir)/testAutomata $$i > $(srcdir)/result/automata/$$name; \
  230. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
  231. else \
  232. log=`$(CHECKER) $(top_builddir)/testAutomata $$i 2>&1 > result.$$name ; \
  233. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
  234. diff $(srcdir)/result/automata/$$name result.$$name` ; \
  235. if [ -n "$$log" ] ; then echo $$name result ; echo "$$log" ; fi ; \
  236. rm result.$$name ; \
  237. fi ; fi ; done)
  238. dba100000.xml: dbgenattr.pl
  239. @echo "## generating dba100000.xml"
  240. @($(PERL) $(top_srcdir)/dbgenattr.pl 100000 > dba100000.xml)
  241. Timingtests: xmllint$(EXEEXT) dba100000.xml
  242. @echo "## Timing tests to try to detect performance"
  243. @echo "## as well a memory usage breakage when streaming"
  244. @echo "## 1/ using the file interface"
  245. @echo "## 2/ using the memory interface"
  246. @echo "## 3/ repeated DOM parsing"
  247. @echo "## 4/ repeated DOM validation"
  248. -@($(top_builddir)/xmllint --stream --timing dba100000.xml; \
  249. MEM=`cat .memdump | grep "MEMORY ALLOCATED" | awk '{ print $$7}'`;\
  250. if [ "$$MEM" != "" ] ; then echo Using $$MEM bytes ; fi ; \
  251. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
  252. exit 0)
  253. -@($(top_builddir)/xmllint --stream --timing --memory dba100000.xml; \
  254. MEM=`cat .memdump | grep "MEMORY ALLOCATED" | awk '{ print $$7}'`;\
  255. if [ "$$MEM" != "" ] ; then echo Using $$MEM bytes ; fi ; \
  256. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
  257. exit 0)
  258. -@($(top_builddir)/xmllint --noout --timing --repeat $(srcdir)/test/valid/REC-xml-19980210.xml; \
  259. MEM=`cat .memdump | grep "MEMORY ALLOCATED" | awk '{ print $$7}'`;\
  260. if [ "$$MEM" != "" ] ; then echo Using $$MEM bytes ; fi ; \
  261. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
  262. exit 0)
  263. VTimingtests: xmllint$(EXEEXT)
  264. -@($(top_builddir)/xmllint --noout --timing --valid --repeat $(srcdir)/test/valid/REC-xml-19980210.xml; \
  265. MEM=`cat .memdump | grep "MEMORY ALLOCATED" | awk '{ print $$7}'`;\
  266. if [ "$$MEM" != "" ] ; then echo Using $$MEM bytes ; fi ; \
  267. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
  268. exit 0)
  269. Schematrontests: xmllint$(EXEEXT)
  270. @(echo > .memdump)
  271. @echo "## Schematron regression tests"
  272. -@(for i in $(srcdir)/test/schematron/*.sct ; do \
  273. name=`basename $$i | sed 's+\.sct++'`; \
  274. for j in $(srcdir)/test/schematron/"$$name"_*.xml ; do \
  275. if [ -f $$j ] ; then \
  276. xno=`basename $$j | sed 's+.*_\(.*\).xml+\1+'`; \
  277. if [ ! -f $(srcdir)/result/schematron/"$$name"_"$$xno" ]; \
  278. then \
  279. echo New test file "$$name"_"$$xno" ; \
  280. $(CHECKER) $(top_builddir)/xmllint$(EXEEXT) --schematron $$i $$j \
  281. > $(srcdir)/result/schematron/"$$name"_"$$xno" \
  282. 2> $(srcdir)/result/schematron/"$$name"_"$$xno".err; \
  283. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
  284. else \
  285. log=`$(CHECKER) $(top_builddir)/xmllint$(EXEEXT) --schematron $$i $$j \
  286. > res.$$name 2> err.$$name;\
  287. grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0";\
  288. diff $(srcdir)/result/schematron/"$$name"_"$$xno" \
  289. res.$$name;\
  290. diff $(srcdir)/result/schematron/"$$name"_"$$xno".err \
  291. err.$$name | grep -v "error detected at";\
  292. grep Unimplemented err.$$name`; \
  293. if [ -n "$$log" ] ; then echo "$$name"_"$$xno" result ; echo "$$log" ; fi ; \
  294. rm res.$$name err.$$name ; \
  295. fi ; fi ; \
  296. done; done)
  297. RelaxNGPythonTests:
  298. @(if [ -x $(PYTHON) ] ; then \
  299. PYTHONPATH=$(top_builddir)/python:$(top_builddir)/python/.libs:$$PYTHONPATH ; \
  300. export PYTHONPATH; \
  301. LD_LIBRARY_PATH="$(top_builddir)/.libs:$$LD_LIBRARY_PATH" ; \
  302. export LD_LIBRARY_PATH; \
  303. echo "## Relax-NG Python based test suite 1" ; \
  304. $(CHECKER) $(PYTHON) $(srcdir)/check-relaxng-test-suite.py ; \
  305. echo "## Relax-NG Python based test suite 2" ; \
  306. $(CHECKER) $(PYTHON) $(srcdir)/check-relaxng-test-suite2.py ; \
  307. fi)
  308. SchemasPythonTests:
  309. @(if [ -x $(PYTHON) ] ; then \
  310. PYTHONPATH=$(top_builddir)/python:$(top_builddir)/python/.libs:$$PYTHONPATH; \
  311. export PYTHONPATH; \
  312. LD_LIBRARY_PATH="$(top_builddir)/.libs:$$LD_LIBRARY_PATH" ; \
  313. export LD_LIBRARY_PATH; \
  314. echo "## XML Schemas datatypes Python based test suite" ; \
  315. echo "## It is normal to see 11 errors reported" ; \
  316. $(CHECKER) $(PYTHON) $(srcdir)/check-xsddata-test-suite.py ; \
  317. fi)
  318. @(if [ -x $(PYTHON) -a -d xstc ] ; then cd xstc ; $(MAKE) CHECKER="$(CHECKER)" pytests ; fi)
  319. cleanup:
  320. -@(find . -name .\#\* -exec rm {} \;)
  321. -@(find . -name \*.gcda -o -name \*.gcno -exec rm -f {} \;)
  322. -@(find . -name \*.orig -o -name \*.rej -o -name \*.old -exec rm -f {} \;)
  323. dist-hook: cleanup libxml2.spec
  324. -cp libxml2.spec $(distdir)
  325. (cd $(srcdir) ; tar -cf - --exclude .git win32 os400 vms test result) | (cd $(distdir); tar xf -)
  326. dist-source: distdir
  327. $(AMTAR) -chof - --exclude Tests --exclude test --exclude result $(distdir) | GZIP=$(GZIP_ENV) gzip -c >`echo "$(distdir)" | sed "s+libxml2+libxml2-sources+"`.tar.gz
  328. dist-test: distdir
  329. (mkdir -p $(distdir))
  330. (cd $(srcdir) ; tar -cf - --exclude .git xstc/Tests) | (cd $(distdir); tar xf -)
  331. tar -cf - $(distdir)/test $(distdir)/result $(distdir)/xstc/Tests $(distdir)/Makefile.tests $(distdir)/README.md $(distdir)/README.tests $(distdir)/testapi.c $(distdir)/runtest.c $(distdir)/runsuite.c | GZIP=$(GZIP_ENV) gzip -c >`echo "$(distdir)" | sed "s+libxml2+libxml2-tests+"`.tar.gz
  332. @(rm -rf $(distdir)/xstc/Test)
  333. cleantar:
  334. @(rm -f libxml*.tar.gz COPYING.LIB)
  335. rpm: cleanup cleantar
  336. @(unset CDPATH ; $(MAKE) dist-source dist && rpmbuild -ta $(distdir).tar.gz)
  337. CLEANFILES = runxmlconf.log test.out *.gcda *.gcno *.res
  338. DISTCLEANFILES = COPYING missing.lst
  339. EXTRA_DIST = xml2-config.in libxml.spec.in libxml2.spec \
  340. libxml.m4 Copyright check-xml-test-suite.py gentest.py \
  341. check-relaxng-test-suite.py check-relaxng-test-suite2.py \
  342. check-xsddata-test-suite.py check-xinclude-test-suite.py \
  343. example/Makefile.am example/gjobread.c example/gjobs.xml \
  344. libxml-2.0.pc.in libxml-2.0-uninstalled.pc.in \
  345. libxml2-config.cmake.in autogen.sh \
  346. trionan.c trionan.h triostr.c triostr.h trio.c trio.h \
  347. triop.h triodef.h libxml.h xzlib.h buf.h \
  348. enc.h save.h genUnicode.py TODO_SCHEMAS \
  349. dbgen.pl dbgenattr.pl \
  350. README.tests Makefile.tests libxml2.syms timsort.h \
  351. README.zOS README.md \
  352. CMakeLists.txt config.h.cmake.in libxml2-config.cmake.cmake.in
  353. pkgconfigdir = $(libdir)/pkgconfig
  354. pkgconfig_DATA = libxml-2.0.pc
  355. cmakedir = $(libdir)/cmake/libxml2
  356. cmake_DATA = libxml2-config.cmake
  357. #
  358. # Install the tests program sources as examples
  359. #
  360. examplesdir = $(docdir)/examples
  361. examples_DATA = xmllint.c
  362. tst: tst.c
  363. $(CC) $(CFLAGS) -Iinclude -o tst tst.c .libs/libxml2.a -lpthread -lm -lz -llzma
  364. sparse: clean
  365. $(MAKE) CC=cgcc
  366. #
  367. # Coverage support, largely borrowed from libvirt
  368. # Both binaries comes from the lcov package in Fedora
  369. #
  370. LCOV = /usr/bin/lcov
  371. GENHTML = /usr/bin/genhtml
  372. cov: clean-cov
  373. if [ "`echo $(LDFLAGS) | grep coverage`" = "" ] ; then \
  374. echo not configured with coverage; exit 1 ; fi
  375. if [ ! -x $(LCOV) -o ! -x $(GENHTML) ] ; then \
  376. echo Need $(LCOV) and $(GENHTML) excecutables; exit 1 ; fi
  377. -@($(MAKE) check)
  378. -@(./runsuite$(EXEEXT))
  379. mkdir $(top_builddir)/coverage
  380. $(LCOV) -c -o $(top_builddir)/coverage/libxml2.info.tmp -d $(top_srcdir)
  381. $(LCOV) -r $(top_builddir)/coverage/libxml2.info.tmp -o $(top_builddir)/coverage/libxml2.info *usr*
  382. rm $(top_builddir)/coverage/libxml2.info.tmp
  383. $(GENHTML) -s -t "libxml2" -o $(top_builddir)/coverage --legend $(top_builddir)/coverage/libxml2.info
  384. echo "Coverage report is in $(top_builddir)/coverage/index.html"
  385. clean-cov:
  386. rm -rf $(top_builddir)/coverage