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