• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1## Process this file with automake to produce Makefile.in
2
3ACLOCAL_AMFLAGS = -I m4
4
5SUBDIRS = include . doc example xstc
6if WITH_PYTHON
7SUBDIRS += python
8endif
9if WITH_GLOB
10SUBDIRS += fuzz
11endif
12
13DIST_SUBDIRS = include . doc example fuzz python xstc
14
15AM_CPPFLAGS = -I$(top_builddir)/include -I$(srcdir)/include -DSYSCONFDIR='"$(sysconfdir)"'
16
17check_PROGRAMS = \
18	runsuite \
19	runtest \
20	runxmlconf \
21	testModule \
22	testapi \
23	testchar \
24	testdict \
25	testlimits \
26	testparser \
27	testrecurse
28
29bin_PROGRAMS = xmllint
30
31bin_SCRIPTS = xml2-config
32
33lib_LTLIBRARIES = libxml2.la
34libxml2_la_CFLAGS = $(AM_CFLAGS) $(XML_PRIVATE_CFLAGS)
35libxml2_la_LIBADD = $(XML_PRIVATE_LIBS)
36
37libxml2_la_LDFLAGS = $(AM_LDFLAGS) -no-undefined \
38		     -version-info $(LIBXML_VERSION_INFO)
39if USE_VERSION_SCRIPT
40libxml2_la_LDFLAGS += $(VERSION_SCRIPT_FLAGS)$(srcdir)/libxml2.syms
41endif
42
43libxml2_la_SOURCES = buf.c chvalid.c dict.c entities.c encoding.c error.c \
44		     globals.c hash.c list.c parser.c parserInternals.c \
45		     SAX2.c threads.c tree.c uri.c valid.c xmlIO.c \
46		     xmlmemory.c xmlstring.c
47if WITH_C14N_SOURCES
48libxml2_la_SOURCES += c14n.c
49endif
50if WITH_CATALOG_SOURCES
51if WITH_OUTPUT_SOURCES
52bin_PROGRAMS += xmlcatalog
53
54xmlcatalog_SOURCES = xmlcatalog.c
55xmlcatalog_CFLAGS = $(AM_CFLAGS) $(RDL_CFLAGS) $(ICONV_CFLAGS)
56xmlcatalog_DEPENDENCIES = $(DEPS)
57xmlcatalog_LDADD = $(RDL_LIBS) $(LDADDS)
58endif
59
60libxml2_la_SOURCES += catalog.c
61endif
62if WITH_DEBUG_SOURCES
63libxml2_la_SOURCES += debugXML.c
64endif
65if WITH_HTML_SOURCES
66libxml2_la_SOURCES += HTMLparser.c HTMLtree.c
67endif
68if WITH_HTTP_SOURCES
69libxml2_la_SOURCES += nanohttp.c
70endif
71if WITH_LEGACY_SOURCES
72libxml2_la_SOURCES += legacy.c
73endif
74if WITH_LZMA_SOURCES
75libxml2_la_SOURCES += xzlib.c
76endif
77if WITH_MODULES_SOURCES
78libxml2_la_SOURCES += xmlmodule.c
79endif
80if WITH_OUTPUT_SOURCES
81libxml2_la_SOURCES += xmlsave.c
82endif
83if WITH_PATTERN_SOURCES
84libxml2_la_SOURCES += pattern.c
85endif
86if WITH_READER_SOURCES
87libxml2_la_SOURCES += xmlreader.c
88endif
89if WITH_REGEXPS_SOURCES
90libxml2_la_SOURCES += xmlregexp.c xmlunicode.c
91endif
92if WITH_SCHEMAS_SOURCES
93libxml2_la_SOURCES += relaxng.c xmlschemas.c xmlschemastypes.c
94endif
95if WITH_SCHEMATRON_SOURCES
96libxml2_la_SOURCES += schematron.c
97endif
98if WITH_WRITER_SOURCES
99libxml2_la_SOURCES += xmlwriter.c
100endif
101if WITH_XINCLUDE_SOURCES
102libxml2_la_SOURCES += xinclude.c
103endif
104if WITH_XPATH_SOURCES
105libxml2_la_SOURCES += xpath.c
106endif
107if WITH_XPTR_SOURCES
108libxml2_la_SOURCES += xlink.c xpointer.c
109endif
110
111DEPS = libxml2.la
112LDADDS = libxml2.la
113
114runtest_SOURCES=runtest.c
115runtest_DEPENDENCIES = $(DEPS)
116runtest_LDADD= $(THREAD_LIBS) $(LDADDS)
117
118testrecurse_SOURCES=testrecurse.c
119testrecurse_DEPENDENCIES = $(DEPS)
120testrecurse_LDADD= $(LDADDS)
121
122testlimits_SOURCES=testlimits.c
123testlimits_DEPENDENCIES = $(DEPS)
124testlimits_LDADD= $(LDADDS)
125
126testchar_SOURCES=testchar.c
127testchar_DEPENDENCIES = $(DEPS)
128testchar_LDADD= $(LDADDS)
129
130testdict_SOURCES=testdict.c
131testdict_DEPENDENCIES = $(DEPS)
132testdict_LDADD= $(LDADDS)
133
134testparser_SOURCES=testparser.c
135testparser_DEPENDENCIES = $(DEPS)
136testparser_LDADD= $(LDADDS)
137
138runsuite_SOURCES=runsuite.c
139runsuite_DEPENDENCIES = $(DEPS)
140runsuite_LDADD= $(LDADDS)
141
142xmllint_SOURCES = xmllint.c shell.c lintmain.c
143xmllint_CFLAGS = $(AM_CFLAGS) $(RDL_CFLAGS) $(ICONV_CFLAGS)
144xmllint_DEPENDENCIES = $(DEPS)
145xmllint_LDADD=  $(RDL_LIBS) $(LDADDS)
146
147testModule_SOURCES=testModule.c
148testModule_DEPENDENCIES = $(DEPS)
149testModule_LDADD= $(LDADDS)
150
151check_LTLIBRARIES = testdso.la
152testdso_la_SOURCES = testdso.c
153testdso_la_LDFLAGS = $(AM_LDFLAGS) \
154		     -module -no-undefined -avoid-version -rpath $(libdir)
155
156# that one forces the rebuild when "make rebuild" is run on doc/
157rebuild_testapi:
158	-@(if [ "$(PYTHON)" != "" ] ; then \
159	    $(PYTHON) $(srcdir)/tools/gentest.py $(srcdir) ; fi )
160
161testapi_SOURCES=testapi.c
162testapi_DEPENDENCIES = $(DEPS)
163testapi_LDADD= $(LDADDS)
164
165runxmlconf_SOURCES=runxmlconf.c
166runxmlconf_DEPENDENCIES = $(DEPS)
167runxmlconf_LDADD= $(LDADDS)
168
169check-local:
170	[ -d test   ] || $(LN_S) $(srcdir)/test   .
171	[ -d result ] || $(LN_S) $(srcdir)/result .
172	$(CHECKER) ./runtest$(EXEEXT)
173	$(CHECKER) ./testrecurse$(EXEEXT)
174	$(CHECKER) ./testapi$(EXEEXT)
175	$(CHECKER) ./testchar$(EXEEXT)
176	$(CHECKER) ./testdict$(EXEEXT)
177	$(CHECKER) ./testparser$(EXEEXT)
178	$(CHECKER) ./testModule$(EXEEXT)
179	$(CHECKER) ./runxmlconf$(EXEEXT)
180	$(CHECKER) ./runsuite$(EXEEXT)
181if WITH_DEBUG_SOURCES
182	test/scripts/test.sh ./xmllint$(EXEEXT)
183endif
184if WITH_CATALOG_SOURCES
185	ASAN_OPTIONS=detect_leaks=0 test/catalogs/test.sh ./xmlcatalog$(EXEEXT)
186endif
187
188# Compatibility name of the check target
189runtests: check
190
191check-valgrind valgrind:
192	@echo '## Running the regression tests under Valgrind'
193	@echo '## Go get a cup of coffee it is gonna take a while ...'
194	$(MAKE) CHECKER='valgrind -q' check
195
196asan:
197	@echo '## rebuilding for ASAN'
198	./configure CFLAGS="-fsanitize=address,undefined -Wformat -Werror=format-security -Werror=array-bounds -g" CXXFLAGS="-fsanitize=address,undefined -Wformat -Werror=format-security -Werror=array-bounds -g" LDFLAGS="-fsanitize=address,undefined" CC="clang" CXX="clang++" --disable-shared ; OptimOff  ; $(MAKE) clean ; $(MAKE)
199
200cleanup:
201	-@(find . -name .\#\* -exec rm {} \;)
202	-@(find . -name \*.gcda -o -name \*.gcno -exec rm -f {} \;)
203	-@(find . -name \*.orig -o -name \*.rej -o -name \*.old -exec rm -f {} \;)
204
205dist-hook: cleanup
206	(cd $(srcdir) ; tar -cf - --exclude .git win32 os400 test result) | (cd $(distdir); tar xf -)
207
208CLEANFILES = runsuite.log runxmlconf.log test.out *.gcda *.gcno *.res
209DISTCLEANFILES = COPYING missing.lst
210
211EXTRA_DIST = Copyright libxml2-config.cmake.in autogen.sh \
212	     libxml.h \
213	     html5ent.inc iso8859x.inc \
214	     tools/gentest.py \
215	     tools/genChRanges.py tools/genEscape.py tools/genUnicode.py \
216	     libxml2.syms timsort.h \
217	     README.zOS README.md \
218	     CMakeLists.txt config.h.cmake.in libxml2-config.cmake.cmake.in \
219	     meson.build meson_options.txt
220
221
222pkgconfigdir = $(libdir)/pkgconfig
223pkgconfig_DATA = libxml-2.0.pc
224
225cmakedir = $(libdir)/cmake/libxml2
226cmake_DATA = libxml2-config.cmake
227
228tst: tst.c
229	$(CC) $(CFLAGS) -Iinclude -o tst tst.c .libs/libxml2.a -lpthread -lm -lz -llzma
230
231sparse: clean
232	$(MAKE) CC=cgcc
233
234#
235# Coverage support, largely borrowed from libvirt
236# Both binaries comes from the lcov package in Fedora
237#
238LCOV = /usr/bin/lcov
239GENHTML = /usr/bin/genhtml
240
241cov: clean-cov
242	if [ "`echo $(AM_LDFLAGS) | grep coverage`" = "" ] ; then \
243	    echo not configured with coverage; exit 1 ; fi
244	if [ ! -x $(LCOV) -o ! -x $(GENHTML) ] ; then \
245	    echo Need $(LCOV) and $(GENHTML) excecutables; exit 1 ; fi
246	-@($(MAKE) check)
247	-@(./runsuite$(EXEEXT))
248	mkdir $(top_builddir)/coverage
249	$(LCOV) -c -o $(top_builddir)/coverage/libxml2.info.tmp -d $(top_srcdir)
250	$(LCOV) -r $(top_builddir)/coverage/libxml2.info.tmp -o $(top_builddir)/coverage/libxml2.info *usr*
251	rm $(top_builddir)/coverage/libxml2.info.tmp
252	$(GENHTML) -s -t "libxml2" -o $(top_builddir)/coverage --legend $(top_builddir)/coverage/libxml2.info
253	echo "Coverage report is in $(top_builddir)/coverage/index.html"
254
255clean-cov:
256	rm -rf $(top_builddir)/coverage
257
258