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@ |
---|
33 | mandir = ${prefix}/man/man1 |
---|
34 | |
---|
35 | top_builddir = . |
---|
36 | |
---|
37 | |
---|
38 | INSTALL = @INSTALL@ |
---|
39 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ |
---|
40 | INSTALL_DATA = @INSTALL_DATA@ |
---|
41 | mkinstalldirs = $(SHELL) $(top_srcdir)/conftools/mkinstalldirs |
---|
42 | |
---|
43 | MANFILE = $(srcdir)/doc/xmlwf.1 |
---|
44 | APIHEADER = $(srcdir)/lib/expat.h |
---|
45 | LIBRARY = libexpat.la |
---|
46 | |
---|
47 | |
---|
48 | default: buildlib xmlwf/xmlwf |
---|
49 | |
---|
50 | buildlib: $(LIBRARY) |
---|
51 | |
---|
52 | all: $(LIBRARY) xmlwf/xmlwf examples/elements examples/outline |
---|
53 | |
---|
54 | clean: |
---|
55 | cd lib && rm -f $(LIBRARY) *.o *.lo && rm -rf .libs _libs |
---|
56 | cd xmlwf && rm -f xmlwf *.o *.lo && rm -rf .libs _libs |
---|
57 | cd examples && rm -f elements outline *.o *.lo && rm -rf .libs _libs |
---|
58 | cd tests && rm -rf .libs runtests runtests.o chardata.o |
---|
59 | rm -rf .libs libexpat.la |
---|
60 | find . -name core | xargs rm -f |
---|
61 | |
---|
62 | distclean: clean |
---|
63 | rm -f expat_config.h config.status config.log config.cache libtool |
---|
64 | rm -f Makefile |
---|
65 | |
---|
66 | extraclean: distclean |
---|
67 | rm -f expat_config.h.in configure |
---|
68 | rm -f conftools/ltconfig conftools/ltmain.sh conftools/libtool.m4 |
---|
69 | |
---|
70 | check: tests/runtests |
---|
71 | tests/runtests |
---|
72 | |
---|
73 | install: xmlwf/xmlwf installlib |
---|
74 | $(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(mandir) |
---|
75 | $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) xmlwf/xmlwf $(DESTDIR)$(bindir)/xmlwf |
---|
76 | $(INSTALL_DATA) $(MANFILE) $(DESTDIR)$(mandir) |
---|
77 | |
---|
78 | installlib: $(LIBRARY) $(APIHEADER) |
---|
79 | $(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir) |
---|
80 | $(LIBTOOL) --mode=install $(INSTALL) $(LIBRARY) $(DESTDIR)$(libdir)/$(LIBRARY) |
---|
81 | $(INSTALL_DATA) $(APIHEADER) $(DESTDIR)$(includedir) |
---|
82 | |
---|
83 | uninstall: uninstalllib |
---|
84 | $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(bindir)/xmlwf |
---|
85 | rm -f $(DESTDIR)$(mandir)/xmlwf.1 |
---|
86 | |
---|
87 | uninstalllib: |
---|
88 | $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$(LIBRARY) |
---|
89 | rm -f $(DESTDIR)$(includedir)/$(APIHEADER) |
---|
90 | |
---|
91 | # for VPATH builds (invoked by configure) |
---|
92 | mkdir-init: |
---|
93 | @for d in lib xmlwf examples tests ; do \ |
---|
94 | (mkdir $$d 2> /dev/null || test 1) ; \ |
---|
95 | done |
---|
96 | |
---|
97 | CC = @CC@ |
---|
98 | LIBTOOL = @LIBTOOL@ |
---|
99 | |
---|
100 | INCLUDES = -I$(srcdir)/lib -I. |
---|
101 | LDFLAGS = @LDFLAGS@ |
---|
102 | CPPFLAGS = @CPPFLAGS@ |
---|
103 | CFLAGS = @CFLAGS@ |
---|
104 | VSNFLAG = -version-info @LIBCURRENT@:@LIBREVISION@:@LIBAGE@ |
---|
105 | |
---|
106 | ### autoconf this? |
---|
107 | LTFLAGS = --silent |
---|
108 | |
---|
109 | COMPILE = $(CC) $(CFLAGS) $(DEFS) $(CPPFLAGS) $(INCLUDES) |
---|
110 | LTCOMPILE = $(LIBTOOL) $(LTFLAGS) --mode=compile $(COMPILE) |
---|
111 | LINK_LIB = $(LIBTOOL) $(LTFLAGS) --mode=link $(COMPILE) -no-undefined $(VSNFLAG) -rpath $(libdir) $(LDFLAGS) -o $@ |
---|
112 | LINK_EXE = $(LIBTOOL) $(LTFLAGS) --mode=link $(COMPILE) $(LDFLAGS) -o $@ |
---|
113 | |
---|
114 | LIB_OBJS = lib/xmlparse.lo lib/xmltok.lo lib/xmlrole.lo |
---|
115 | $(LIBRARY): $(LIB_OBJS) |
---|
116 | $(LINK_LIB) $(LIB_OBJS) |
---|
117 | |
---|
118 | lib/xmlparse.lo: lib/xmlparse.c lib/expat.h lib/xmlrole.h lib/xmltok.h \ |
---|
119 | $(top_builddir)/expat_config.h lib/internal.h |
---|
120 | |
---|
121 | lib/xmlrole.lo: lib/xmlrole.c lib/ascii.h lib/xmlrole.h \ |
---|
122 | $(top_builddir)/expat_config.h lib/internal.h |
---|
123 | |
---|
124 | lib/xmltok.lo: lib/xmltok.c lib/xmltok_impl.c lib/xmltok_ns.c \ |
---|
125 | lib/ascii.h lib/asciitab.h lib/iasciitab.h lib/latin1tab.h \ |
---|
126 | lib/nametab.h lib/utf8tab.h lib/xmltok.h lib/xmltok_impl.h \ |
---|
127 | $(top_builddir)/expat_config.h |
---|
128 | |
---|
129 | |
---|
130 | XMLWF_OBJS = xmlwf/xmlwf.o xmlwf/xmlfile.o xmlwf/codepage.o xmlwf/@FILEMAP@.o |
---|
131 | xmlwf/xmlwf.o: xmlwf/xmlwf.c |
---|
132 | xmlwf/xmlfile.o: xmlwf/xmlfile.c |
---|
133 | xmlwf/codepage.o: xmlwf/codepage.c |
---|
134 | xmlwf/@FILEMAP@.o: xmlwf/@FILEMAP@.c |
---|
135 | xmlwf/xmlwf: $(XMLWF_OBJS) $(LIBRARY) |
---|
136 | $(LINK_EXE) $(XMLWF_OBJS) $(LIBRARY) |
---|
137 | |
---|
138 | examples/elements.o: examples/elements.c |
---|
139 | examples/elements: examples/elements.o $(LIBRARY) |
---|
140 | $(LINK_EXE) $< $(LIBRARY) |
---|
141 | |
---|
142 | examples/outline.o: examples/outline.c |
---|
143 | examples/outline: examples/outline.o $(LIBRARY) |
---|
144 | $(LINK_EXE) $< $(LIBRARY) |
---|
145 | |
---|
146 | tests/chardata.o: tests/chardata.c tests/chardata.h |
---|
147 | tests/runtests.o: tests/runtests.c tests/chardata.h |
---|
148 | tests/runtests: tests/runtests.o tests/chardata.o $(LIBRARY) |
---|
149 | $(LINK_EXE) $^ -lcheck |
---|
150 | |
---|
151 | tests/xmlts.zip: |
---|
152 | wget --output-document=tests/xmlts.zip \ |
---|
153 | http://www.w3.org/XML/Test/xmlts20020606.zip |
---|
154 | |
---|
155 | tests/XML-Test-Suite: tests/xmlts.zip |
---|
156 | cd tests && unzip -q xmlts.zip |
---|
157 | |
---|
158 | run-xmltest: xmlwf/xmlwf tests/XML-Test-Suite |
---|
159 | tests/xmltest.sh |
---|
160 | |
---|
161 | .SUFFIXES: .c .lo .o |
---|
162 | |
---|
163 | .c.o: |
---|
164 | $(COMPILE) -o $@ -c $< |
---|
165 | .c.lo: |
---|
166 | $(LTCOMPILE) -o $@ -c $< |
---|
167 | |
---|
168 | .PHONY: buildlib all \ |
---|
169 | clean distclean extraclean maintainer-clean \ |
---|
170 | dist distdir \ |
---|
171 | install uninstall |
---|