blob: 5e1d37dd1a830b8feb05e5f20389381191d560b0 [file] [log] [blame]
Elliott Hughes72472942018-01-10 08:36:10 -08001#
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
31AUTOMAKE_OPTIONS = \
32 dist-bzip2 \
Haibo Huangfd5e81a2019-06-20 12:09:36 -070033 dist-lzip \
34 dist-xz \
Elliott Hughes72472942018-01-10 08:36:10 -080035 foreign \
Elliott Hughes72472942018-01-10 08:36:10 -080036 subdir-objects
37
38ACLOCAL_AMFLAGS = -I m4
39LIBTOOLFLAGS = --verbose
40
Haibo Huangfd5e81a2019-06-20 12:09:36 -070041SUBDIRS = lib # lib goes first to build first
42if WITH_EXAMPLES
43SUBDIRS += examples
44endif
45if WITH_TESTS
46SUBDIRS += tests
47endif
Elliott Hughes72472942018-01-10 08:36:10 -080048if WITH_XMLWF
49SUBDIRS += xmlwf doc
50endif
51
52pkgconfig_DATA = expat.pc
53pkgconfigdir = $(libdir)/pkgconfig
54
55
56_EXTRA_DIST_CMAKE = \
Haibo Huang40a71912019-10-11 11:13:39 -070057 cmake/expat-config.cmake.in \
58 cmake/mingw-toolchain.cmake \
59 \
Elliott Hughes72472942018-01-10 08:36:10 -080060 CMakeLists.txt \
61 CMake.README \
62 ConfigureChecks.cmake \
63 expat_config.h.cmake
64
65_EXTRA_DIST_WINDOWS = \
Haibo Huang40a71912019-10-11 11:13:39 -070066 win32/build_expat_iss.bat \
Elliott Hughes72472942018-01-10 08:36:10 -080067 win32/expat.iss \
68 win32/MANIFEST.txt \
Haibo Huang40a71912019-10-11 11:13:39 -070069 win32/README.txt
Elliott Hughes72472942018-01-10 08:36:10 -080070
71EXTRA_DIST = \
72 $(_EXTRA_DIST_CMAKE) \
73 $(_EXTRA_DIST_WINDOWS) \
74 \
75 conftools/expat.m4 \
76 conftools/get-version.sh \
77 conftools/PrintPath \
78 \
Haibo Huang40a71912019-10-11 11:13:39 -070079 xmlwf/xmlwf_helpgen.py \
80 xmlwf/xmlwf_helpgen.sh \
81 \
Elliott Hughes72472942018-01-10 08:36:10 -080082 Changes \
83 README.md \
Haibo Huang40a71912019-10-11 11:13:39 -070084 \
85 fix-xmltest-log.sh \
Elliott Hughes72472942018-01-10 08:36:10 -080086 test-driver-wrapper.sh
87
88
89.PHONY: buildlib
90buildlib:
91 @echo 'ERROR: Running "make buildlib LIBRARY=libexpatw.la"' >&2
92 @echo 'ERROR: is no longer supported. INSTEAD please:' >&2
93 @echo 'ERROR:' >&2
94 @echo 'ERROR: * Mass-patch Makefile.am, e.g.' >&2
95 @echo 'ERROR: # find -name Makefile.am -exec sed \' >&2
96 @echo 'ERROR: -e "s,libexpat\.la,libexpatw.la," \' >&2
97 @echo 'ERROR: -e "s,libexpat_la,libexpatw_la," \' >&2
98 @echo 'ERROR: -i {} +' >&2
99 @echo 'ERROR:' >&2
100 @echo 'ERROR: * Run automake to re-generate Makefile.in files' >&2
101 @echo 'ERROR:' >&2
102 @echo 'ERROR: * Use "./configure --without-xmlwf" and/or' >&2
103 @echo 'ERROR: "make -C lib all install" to bypass compilation' >&2
104 @echo 'ERROR: of xmlwf (e.g. with -DXML_UNICODE)' >&2
105 @echo 'ERROR:' >&2
106 @false
107
108
109.PHONY: run-benchmark
110run-benchmark:
111 $(MAKE) -C tests/benchmark
112 ./run.sh tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/recset.xml 65535 3
113
Haibo Huang40a71912019-10-11 11:13:39 -0700114.PHONY: download-xmlts-zip
115download-xmlts-zip:
Elliott Hughes72472942018-01-10 08:36:10 -0800116 if test "$(XMLTS_ZIP)" = ""; then \
117 wget --output-document=tests/xmlts.zip \
118 https://www.w3.org/XML/Test/xmlts20080827.zip; \
119 else \
120 cp $(XMLTS_ZIP) tests/xmlts.zip; \
121 fi
122
Haibo Huang40a71912019-10-11 11:13:39 -0700123tests/xmlts.zip:
124 $(MAKE) download-xmlts-zip
125
126.PHONY: extract-xmlts-zip
127extract-xmlts-zip: tests/xmlts.zip
128 [ -f $(builddir)/tests/xmlts.zip ] || $(MAKE) download-xmlts-zip # vpath workaround
Elliott Hughes72472942018-01-10 08:36:10 -0800129 cd tests && unzip -q xmlts.zip
130
Haibo Huang40a71912019-10-11 11:13:39 -0700131tests/xmlconf: tests/xmlts.zip
132 $(MAKE) extract-xmlts-zip
133
Elliott Hughes72472942018-01-10 08:36:10 -0800134.PHONY: run-xmltest
135run-xmltest: tests/xmlconf
136if WITH_XMLWF
Haibo Huang40a71912019-10-11 11:13:39 -0700137 [ -d $(builddir)/tests/xmlconf ] || $(MAKE) extract-xmlts-zip # vpath workaround
138 $(MAKE) -C lib
Elliott Hughes72472942018-01-10 08:36:10 -0800139 $(MAKE) -C xmlwf
Haibo Huang40a71912019-10-11 11:13:39 -0700140 $(srcdir)/tests/xmltest.sh "$(abs_builddir)/run.sh $(abs_builddir)/xmlwf/xmlwf@EXEEXT@" 2>&1 | tee $(builddir)/tests/xmltest.log
141 $(srcdir)/fix-xmltest-log.sh $(builddir)/tests/xmltest.log
142 diff -u $(srcdir)/tests/xmltest.log.expected $(builddir)/tests/xmltest.log
Elliott Hughes72472942018-01-10 08:36:10 -0800143else
144 @echo 'ERROR: xmlwf is needed for "make run-xmltest".' >&2
145 @echo 'ERROR: Please re-configure without --without-xmlwf.' >&2
146 @false
147endif
148
149.PHONY: qa
150qa:
Haibo Huang40a71912019-10-11 11:13:39 -0700151 QA_COMPILER=clang QA_SANITIZER=address ./qa.sh
152 QA_COMPILER=clang QA_SANITIZER=memory ./qa.sh
153 QA_COMPILER=clang QA_SANITIZER=undefined ./qa.sh
154 QA_COMPILER=gcc QA_PROCESSOR=gcov ./qa.sh