Makefile.am revision 9e8bfae59a087a938a810a5527023b1e7b0e15b3
1## Process this file with automake to produce Makefile.in
2
3SUBDIRS = include doc
4
5INCLUDES = -I@srcdir@/include -I./include @Z_CFLAGS@ @CORBA_CFLAGS@ 
6
7noinst_PROGRAMS=testSAX testHTML testXPath testURI
8
9bin_PROGRAMS = xmllint
10
11bin_SCRIPTS=xml-config
12
13lib_LTLIBRARIES = libxml.la
14libxml_la_LIBADD = @Z_LIBS@
15
16libxml_la_LDFLAGS = -version-info @LIBXML_VERSION_INFO@
17
18libxml_la_SOURCES = \
19		SAX.c \
20		entities.c \
21		encoding.c \
22		error.c \
23		parserInternals.c \
24		parser.c \
25		tree.c \
26		hash.c \
27		xmlIO.c \
28		xmlmemory.c \
29		uri.c \
30		valid.c \
31		xlink.c \
32		HTMLparser.c \
33		HTMLtree.c \
34		debugXML.c \
35		xpath.c \
36		xpointer.c \
37		xinclude.c \
38		nanohttp.c \
39		nanoftp.c
40
41DEPS = $(top_builddir)/libxml.la
42LDADDS = $(top_builddir)/libxml.la @Z_LIBS@ @M_LIBS@
43
44man_MANS = xmllint.1 xml-config.1 libxml.4
45
46m4datadir = $(datadir)/aclocal                                                  m4data_DATA = libxml.m4
47
48xmllint_SOURCES=xmllint.c
49xmllint_LDFLAGS = 
50xmllint_DEPENDENCIES = $(DEPS)
51xmllint_LDADD=  @RDL_LIBS@ $(LDADDS)
52
53testSAX_SOURCES=testSAX.c
54testSAX_LDFLAGS = 
55testSAX_DEPENDENCIES = $(DEPS)
56testSAX_LDADD= $(LDADDS)
57
58testHTML_SOURCES=testHTML.c
59testHTML_LDFLAGS = 
60testHTML_DEPENDENCIES = $(DEPS)
61testHTML_LDADD= $(LDADDS)
62
63testXPath_SOURCES=testXPath.c
64testXPath_LDFLAGS = 
65testXPath_DEPENDENCIES = $(DEPS)
66testXPath_LDADD= $(LDADDS)
67
68testURI_SOURCES=testURI.c
69testURI_LDFLAGS = 
70testURI_DEPENDENCIES = $(DEPS)
71testURI_LDADD= $(LDADDS)
72
73check-local: tests
74
75$(srcdir)/libxml:
76	-$(RM) $(srcdir)/libxml
77	ln -s $(srcdir)/. $(srcdir)/libxml
78
79install-data: $(srcdir)/libxml
80
81$(libxml_la_SOURCES): $(srcdir)/libxml
82
83testall : tests SVGtests SAXtests
84
85tests: XMLtests XMLenttests HTMLtests Validtests URItests XPathtests XPtrtests
86
87HTMLtests : testHTML
88	@(rm -f .memdump ; touch .memdump)
89	@echo "##"
90	@echo "## HTML regression tests"
91	@echo "##"
92	@(for i in $(srcdir)/test/HTML/* ; do \
93	  name=`basename $$i`; \
94	  if [ ! -d $$i ] ; then \
95	  if [ ! -f $(srcdir)/result/HTML/$$name ] ; then \
96	      echo New test file $$name ; \
97	      testHTML $$i > $(srcdir)/result/HTML/$$name 2>$(srcdir)/result/HTML/$$name.err ; \
98	  else \
99	      echo Testing $$name ; \
100	      testHTML $$i > result.$$name 2> error.$$name ; \
101	      grep "MORY ALLO" .memdump  | grep -v "MEMORY ALLOCATED : 0";\
102	      diff $(srcdir)/result/HTML/$$name result.$$name ; \
103	      diff -b $(srcdir)/result/HTML/$$name.err error.$$name ; \
104	      testHTML result.$$name > result2.$$name 2>error.$$name ; \
105	      diff result.$$name result2.$$name ; \
106	      rm result.$$name result2.$$name error.$$name ; \
107	  fi ; fi ; done)
108	@echo "##"
109	@echo "## Push HTML regression tests"
110	@echo "##"
111	@(for i in $(srcdir)/test/HTML/* ; do \
112	  name=`basename $$i`; \
113	  if [ ! -d $$i ] ; then \
114	  if [ ! -f $(srcdir)/result/HTML/$$name ] ; then \
115	      echo New test file $$name ; \
116	      testHTML $$i > $(srcdir)/result/HTML/$$name 2>$(srcdir)/result/HTML/$$name.err ; \
117	  else \
118	      echo Testing $$name ; \
119	      testHTML --push $$i > result.$$name 2> error.$$name ; \
120	      grep "MORY ALLO" .memdump  | grep -v "MEMORY ALLOCATED : 0";\
121	      diff $(srcdir)/result/HTML/$$name result.$$name ; \
122	      cut -b 1-15 $(srcdir)/result/HTML/$$name.err > errorcut.$$name; \
123	      cut -b 1-15 error.$$name > errorcut2.$$name; \
124	      diff -b errorcut.$$name errorcut2.$$name ; \
125	      testHTML --push result.$$name > result2.$$name 2>error.$$name ; \
126	      diff result.$$name result2.$$name ; \
127	      rm result.$$name result2.$$name error.$$name errorcut.$$name errorcut2.$$name ; \
128	  fi ; fi ; done)
129	@echo "##"
130	@echo "## HTML SAX regression tests"
131	@echo "##"
132	@(for i in $(srcdir)/test/HTML/* ; do \
133	  name=`basename $$i`; \
134	  if [ ! -d $$i ] ; then \
135	  if [ ! -f $(srcdir)/result/HTML/$$name.sax ] ; then \
136	      echo New test file $$name ; \
137	      testHTML --sax $$i > $(srcdir)/result/HTML/$$name.sax ; \
138	  else \
139	      echo Testing $$name ; \
140	      testHTML --sax $$i > result.$$name.sax ; \
141	      grep "MORY ALLO" .memdump  | grep -v "MEMORY ALLOCATED : 0";\
142	      diff $(srcdir)/result/HTML/$$name.sax result.$$name.sax ; \
143	      rm result.$$name.sax ; \
144	  fi ; fi ; done)
145	@echo "##"
146	@echo "## Push HTML SAX regression tests"
147	@echo "##"
148	@(for i in $(srcdir)/test/HTML/* ; do \
149	  name=`basename $$i`; \
150	  if [ ! -d $$i ] ; then \
151	  if [ ! -f $(srcdir)/result/HTML/$$name ] ; then \
152	      echo New test file $$name ; \
153	      testHTML --sax $$i > $(srcdir)/result/HTML/$$name.sax ; \
154	  else \
155	      echo Testing $$name ; \
156	      testHTML --push --sax $$i > result.$$name.sax ; \
157	      grep "MORY ALLO" .memdump  | grep -v "MEMORY ALLOCATED : 0";\
158	      diff $(srcdir)/result/HTML/$$name.sax result.$$name.sax ; \
159	      rm result.$$name.sax ; \
160	  fi ; fi ; done)
161
162
163XMLtests : xmllint
164	@echo "##"
165	@echo "## XML regression tests"
166	@echo "##"
167	@(for i in $(srcdir)/test/* ; do \
168	  name=`basename $$i`; \
169	  if [ ! -d $$i ] ; then \
170	  if [ ! -f $(srcdir)/result/$$name ] ; then \
171	      echo New test file $$name ; \
172	      $(top_builddir)/xmllint $$i > $(srcdir)/result/$$name ; \
173	  else \
174	      echo Testing $$name ; \
175	      $(top_builddir)/xmllint $$i > result.$$name ; \
176	      diff $(srcdir)/result/$$name result.$$name ; \
177	      $(top_builddir)/xmllint result.$$name > result2.$$name ; \
178	      diff result.$$name result2.$$name ; \
179	      rm result.$$name result2.$$name ; \
180	  fi ; fi ; done)
181
182XMLenttests : xmllint
183	@echo "##"
184	@echo "## XML entity subst regression tests"
185	@echo "##"
186	@(for i in $(srcdir)/test/* ; do \
187	  name=`basename $$i`; \
188	  if [ ! -d $$i ] ; then \
189	  if [ ! -f $(srcdir)/result/noent/$$name ] ; then \
190	      echo New test file $$name ; \
191	      $(top_builddir)/xmllint --noent $$i > $(srcdir)/result/noent/$$name ; \
192	  else \
193	      echo Testing $$name ; \
194	      $(top_builddir)/xmllint --noent $$i > result.$$name ; \
195	      diff $(srcdir)/result/noent/$$name result.$$name ; \
196	      $(top_builddir)/xmllint --noent result.$$name > result2.$$name ; \
197	      diff result.$$name result2.$$name ; \
198	      rm result.$$name result2.$$name ; \
199	  fi ; fi ; done)
200
201URItests : testURI
202	@(rm -f .memdump ; touch .memdump)
203	@echo "##"
204	@echo "## URI module regression tests"
205	@echo "##"
206	@(for i in $(srcdir)/test/URI/*.data ; do \
207	  name=`basename $$i`; \
208	  if [ ! -d $$i ] ; then \
209	  if [ ! -f $(srcdir)/result/URI/$$name ] ; then \
210	      echo New test file $$name ; \
211	      $(top_builddir)/testURI -base 'http://foo.com/path/to/index.html?orig#help' < $$i > $(srcdir)/result/URI/$$name ; \
212	  else \
213	      echo Testing $$name ; \
214	      $(top_builddir)/testURI -base 'http://foo.com/path/to/index.html?orig#help' < $$i > result.$$name ; \
215	      grep "MORY ALLO" .memdump  | grep -v "MEMORY ALLOCATED : 0";\
216	      diff $(srcdir)/result/URI/$$name result.$$name ; \
217	      rm result.$$name ; \
218	  fi ; fi ; done)
219
220XPathtests : testXPath
221	@echo "##"
222	@echo "## XPath regression tests"
223	@echo "##"
224	@(for i in $(srcdir)/test/XPath/expr/* ; do \
225	  name=`basename $$i`; \
226	  if [ ! -d $$i ] ; then \
227	  if [ ! -f $(srcdir)/result/XPath/expr/$$name ] ; then \
228	      echo New test file $$name ; \
229	      $(top_builddir)/testXPath -f --expr $$i > $(srcdir)/result/XPath/expr/$$name ; \
230	  else \
231	      echo Testing $$name ; \
232	      $(top_builddir)/testXPath -f --expr $$i > result.$$name ; \
233	      diff $(srcdir)/result/XPath/expr/$$name result.$$name ; \
234	      rm result.$$name ; \
235	  fi ; fi ; done)
236	@(for i in $(srcdir)/test/XPath/docs/* ; do \
237	  if [ ! -d $$i ] ; then \
238	  doc=`basename $$i`; \
239	  for j in $(srcdir)/test/XPath/tests/$$doc* ; do \
240	  if [ ! -f $$j ] ; then continue ; fi ; \
241	  name=`basename $$j`; \
242	  if [ ! -d $$j ] ; then \
243	  if [ ! -f $(srcdir)/result/XPath/tests/$$name ] ; then \
244	      echo New test file $$name ; \
245	      $(top_builddir)/testXPath -f -i $$i $$j > $(srcdir)/result/XPath/tests/$$name ; \
246	  else \
247	      echo Testing $$name ; \
248	      $(top_builddir)/testXPath -f -i $$i $$j > result.$$name ; \
249	      diff $(srcdir)/result/XPath/tests/$$name result.$$name ; \
250	      rm result.$$name ; \
251	  fi ; fi ; done ; fi ; done)
252
253XPtrtests : testXPath
254	@(rm -f .memdump ; touch .memdump)
255	@echo "##"
256	@echo "## XPointer regression tests"
257	@echo "##"
258	@(for i in $(srcdir)/test/XPath/docs/* ; do \
259	  if [ ! -d $$i ] ; then \
260	  doc=`basename $$i`; \
261	  for j in $(srcdir)/test/XPath/xptr/$$doc* ; do \
262	  if [ ! -f $$j ] ; then continue ; fi ; \
263	  name=`basename $$j`; \
264	  if [ ! -d $$j ] ; then \
265	  if [ ! -f $(srcdir)/result/XPath/xptr/$$name ] ; then \
266	      echo New test file $$name ; \
267	      ./testXPath -xptr -f -i $$i $$j > $(srcdir)/result/XPath/xptr/$$name ; \
268	  else \
269	      echo Testing $$name ; \
270	      ./testXPath -xptr -f -i $$i $$j > result.$$name ; \
271	      grep "MORY ALLO" .memdump  | grep -v "MEMORY ALLOCATED : 0";\
272	      diff $(srcdir)/result/XPath/xptr/$$name result.$$name ; \
273	      rm result.$$name ; \
274	  fi ; fi ; done ; fi ; done)
275
276SVGtests : xmllint
277	@echo "##"
278	@echo "## SVG parsing regression tests"
279	@echo "##"
280	@(for i in $(srcdir)/test/SVG/* ; do \
281	  name=`basename $$i`; \
282	  if [ ! -d $$i ] ; then \
283	  if [ ! -f $(srcdir)/result/SVG/$$name ] ; then \
284	      echo New test file $$name ; \
285	      $(top_builddir)/xmllint $$i > $(srcdir)/result/SVG/$$name ; \
286	  else \
287	      echo Testing $$name ; \
288	      $(top_builddir)/xmllint $$i > result.$$name ; \
289	      diff $(srcdir)/result/SVG/$$name result.$$name ; \
290	      $(top_builddir)/xmllint result.$$name > result2.$$name ; \
291	      diff result.$$name result2.$$name ; \
292	      rm result.$$name result2.$$name ; \
293	  fi ; fi ; done)
294
295SAXtests : testSAX
296	@echo "##"
297	@echo "## SAX callbacks regression tests"
298	@echo "##"
299	@(for i in $(srcdir)/test/* ; do \
300	  name=`basename $$i`; \
301	  if [ ! -d $$i ] ; then \
302	  if [ ! -f $(srcdir)/SAXresult/$$name ] ; then \
303	      echo New test file $$name ; \
304	      $(top_builddir)/testSAX $$i > $(srcdir)/SAXresult/$$name ; \
305	  else \
306	      echo Testing $$name ; \
307	      $(top_builddir)/testSAX $$i > result.$$name ; \
308	      diff $(srcdir)/SAXresult/$$name result.$$name ; \
309	      rm result.$$name ; \
310	  fi ; fi ; done)
311
312
313Validtests : xmllint
314	@echo "##"
315	@echo "## Validity checking regression tests"
316	@echo "##"
317	@(for i in $(srcdir)/test/VC/* ; do \
318	  name=`basename $$i`; \
319	  if [ ! -d $$i ] ; then \
320	  if [ ! -f $(srcdir)/result/VC/$$name ] ; then \
321	      echo New test file $$name ; \
322	      $(top_builddir)/xmllint --noout --valid $$i 2> $(srcdir)/result/VC/$$name ; \
323	  else \
324	      echo Testing $$name ; \
325	      $(top_builddir)/xmllint --noout --valid $$i 2> result.$$name ; \
326	      diff $(srcdir)/result/VC/$$name result.$$name ; \
327	      rm result.$$name ; \
328	  fi ; fi ; done)
329	@echo "##"
330	@echo "## Valid documents regression tests"
331	@echo "##"
332	@(for i in $(srcdir)/test/valid/* ; do \
333	  name=`basename $$i`; \
334	  if [ ! -d $$i ] ; then \
335	  if [ ! -f $(srcdir)/result/valid/$$name ] ; then \
336	      echo New test file $$name ; \
337	      $(top_builddir)/xmllint --valid $$i > $(srcdir)/result/valid/$$name 2>$(srcdir)/result/valid/$$name.err ; \
338	  else \
339	      echo Testing $$name ; \
340	      $(top_builddir)/xmllint --valid $$i > result.$$name 2>error.$$name ; \
341	      diff $(srcdir)/result/valid/$$name result.$$name ; \
342	      diff $(srcdir)/result/valid/$$name.err error.$$name ; \
343	      rm result.$$name error.$$name ; \
344	  fi ; fi ; done)
345
346dist-hook: libxml.spec
347	-cp libxml.spec $(distdir)
348	(cd $(srcdir) ; tar -cf - --exclude CVS test result SAXresult ) | (cd $(distdir); tar xf -)
349
350rpm: $(distdir).tar.gz
351	rpm -ta $(distdir).tar.gz
352
353## We create xmlConf.sh here and not from configure because we want
354## to get the paths expanded correctly.  Macros like srcdir are given
355## the value NONE in configure if the user doesn't specify them (this
356## is an autoconf feature, not a bug).
357
358confexecdir=$(libdir)
359confexec_DATA = xmlConf.sh
360
361CLEANFILES=xmlConf.sh
362
363confexecdir=$(libdir)
364confexec_DATA = xmlConf.sh
365EXTRA_DIST = xmlConf.sh.in libxml.spec.in libxml.spec libxml.m4 \
366             example/Makefile.am example/gjobread.c example/gjobs.xml \
367	     $(man_MANS) libxml-2.0.pc.in xmlversion.h.in \
368	     win32/README.MSDev win32/Makefile.mingw win32/libxml2/libxml2.dsp
369
370pkgconfigdir = $(libdir)/pkgconfig
371pkgconfig_DATA = libxml-2.0.pc
372
373xmlConf.sh: xmlConf.sh.in Makefile
374## Use sed and then mv to avoid problems if the user interrupts.
375	sed -e 's?\@XML_LIBDIR\@?$(XML_LIBDIR)?g' \
376	    -e 's?\@XML_INCLUDEDIR\@?$(XML_INCLUDEDIR)?g' \
377	    -e 's?\@XML_LIBS\@?$(XML_LIBS)?g' \
378	    -e 's?\@VERSION\@?$(VERSION)?g' \
379	      < $(srcdir)/xmlConf.sh.in > xmlConf.tmp \
380	  && mv xmlConf.tmp xmlConf.sh
381