xref: /freebsd/contrib/expat/Makefile.am (revision f5ef5f675d9d9eb6e35ed9142d70ecf774456ad4)
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
31AUTOMAKE_OPTIONS = \
32    dist-bzip2 \
33    foreign \
34    no-dist-gzip \
35    subdir-objects
36
37ACLOCAL_AMFLAGS = -I m4
38LIBTOOLFLAGS = --verbose
39
40SUBDIRS = lib examples tests  # lib goes first to build first
41if WITH_XMLWF
42SUBDIRS += xmlwf doc
43endif
44
45pkgconfig_DATA = expat.pc
46pkgconfigdir = $(libdir)/pkgconfig
47
48
49_EXTRA_DIST_CMAKE = \
50    CMakeLists.txt \
51    CMake.README \
52    ConfigureChecks.cmake \
53    expat_config.h.cmake
54
55_EXTRA_DIST_WINDOWS = \
56    examples/elements.vcxproj \
57    examples/elements.vcxproj.filters \
58    examples/outline.vcxproj \
59    examples/outline.vcxproj.filters \
60    \
61    lib/expat_static.vcxproj \
62    lib/expat_static.vcxproj.filters \
63    lib/expat.vcxproj \
64    lib/expat.vcxproj.filters \
65    lib/expatw_static.vcxproj \
66    lib/expatw_static.vcxproj.filters \
67    lib/expatw.vcxproj \
68    lib/expatw.vcxproj.filters \
69    \
70    tests/benchmark/benchmark.sln \
71    tests/benchmark/benchmark.vcxproj \
72    \
73    tests/runtests.sln \
74    tests/runtests.vcxproj \
75    tests/runtests.vcxproj.filters \
76    \
77    win32/expat.iss \
78    win32/MANIFEST.txt \
79    win32/README.txt \
80    \
81    xmlwf/xmlwf.vcxproj \
82    xmlwf/xmlwf.vcxproj.filters \
83    \
84    expat.sln
85
86EXTRA_DIST = \
87    $(_EXTRA_DIST_CMAKE) \
88    $(_EXTRA_DIST_WINDOWS) \
89    \
90    conftools/expat.m4 \
91    conftools/get-version.sh \
92    conftools/PrintPath \
93    \
94    Changes \
95    README.md \
96    test-driver-wrapper.sh
97
98
99.PHONY: buildlib
100buildlib:
101	@echo 'ERROR: Running "make buildlib LIBRARY=libexpatw.la"' >&2
102	@echo 'ERROR: is no longer supported.  INSTEAD please:' >&2
103	@echo 'ERROR:' >&2
104	@echo 'ERROR:  * Mass-patch Makefile.am, e.g.' >&2
105	@echo 'ERROR:    # find -name Makefile.am -exec sed \' >&2
106	@echo 'ERROR:          -e "s,libexpat\.la,libexpatw.la," \' >&2
107	@echo 'ERROR:          -e "s,libexpat_la,libexpatw_la," \' >&2
108	@echo 'ERROR:          -i {} +' >&2
109	@echo 'ERROR:' >&2
110	@echo 'ERROR:  * Run automake to re-generate Makefile.in files' >&2
111	@echo 'ERROR:' >&2
112	@echo 'ERROR:  * Use "./configure --without-xmlwf" and/or' >&2
113	@echo 'ERROR:    "make -C lib all install" to bypass compilation' >&2
114	@echo 'ERROR:    of xmlwf (e.g. with -DXML_UNICODE)' >&2
115	@echo 'ERROR:' >&2
116	@false
117
118
119.PHONY: run-benchmark
120run-benchmark:
121	$(MAKE) -C tests/benchmark
122	./run.sh tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/recset.xml 65535 3
123
124tests/xmlts.zip:
125	if test "$(XMLTS_ZIP)" = ""; then \
126		wget --output-document=tests/xmlts.zip \
127			https://www.w3.org/XML/Test/xmlts20080827.zip; \
128	else \
129		cp $(XMLTS_ZIP) tests/xmlts.zip; \
130	fi
131
132tests/xmlconf: tests/xmlts.zip
133	cd tests && unzip -q xmlts.zip
134
135.PHONY: run-xmltest
136run-xmltest: tests/xmlconf
137if WITH_XMLWF
138	$(MAKE) -C xmlwf
139	tests/xmltest.sh "$(PWD)/run.sh $(PWD)/xmlwf/xmlwf@EXEEXT@" 2>&1 | tee tests/xmltest.log
140	dos2unix tests/xmltest.log
141	diff -u tests/xmltest.log.expected tests/xmltest.log
142else
143	@echo 'ERROR: xmlwf is needed for "make run-xmltest".' >&2
144	@echo 'ERROR: Please re-configure without --without-xmlwf.' >&2
145	@false
146endif
147
148.PHONY: qa
149qa:
150	./qa.sh address
151	./qa.sh memory
152	./qa.sh undefined
153	./qa.sh coverage
154