]>
Commit | Line | Data |
---|---|---|
5e9f2524 VS |
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 | ||
21 | SHELL = @SHELL@ | |
22 | ||
23 | srcdir = @srcdir@ | |
24 | top_srcdir = @top_srcdir@ | |
25 | VPATH = @srcdir@ | |
26 | ||
27 | prefix = @prefix@ | |
28 | exec_prefix = @exec_prefix@ | |
29 | ||
30 | bindir = @bindir@ | |
31 | libdir = @libdir@ | |
32 | includedir = @includedir@ | |
11a3e7b6 VZ |
33 | man1dir = @mandir@/man1 |
34 | pkgconfigdir = $(libdir)/pkgconfig | |
5e9f2524 VS |
35 | |
36 | top_builddir = . | |
37 | ||
38 | ||
39 | INSTALL = @INSTALL@ | |
40 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ | |
41 | INSTALL_DATA = @INSTALL_DATA@ | |
42 | mkinstalldirs = $(SHELL) $(top_srcdir)/conftools/mkinstalldirs | |
43 | ||
44 | MANFILE = $(srcdir)/doc/xmlwf.1 | |
11a3e7b6 | 45 | APIHEADER = $(srcdir)/lib/expat.h $(srcdir)/lib/expat_external.h |
5e9f2524 VS |
46 | LIBRARY = libexpat.la |
47 | ||
11a3e7b6 | 48 | DESTDIR = $(INSTALL_ROOT) |
5e9f2524 | 49 | |
11a3e7b6 | 50 | default: buildlib xmlwf/xmlwf@EXEEXT@ |
5e9f2524 | 51 | |
11a3e7b6 | 52 | buildlib: $(LIBRARY) expat.pc |
5e9f2524 | 53 | |
11a3e7b6 | 54 | all: $(LIBRARY) expat.pc xmlwf/xmlwf@EXEEXT@ examples/elements examples/outline |
5e9f2524 VS |
55 | |
56 | clean: | |
11a3e7b6 VZ |
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@ | |
5e9f2524 VS |
62 | rm -rf .libs libexpat.la |
63 | rm -f examples/core tests/core xmlwf/core | |
64 | ||
65 | clobber: clean | |
66 | ||
67 | distclean: clean | |
68 | rm -f expat_config.h config.status config.log config.cache libtool | |
11a3e7b6 | 69 | rm -f Makefile expat.pc |
5e9f2524 VS |
70 | |
71 | extraclean: distclean | |
72 | rm -f expat_config.h.in configure | |
11a3e7b6 VZ |
73 | rm -f aclocal.m4 m4/* |
74 | rm -f conftools/ltmain.sh conftools/install-sh conftools/config.guess conftools/config.sub | |
5e9f2524 | 75 | |
11a3e7b6 | 76 | check: tests/runtests tests/runtestspp |
5e9f2524 | 77 | tests/runtests |
11a3e7b6 | 78 | tests/runtestspp |
5e9f2524 | 79 | |
11a3e7b6 VZ |
80 | install: xmlwf/xmlwf@EXEEXT@ installlib |
81 | $(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(man1dir) | |
82 | $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) xmlwf/xmlwf@EXEEXT@ $(DESTDIR)$(bindir)/xmlwf | |
83 | $(INSTALL_DATA) $(MANFILE) $(DESTDIR)$(man1dir) | |
5e9f2524 | 84 | |
11a3e7b6 VZ |
85 | installlib: $(LIBRARY) $(APIHEADER) expat.pc |
86 | $(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir) $(DESTDIR)$(pkgconfigdir) | |
87 | $(LIBTOOL) --mode=install $(INSTALL) $(LIBRARY) $(DESTDIR)$(libdir)/$(LIBRARY) | |
88 | for FN in $(APIHEADER) ; do $(INSTALL_DATA) $$FN $(DESTDIR)$(includedir) ; done | |
89 | $(INSTALL_DATA) expat.pc $(DESTDIR)$(pkgconfigdir)/expat.pc | |
5e9f2524 VS |
90 | |
91 | uninstall: uninstalllib | |
11a3e7b6 VZ |
92 | $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(bindir)/xmlwf@EXEEXT@ |
93 | rm -f $(DESTDIR)$(man1dir)/xmlwf.1 | |
5e9f2524 VS |
94 | |
95 | uninstalllib: | |
11a3e7b6 VZ |
96 | $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$(LIBRARY) |
97 | rm -f $(DESTDIR)$(includedir)/expat.h | |
98 | rm -f $(DESTDIR)$(includedir)/expat_external.h | |
99 | rm -f $(DESTDIR)$(pkgconfigdir)/expat.pc | |
5e9f2524 VS |
100 | |
101 | # for VPATH builds (invoked by configure) | |
102 | mkdir-init: | |
103 | @for d in lib xmlwf examples tests ; do \ | |
104 | (mkdir $$d 2> /dev/null || test 1) ; \ | |
105 | done | |
106 | ||
107 | CC = @CC@ | |
11a3e7b6 | 108 | CXX = @CXX@ |
5e9f2524 VS |
109 | LIBTOOL = @LIBTOOL@ |
110 | ||
111 | INCLUDES = -I$(srcdir)/lib -I. | |
112 | LDFLAGS = @LDFLAGS@ | |
11a3e7b6 | 113 | CPPFLAGS = @CPPFLAGS@ -DHAVE_EXPAT_CONFIG_H |
5e9f2524 | 114 | CFLAGS = @CFLAGS@ |
11a3e7b6 | 115 | CXXFLAGS = @CXXFLAGS@ |
5e9f2524 VS |
116 | VSNFLAG = -version-info @LIBCURRENT@:@LIBREVISION@:@LIBAGE@ |
117 | ||
118 | ### autoconf this? | |
119 | LTFLAGS = --silent | |
120 | ||
11a3e7b6 VZ |
121 | COMPILE = $(CC) $(INCLUDES) $(CFLAGS) $(DEFS) $(CPPFLAGS) |
122 | CXXCOMPILE = $(CXX) $(INCLUDES) $(CXXFLAGS) $(DEFS) $(CPPFLAGS) | |
5e9f2524 VS |
123 | LTCOMPILE = $(LIBTOOL) $(LTFLAGS) --mode=compile $(COMPILE) |
124 | LINK_LIB = $(LIBTOOL) $(LTFLAGS) --mode=link $(COMPILE) -no-undefined $(VSNFLAG) -rpath $(libdir) $(LDFLAGS) -o $@ | |
125 | LINK_EXE = $(LIBTOOL) $(LTFLAGS) --mode=link $(COMPILE) $(LDFLAGS) -o $@ | |
11a3e7b6 | 126 | LINK_CXX_EXE = $(LIBTOOL) $(LTFLAGS) --mode=link $(CXXCOMPILE) $(LDFLAGS) -o $@ |
5e9f2524 VS |
127 | |
128 | LIB_OBJS = lib/xmlparse.lo lib/xmltok.lo lib/xmlrole.lo | |
129 | $(LIBRARY): $(LIB_OBJS) | |
130 | $(LINK_LIB) $(LIB_OBJS) | |
131 | ||
11a3e7b6 VZ |
132 | expat.pc: $(top_builddir)/config.status |
133 | cd $(top_builddir) && $(SHELL) ./config.status $@ | |
134 | ||
5e9f2524 | 135 | lib/xmlparse.lo: lib/xmlparse.c lib/expat.h lib/xmlrole.h lib/xmltok.h \ |
11a3e7b6 | 136 | $(top_builddir)/expat_config.h lib/expat_external.h lib/internal.h |
5e9f2524 VS |
137 | |
138 | lib/xmlrole.lo: lib/xmlrole.c lib/ascii.h lib/xmlrole.h \ | |
11a3e7b6 | 139 | $(top_builddir)/expat_config.h lib/expat_external.h lib/internal.h |
5e9f2524 VS |
140 | |
141 | lib/xmltok.lo: lib/xmltok.c lib/xmltok_impl.c lib/xmltok_ns.c \ | |
142 | lib/ascii.h lib/asciitab.h lib/iasciitab.h lib/latin1tab.h \ | |
143 | lib/nametab.h lib/utf8tab.h lib/xmltok.h lib/xmltok_impl.h \ | |
11a3e7b6 | 144 | $(top_builddir)/expat_config.h lib/expat_external.h lib/internal.h |
5e9f2524 VS |
145 | |
146 | ||
11a3e7b6 VZ |
147 | XMLWF_OBJS = xmlwf/xmlwf.@OBJEXT@ xmlwf/xmlfile.@OBJEXT@ xmlwf/codepage.@OBJEXT@ xmlwf/@FILEMAP@.@OBJEXT@ |
148 | xmlwf/xmlwf.@OBJEXT@: xmlwf/xmlwf.c | |
149 | xmlwf/xmlfile.@OBJEXT@: xmlwf/xmlfile.c | |
150 | xmlwf/codepage.@OBJEXT@: xmlwf/codepage.c | |
151 | xmlwf/@FILEMAP@.@OBJEXT@: xmlwf/@FILEMAP@.c | |
152 | xmlwf/xmlwf@EXEEXT@: $(XMLWF_OBJS) $(LIBRARY) | |
5e9f2524 VS |
153 | $(LINK_EXE) $(XMLWF_OBJS) $(LIBRARY) |
154 | ||
11a3e7b6 VZ |
155 | examples/elements.@OBJEXT@: examples/elements.c |
156 | examples/elements: examples/elements.@OBJEXT@ $(LIBRARY) | |
5e9f2524 VS |
157 | $(LINK_EXE) $< $(LIBRARY) |
158 | ||
11a3e7b6 VZ |
159 | examples/outline.@OBJEXT@: examples/outline.c |
160 | examples/outline: examples/outline.@OBJEXT@ $(LIBRARY) | |
5e9f2524 VS |
161 | $(LINK_EXE) $< $(LIBRARY) |
162 | ||
11a3e7b6 VZ |
163 | tests/chardata.@OBJEXT@: tests/chardata.c tests/chardata.h |
164 | tests/minicheck.@OBJEXT@: tests/minicheck.c tests/minicheck.h | |
165 | tests/runtests.@OBJEXT@: tests/runtests.c tests/chardata.h | |
166 | tests/runtests: tests/runtests.@OBJEXT@ tests/chardata.@OBJEXT@ tests/minicheck.@OBJEXT@ $(LIBRARY) | |
167 | $(LINK_EXE) tests/runtests.@OBJEXT@ tests/chardata.@OBJEXT@ tests/minicheck.@OBJEXT@ $(LIBRARY) | |
168 | tests/runtestspp.@OBJEXT@: tests/runtestspp.cpp tests/runtests.c tests/chardata.h | |
169 | tests/runtestspp: tests/runtestspp.@OBJEXT@ tests/chardata.@OBJEXT@ tests/minicheck.@OBJEXT@ $(LIBRARY) | |
170 | $(LINK_CXX_EXE) tests/runtestspp.@OBJEXT@ tests/chardata.@OBJEXT@ tests/minicheck.@OBJEXT@ $(LIBRARY) | |
171 | ||
172 | tests/benchmark/benchmark.@OBJEXT@: tests/benchmark/benchmark.c | |
173 | tests/benchmark/benchmark: tests/benchmark/benchmark.@OBJEXT@ $(LIBRARY) | |
174 | $(LINK_EXE) tests/benchmark/benchmark.@OBJEXT@ $(LIBRARY) | |
175 | ||
176 | run-benchmark: tests/benchmark/benchmark | |
177 | tests/benchmark/benchmark@EXEEXT@ -n $(top_srcdir)/../testdata/largefiles/recset.xml 65535 3 | |
5e9f2524 VS |
178 | |
179 | tests/xmlts.zip: | |
180 | wget --output-document=tests/xmlts.zip \ | |
11a3e7b6 | 181 | http://www.w3.org/XML/Test/xmlts20080827.zip |
5e9f2524 VS |
182 | |
183 | tests/XML-Test-Suite: tests/xmlts.zip | |
184 | cd tests && unzip -q xmlts.zip | |
185 | ||
11a3e7b6 | 186 | run-xmltest: xmlwf/xmlwf@EXEEXT@ tests/XML-Test-Suite |
5e9f2524 VS |
187 | tests/xmltest.sh |
188 | ||
11a3e7b6 | 189 | .SUFFIXES: .c .cpp .lo .@OBJEXT@ |
5e9f2524 | 190 | |
11a3e7b6 VZ |
191 | .cpp.@OBJEXT@: |
192 | $(CXXCOMPILE) -o $@ -c $< | |
193 | .c.@OBJEXT@: | |
5e9f2524 VS |
194 | $(COMPILE) -o $@ -c $< |
195 | .c.lo: | |
196 | $(LTCOMPILE) -o $@ -c $< | |
197 | ||
198 | .PHONY: buildlib all \ | |
199 | clean distclean extraclean maintainer-clean \ | |
200 | dist distdir \ | |
201 | install uninstall |