Makefile.am 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. #
  2. # __ __ _
  3. # ___\ \/ /_ __ __ _| |_
  4. # / _ \\ /| '_ \ / _` | __|
  5. # | __// \| |_) | (_| | |_
  6. # \___/_/\_\ .__/ \__,_|\__|
  7. # |_| XML parser
  8. #
  9. # Copyright (c) 2017-2026 Sebastian Pipping <[email protected]>
  10. # Copyright (c) 2018 KangLin <[email protected]>
  11. # Copyright (c) 2022 Johnny Jazeix <[email protected]>
  12. # Copyright (c) 2023 Sony Corporation / Snild Dolkow <[email protected]>
  13. # Copyright (c) 2024 Alexander Bluhm <[email protected]>
  14. # Copyright (c) 2024 Dag-Erling Smørgrav <[email protected]>
  15. # Licensed under the MIT license:
  16. #
  17. # Permission is hereby granted, free of charge, to any person obtaining
  18. # a copy of this software and associated documentation files (the
  19. # "Software"), to deal in the Software without restriction, including
  20. # without limitation the rights to use, copy, modify, merge, publish,
  21. # distribute, sublicense, and/or sell copies of the Software, and to permit
  22. # persons to whom the Software is furnished to do so, subject to the
  23. # following conditions:
  24. #
  25. # The above copyright notice and this permission notice shall be included
  26. # in all copies or substantial portions of the Software.
  27. #
  28. # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  29. # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  30. # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
  31. # NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  32. # DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  33. # OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
  34. # USE OR OTHER DEALINGS IN THE SOFTWARE.
  35. AUTOMAKE_OPTIONS = \
  36. dist-bzip2 \
  37. dist-lzip \
  38. dist-xz \
  39. foreign \
  40. subdir-objects
  41. ACLOCAL_AMFLAGS = -I m4
  42. LIBTOOLFLAGS = --verbose
  43. SUBDIRS = lib # lib goes first to build first
  44. if WITH_EXAMPLES
  45. SUBDIRS += examples
  46. endif
  47. if WITH_TESTS
  48. SUBDIRS += tests
  49. endif
  50. if WITH_XMLWF
  51. SUBDIRS += xmlwf doc
  52. endif
  53. pkgconfig_DATA = expat.pc
  54. pkgconfigdir = $(libdir)/pkgconfig
  55. nodist_cmake_DATA = \
  56. cmake/autotools/expat.cmake \
  57. cmake/autotools/expat-config-version.cmake \
  58. cmake/autotools/expat-noconfig.cmake \
  59. cmake/expat-config.cmake
  60. cmakedir = $(libdir)/cmake/expat-@PACKAGE_VERSION@
  61. _EXTRA_DIST_CMAKE = \
  62. cmake/autotools/expat__linux.cmake.in \
  63. cmake/autotools/expat__macos.cmake.in \
  64. cmake/autotools/expat__windows.cmake.in \
  65. cmake/autotools/expat-noconfig__linux.cmake.in \
  66. cmake/autotools/expat-noconfig__macos.cmake.in \
  67. cmake/autotools/expat-noconfig__windows.cmake.in \
  68. cmake/autotools/expat-package-init.cmake \
  69. cmake/mingw-toolchain.cmake \
  70. \
  71. CMakeLists.txt \
  72. CMake.README \
  73. ConfigureChecks.cmake \
  74. expat.pc.cmake \
  75. expat_config.h.cmake
  76. _EXTRA_DIST_WINDOWS = \
  77. win32/build_expat_iss.bat \
  78. win32/expat.iss \
  79. win32/MANIFEST.txt \
  80. win32/README.txt \
  81. win32/version.rc.cmake
  82. EXTRA_DIST = \
  83. $(_EXTRA_DIST_CMAKE) \
  84. $(_EXTRA_DIST_WINDOWS) \
  85. \
  86. conftools/get-version.sh \
  87. \
  88. fuzz/xml_lpm_fuzzer.cpp \
  89. fuzz/xml_lpm_fuzzer.proto \
  90. fuzz/xml_parsebuffer_fuzzer.c \
  91. fuzz/xml_parse_fuzzer.c \
  92. \
  93. xmlwf/xmlwf_helpgen.py \
  94. xmlwf/xmlwf_helpgen.sh \
  95. \
  96. buildconf.sh \
  97. Changes \
  98. README.md \
  99. \
  100. fix-xmltest-log.sh \
  101. test-driver-wrapper.sh
  102. .PHONY: buildlib
  103. buildlib:
  104. @echo 'ERROR: Running "make buildlib LIBRARY=libexpatw.la"' >&2
  105. @echo 'ERROR: is no longer supported. INSTEAD please:' >&2
  106. @echo 'ERROR:' >&2
  107. @echo 'ERROR: * Mass-patch Makefile.am, e.g.' >&2
  108. @echo 'ERROR: # find . -name Makefile.am -exec sed \' >&2
  109. @echo 'ERROR: -e "s,libexpat\.la,libexpatw.la," \' >&2
  110. @echo 'ERROR: -e "s,libexpat_la,libexpatw_la," \' >&2
  111. @echo 'ERROR: -i.bak {} +' >&2
  112. @echo 'ERROR:' >&2
  113. @echo 'ERROR: * Run automake to re-generate Makefile.in files' >&2
  114. @echo 'ERROR:' >&2
  115. @echo 'ERROR: * Use "./configure --without-xmlwf" and/or' >&2
  116. @echo 'ERROR: "make -C lib all install" to bypass compilation' >&2
  117. @echo 'ERROR: of xmlwf (e.g. with -DXML_UNICODE)' >&2
  118. @echo 'ERROR:' >&2
  119. @false
  120. .PHONY: run-benchmark
  121. run-benchmark:
  122. $(MAKE) -C tests/benchmark
  123. ./run.sh tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/recset.xml 65535 3
  124. ./run.sh tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/aaaaaa_attr.xml 4096 3
  125. ./run.sh tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/aaaaaa_cdata.xml 4096 3
  126. ./run.sh tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/aaaaaa_comment.xml 4096 3
  127. ./run.sh tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/aaaaaa_tag.xml 4096 3
  128. ./run.sh tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/aaaaaa_text.xml 4096 3
  129. .PHONY: download-xmlts-zip
  130. download-xmlts-zip:
  131. if test "$(XMLTS_ZIP)" = ""; then \
  132. wget --output-document=tests/xmlts.zip \
  133. https://www.w3.org/XML/Test/xmlts20080827.zip; \
  134. else \
  135. cp $(XMLTS_ZIP) tests/xmlts.zip; \
  136. fi
  137. tests/xmlts.zip:
  138. $(MAKE) download-xmlts-zip
  139. .PHONY: extract-xmlts-zip
  140. extract-xmlts-zip: tests/xmlts.zip
  141. [ -f $(builddir)/tests/xmlts.zip ] || $(MAKE) download-xmlts-zip # vpath workaround
  142. cd tests && unzip -q xmlts.zip
  143. tests/xmlconf: tests/xmlts.zip
  144. $(MAKE) extract-xmlts-zip
  145. .PHONY: run-xmltest
  146. run-xmltest: tests/xmlconf
  147. if WITH_XMLWF
  148. [ -d $(builddir)/tests/xmlconf ] || $(MAKE) extract-xmlts-zip # vpath workaround
  149. $(MAKE) -C lib
  150. $(MAKE) -C xmlwf
  151. $(srcdir)/tests/xmltest.sh "$(abs_builddir)/run.sh $(abs_builddir)/xmlwf/xmlwf@EXEEXT@" 2>&1 | tee $(builddir)/tests/xmltest.log
  152. $(srcdir)/fix-xmltest-log.sh $(builddir)/tests/xmltest.log
  153. diff -u $(srcdir)/tests/xmltest.log.expected $(builddir)/tests/xmltest.log
  154. else
  155. @echo 'ERROR: xmlwf is needed for "make run-xmltest".' >&2
  156. @echo 'ERROR: Please re-configure without --without-xmlwf.' >&2
  157. @false
  158. endif
  159. .PHONY: qa
  160. qa:
  161. QA_COMPILER=clang QA_SANITIZER=address ./qa.sh
  162. QA_COMPILER=clang QA_SANITIZER=memory ./qa.sh
  163. QA_COMPILER=clang QA_SANITIZER=undefined ./qa.sh
  164. QA_COMPILER=gcc QA_PROCESSOR=gcov ./qa.sh