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