xref: /freebsd/contrib/expat/Makefile.in (revision 3416500aef140042c64bc149cb1ec6620483bc44)
1################################################################
2# Process this file with top-level configure script to produce Makefile
3#
4# Copyright 2000 Clark Cooper
5#
6#  This file is part of EXPAT.
7#
8#  EXPAT is free software; you can redistribute it and/or modify it
9#  under the terms of the License (based on the MIT/X license) contained
10#  in the file COPYING that comes with this distribution.
11#
12# EXPAT IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
13# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
14# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
15# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
16# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
17# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
18# SOFTWARE OR THE USE OR OTHER DEALINGS IN EXPAT.
19#
20
21SHELL = @SHELL@
22
23srcdir = @srcdir@
24top_srcdir = @top_srcdir@
25VPATH = @srcdir@
26
27prefix = @prefix@
28exec_prefix = @exec_prefix@
29
30bindir = @bindir@
31libdir = @libdir@
32includedir = @includedir@
33man1dir = @mandir@/man1
34pkgconfigdir = $(libdir)/pkgconfig
35
36top_builddir = .
37
38
39INSTALL = @INSTALL@
40INSTALL_PROGRAM = @INSTALL_PROGRAM@
41INSTALL_DATA = @INSTALL_DATA@
42mkinstalldirs = $(SHELL) $(top_srcdir)/conftools/mkinstalldirs
43
44MANFILE = $(srcdir)/doc/xmlwf.1
45APIHEADER = $(srcdir)/lib/expat.h $(srcdir)/lib/expat_external.h expat_config.h
46LIBRARY = libexpat.la
47
48DESTDIR = $(INSTALL_ROOT)
49
50default:  buildlib xmlwf/xmlwf@EXEEXT@
51
52buildlib: $(LIBRARY) expat.pc
53
54all: $(LIBRARY) expat.pc xmlwf/xmlwf@EXEEXT@ examples/elements examples/outline $(MANFILE)
55
56clean:
57	cd lib && rm -f $(LIBRARY) *.@OBJEXT@ *.lo && rm -rf .libs _libs
58	cd xmlwf && rm -f xmlwf *.@OBJEXT@ *.lo && rm -rf .libs _libs
59	cd examples && rm -f elements outline *.@OBJEXT@ *.lo && rm -rf .libs _libs
60	cd tests && rm -rf .libs runtests runtests.@OBJEXT@ runtestspp runtestspp.@OBJEXT@
61	cd tests && rm -f chardata.@OBJEXT@ minicheck.@OBJEXT@
62	rm -rf .libs libexpat.la
63	rm -f examples/core tests/core xmlwf/core
64
65clobber: clean
66
67distclean: clean
68	rm -f expat_config.h config.status config.log config.cache libtool
69	rm -f Makefile expat.pc
70
71extraclean: distclean
72	rm -f expat_config.h.in configure
73	rm -f aclocal.m4 m4/*
74	rm -f conftools/ltmain.sh conftools/install-sh conftools/config.guess conftools/config.sub
75
76check: tests/runtests tests/runtestspp
77	tests/runtests
78	tests/runtestspp
79
80$(MANFILE):
81	$(MAKE) -C doc xmlwf.1
82
83install: xmlwf/xmlwf@EXEEXT@ installlib $(MANFILE)
84	$(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(man1dir)
85	$(LIBTOOL) --mode=install $(INSTALL_PROGRAM) xmlwf/xmlwf@EXEEXT@ $(DESTDIR)$(bindir)/xmlwf
86	$(INSTALL_DATA) $(MANFILE) $(DESTDIR)$(man1dir)
87
88installlib: $(LIBRARY) $(APIHEADER) expat.pc
89	$(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir) $(DESTDIR)$(pkgconfigdir)
90	$(LIBTOOL) --mode=install $(INSTALL) $(LIBRARY) $(DESTDIR)$(libdir)/$(LIBRARY)
91	for FN in $(APIHEADER) ; do $(INSTALL_DATA) $$FN $(DESTDIR)$(includedir) ; done
92	$(INSTALL_DATA) expat.pc $(DESTDIR)$(pkgconfigdir)/expat.pc
93
94uninstall: uninstalllib
95	$(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(bindir)/xmlwf@EXEEXT@
96	rm -f $(DESTDIR)$(man1dir)/xmlwf.1
97
98uninstalllib:
99	$(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$(LIBRARY)
100	rm -f $(DESTDIR)$(includedir)/expat.h
101	rm -f $(DESTDIR)$(includedir)/expat_external.h
102	rm -f $(DESTDIR)$(pkgconfigdir)/expat.pc
103
104# for VPATH builds (invoked by configure)
105mkdir-init:
106	@for d in lib xmlwf examples tests ; do \
107		(mkdir $$d 2> /dev/null || test 1) ; \
108	done
109
110CC = @CC@
111CXX = @CXX@
112LIBTOOL = @LIBTOOL@
113
114INCLUDES = -I$(srcdir)/lib -I.
115LDFLAGS = @LDFLAGS@
116CPPFLAGS = @CPPFLAGS@ -DHAVE_EXPAT_CONFIG_H
117CFLAGS = @CFLAGS@
118CXXFLAGS = @CXXFLAGS@
119VSNFLAG = -version-info @LIBCURRENT@:@LIBREVISION@:@LIBAGE@
120
121### autoconf this?
122LTFLAGS = --verbose
123
124COMPILE = $(CC) $(INCLUDES) $(CFLAGS) $(DEFS) $(CPPFLAGS)
125CXXCOMPILE = $(CXX) $(INCLUDES) $(CXXFLAGS) $(DEFS) $(CPPFLAGS)
126LTCOMPILE = $(LIBTOOL) $(LTFLAGS) --mode=compile $(COMPILE)
127LINK_LIB = $(LIBTOOL) $(LTFLAGS) --mode=link $(COMPILE) -no-undefined $(VSNFLAG) -rpath $(libdir) $(LDFLAGS) -o $@
128LINK_EXE = $(LIBTOOL) $(LTFLAGS) --mode=link $(COMPILE) $(LDFLAGS) -o $@
129LINK_CXX_EXE = $(LIBTOOL) $(LTFLAGS) --mode=link $(CXXCOMPILE) $(LDFLAGS) -o $@
130
131LIB_OBJS = lib/xmlparse.lo lib/xmltok.lo lib/xmlrole.lo
132$(LIBRARY): $(LIB_OBJS)
133	$(LINK_LIB) $(LIB_OBJS)
134
135expat.pc: $(top_builddir)/config.status
136	cd $(top_builddir) && $(SHELL) ./config.status $@
137
138lib/xmlparse.lo: lib/xmlparse.c lib/expat.h lib/xmlrole.h lib/xmltok.h \
139	$(top_builddir)/expat_config.h lib/expat_external.h lib/internal.h
140
141lib/xmlrole.lo: lib/xmlrole.c lib/ascii.h lib/xmlrole.h \
142	$(top_builddir)/expat_config.h lib/expat_external.h lib/internal.h
143
144lib/xmltok.lo: lib/xmltok.c lib/xmltok_impl.c lib/xmltok_ns.c \
145	lib/ascii.h lib/asciitab.h lib/iasciitab.h lib/latin1tab.h \
146	lib/nametab.h lib/utf8tab.h lib/xmltok.h lib/xmltok_impl.h \
147	$(top_builddir)/expat_config.h lib/expat_external.h lib/internal.h
148
149
150XMLWF_OBJS = xmlwf/xmlwf.@OBJEXT@ xmlwf/xmlfile.@OBJEXT@ xmlwf/codepage.@OBJEXT@ xmlwf/@FILEMAP@.@OBJEXT@
151xmlwf/xmlwf.@OBJEXT@: xmlwf/xmlwf.c
152xmlwf/xmlfile.@OBJEXT@: xmlwf/xmlfile.c
153xmlwf/codepage.@OBJEXT@: xmlwf/codepage.c
154xmlwf/@FILEMAP@.@OBJEXT@: xmlwf/@FILEMAP@.c
155xmlwf/xmlwf@EXEEXT@: $(XMLWF_OBJS) $(LIBRARY)
156	$(LINK_EXE) $(XMLWF_OBJS) $(LIBRARY)
157
158examples/elements.@OBJEXT@: examples/elements.c
159examples/elements: examples/elements.@OBJEXT@ $(LIBRARY)
160	$(LINK_EXE) examples/elements.@OBJEXT@ $(LIBRARY)
161
162examples/outline.@OBJEXT@: examples/outline.c
163examples/outline: examples/outline.@OBJEXT@ $(LIBRARY)
164	$(LINK_EXE) examples/outline.@OBJEXT@ $(LIBRARY)
165
166tests/chardata.@OBJEXT@: tests/chardata.c tests/chardata.h
167tests/minicheck.@OBJEXT@: tests/minicheck.c tests/minicheck.h
168tests/runtests.@OBJEXT@: tests/runtests.c tests/chardata.h
169tests/runtests: tests/runtests.@OBJEXT@ tests/chardata.@OBJEXT@ tests/minicheck.@OBJEXT@ $(LIBRARY)
170	$(LINK_EXE) tests/runtests.@OBJEXT@ tests/chardata.@OBJEXT@ tests/minicheck.@OBJEXT@ $(LIBRARY)
171tests/runtestspp.@OBJEXT@: tests/runtestspp.cpp tests/runtests.c tests/chardata.h
172tests/runtestspp: tests/runtestspp.@OBJEXT@ tests/chardata.@OBJEXT@ tests/minicheck.@OBJEXT@ $(LIBRARY)
173	$(LINK_CXX_EXE) tests/runtestspp.@OBJEXT@ tests/chardata.@OBJEXT@ tests/minicheck.@OBJEXT@ $(LIBRARY)
174
175tests/benchmark/benchmark.@OBJEXT@: tests/benchmark/benchmark.c
176tests/benchmark/benchmark: tests/benchmark/benchmark.@OBJEXT@ $(LIBRARY)
177	$(LINK_EXE) tests/benchmark/benchmark.@OBJEXT@ $(LIBRARY)
178
179run-benchmark: tests/benchmark/benchmark
180	tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/recset.xml 65535 3
181
182tests/xmlts.zip:
183	wget --output-document=tests/xmlts.zip \
184		http://www.w3.org/XML/Test/xmlts20080827.zip
185
186tests/xmlconf: tests/xmlts.zip
187	cd tests && unzip -q xmlts.zip
188
189run-xmltest: xmlwf/xmlwf@EXEEXT@ tests/xmlconf
190	tests/xmltest.sh 2>&1 | tee tests/xmltest.log
191	diff -u tests/xmltest.log.expected tests/xmltest.log
192
193.PHONY: qa
194qa:
195	./qa.sh address
196	./qa.sh memory
197	./qa.sh undefined
198	./qa.sh coverage
199
200.SUFFIXES: .c .cpp .lo .@OBJEXT@
201
202.cpp.@OBJEXT@:
203	$(CXXCOMPILE) -o $@ -c $<
204.c.@OBJEXT@:
205	$(COMPILE) -o $@ -c $<
206.c.lo:
207	$(LTCOMPILE) -o $@ -c $<
208
209.PHONY: buildlib all \
210	clean distclean extraclean maintainer-clean \
211	dist distdir \
212	install uninstall
213