2
# "$Id: Makefile.in 23382 2006-04-29 15:44:02Z russell $"
4
# Makefile for Mini-XML, a small XML-like file parsing library.
6
# Copyright 2003-2005 by Michael Sweet.
8
# This program is free software; you can redistribute it and/or
9
# modify it under the terms of the GNU Library General Public
10
# License as published by the Free Software Foundation; either
11
# version 2, or (at your option) any later version.
13
# This program is distributed in the hope that it will be useful,
14
# but WITHOUT ANY WARRANTY; without even the implied warranty of
15
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
# GNU General Public License for more details.
20
# Compiler tools definitions...
26
CFLAGS = $(OPTIM) @CFLAGS@ @CPPFLAGS@
30
LDFLAGS = $(OPTIM) @LDFLAGS@
42
# Configured directories...
46
exec_prefix = @exec_prefix@
48
includedir = @includedir@
52
datarootdir = @datarootdir@
53
BUILDROOT = $(DSTROOT)
60
INSTALL_BIN = $(LIBTOOL) $(INSTALL) -m 755 -s
61
INSTALL_DATA = $(INSTALL) -m 644
62
INSTALL_DIR = $(INSTALL) -d
63
INSTALL_LIB = $(LIBTOOL) $(INSTALL) -m 755
64
INSTALL_MAN = $(INSTALL) -m 644
65
INSTALL_SCRIPT = $(INSTALL) -m 755
72
.SUFFIXES: .0 .1 .3 .c .man .o
84
DOCFILES = doc/mxml.html doc/mxmldoc.xsd \
85
README COPYING CHANGES
86
PUBLIBOBJS = mxml-attr.o mxml-entity.o mxml-file.o mxml-index.o \
87
mxml-node.o mxml-search.o mxml-set.o
88
LIBOBJS = $(PUBLIBOBJS) mxml-private.o mxml-string.o
89
OBJS = mxmldoc.o testmxml.o $(LIBOBJS)
90
TARGETS = $(LIBMXML) mxmldoc testmxml mxml.xml
97
all: Makefile configure config.h $(TARGETS)
101
# Clean everything...
105
$(RM) $(OBJS) $(TARGETS)
106
$(RM) mxmldoc-static libmxml.a
108
$(RM) config.cache config.log config.status config.h
109
$(RM) -r autom4te*.cache
112
$(RM) mxml.list Makefile
115
# Install everything...
118
install: $(TARGETS) install-$(LIBMXML) install-libmxml.a
119
$(INSTALL_DIR) $(BUILDROOT)$(bindir)
120
$(INSTALL_BIN) mxmldoc $(BUILDROOT)$(bindir)
121
$(INSTALL_DIR) $(BUILDROOT)$(docdir)
122
for file in $(DOCFILES); do \
123
$(INSTALL_MAN) $$file $(BUILDROOT)$(docdir); \
125
$(INSTALL_DIR) $(BUILDROOT)$(includedir)
126
$(INSTALL_DATA) mxml.h $(BUILDROOT)$(includedir)
127
$(INSTALL_DIR) $(BUILDROOT)$(libdir)/pkgconfig
128
$(INSTALL_DATA) mxml.pc $(BUILDROOT)$(libdir)/pkgconfig
129
$(INSTALL_DIR) $(BUILDROOT)$(mandir)/cat1
130
$(INSTALL_MAN) doc/mxmldoc.$(CAT1EXT) $(BUILDROOT)$(mandir)/cat1/mxmldoc.$(CAT1EXT)
131
$(INSTALL_DIR) $(BUILDROOT)$(mandir)/cat3
132
$(INSTALL_MAN) doc/mxml.$(CAT3EXT) $(BUILDROOT)$(mandir)/cat3/mxml.$(CAT3EXT)
133
$(INSTALL_DIR) $(BUILDROOT)$(mandir)/man1
134
$(INSTALL_MAN) doc/mxmldoc.man $(BUILDROOT)$(mandir)/man1/mxmldoc.$(MAN1EXT)
135
$(INSTALL_DIR) $(BUILDROOT)$(mandir)/man3
136
$(INSTALL_MAN) doc/mxml.man $(BUILDROOT)$(mandir)/man3/mxml.$(MAN3EXT)
139
$(INSTALL_DIR) $(BUILDROOT)$(libdir)
140
$(INSTALL_LIB) libmxml.a $(BUILDROOT)$(libdir)
142
install-libmxml.so.1.0:
143
$(INSTALL_DIR) $(BUILDROOT)$(libdir)
144
$(INSTALL_LIB) libmxml.so.1.0 $(BUILDROOT)$(libdir)
145
$(RM) $(BUILDROOT)$(libdir)/libmxml.so
146
$(LN) libmxml.so.1.0 $(BUILDROOT)$(libdir)/libmxml.so
147
$(RM) $(BUILDROOT)$(libdir)/libmxml.so.1
148
$(LN) libmxml.so.1.0 $(BUILDROOT)$(libdir)/libmxml.so.1
150
install-libmxml.sl.1:
151
$(INSTALL_DIR) $(BUILDROOT)$(libdir)
152
$(INSTALL_LIB) libmxml.sl.1 $(BUILDROOT)$(libdir)
153
$(RM) $(BUILDROOT)$(libdir)/libmxml.so
154
$(LN) libmxml.sl.1 $(BUILDROOT)$(libdir)/libmxml.sl
156
install-libmxml.1.dylib:
157
$(INSTALL_DIR) $(BUILDROOT)$(libdir)
158
$(INSTALL_LIB) libmxml.1.dylib $(BUILDROOT)$(libdir)
159
$(RM) $(BUILDROOT)$(libdir)/libmxml.dylib
160
$(LN) libmxml.1.dylib $(BUILDROOT)$(libdir)/libmxml.dylib
164
# Uninstall everything...
167
uninstall: uninstall-$(LIBMXML) uninstall-libmxml.a
168
$(RM) $(BUILDROOT)$(bindir)/mxmldoc
169
$(RM) -r $(BUILDROOT)$(docdir)
170
$(RM) $(BUILDROOT)$(includedir)/mxml.h
171
$(RM) $(BUILDROOT)$(libdir)/pkgconfig/mxml.pc
172
$(RM) $(BUILDROOT)$(mandir)/cat1/mxmldoc.$(CAT1EXT)
173
$(RM) $(BUILDROOT)$(mandir)/cat3/mxml.$(CAT3EXT)
174
$(RM) $(BUILDROOT)$(mandir)/man1/mxmldoc.$(MAN1EXT)
175
$(RM) $(BUILDROOT)$(mandir)/man3/mxml.$(MAN3EXT)
178
$(RM) $(BUILDROOT)$(libdir)/libmxml.a
180
uninstall-libmxml.so.1.0:
181
$(RM) $(BUILDROOT)$(libdir)/libmxml.so
182
$(RM) $(BUILDROOT)$(libdir)/libmxml.so.1
183
$(RM) $(BUILDROOT)$(libdir)/libmxml.so.1.0
185
uninstall-libmxml.sl.1:
186
$(RM) $(BUILDROOT)$(libdir)/libmxml.sl
187
$(RM) $(BUILDROOT)$(libdir)/libmxml.sl.1
189
uninstall-libmxml.1.dylib:
190
$(RM) $(BUILDROOT)$(libdir)/libmxml.dylib
191
$(RM) $(BUILDROOT)$(libdir)/libmxml.1.dylib
195
# Make packages using EPM (http://www.easysw.com/epm/)
199
epm --output-dir dist -v -f native mxml
200
epm --output-dir dist -v -f portable mxml
207
Makefile: Makefile.in
208
if test -f config.status; then \
209
./config.status --recheck; \
217
config.h: configure config.h.in
218
if test -f config.status; then \
219
./config.status --recheck; \
231
libmxml.a: $(LIBOBJS)
233
$(AR) $(ARFLAGS) $@ $(LIBOBJS)
243
libmxml.so.1.0: $(LIBOBJS)
244
$(DSO) $(DSOFLAGS) -o libmxml.so.1.0 $(LIBOBJS)
245
$(RM) libmxml.so libmxml.so.1
246
$(LN) libmxml.so.1.0 libmxml.so
247
$(LN) libmxml.so.1.0 libmxml.so.1
254
libmxml.sl.1: $(LIBOBJS)
255
$(DSO) $(DSOFLAGS) -o libmxml.sl.1 $(LIBOBJS)
256
$(RM) libmxml.sl libmxml.sl.1
257
$(LN) libmxml.sl.1 libmxml.sl
264
libmxml.1.dylib: $(LIBOBJS)
265
$(DSO) $(DSOFLAGS) -o libmxml.1.dylib \
266
-install_name $(libdir)/libmxml.dylib \
267
-current_version 1.0.0 \
268
-compatibility_version 1.0.0 \
270
$(RM) libmxml.dylib libmxml.1.dylib
271
$(LN) libmxml.1.dylib libmxml.dylib
278
mxmldoc: $(LIBMXML) mxmldoc.o
279
$(CC) $(LDFLAGS) -o $@ mxmldoc.o -L. -lmxml
281
mxmldoc-static: libmxml.a mxmldoc.o
282
$(CC) $(LDFLAGS) -o $@ mxmldoc.o libmxml.a
291
testmxml: libmxml.a testmxml.o
292
$(CC) $(LDFLAGS) -o $@ testmxml.o libmxml.a
293
@echo Testing library...
294
./testmxml test.xml >temp1.xml 2>temp1s.xml
295
./testmxml temp1.xml >temp2.xml 2>temp2s.xml
296
@if cmp temp1.xml temp2.xml; then \
297
echo Stdio file test passed!; \
298
$(RM) temp2.xml temp2s.xml; \
300
echo Stdio file test failed!; \
302
@if cmp temp1.xml temp1s.xml; then \
303
echo String test passed!; \
304
$(RM) temp1.xml temp1s.xml; \
306
echo String test failed!; \
308
@if cmp test.xml test.xmlfd; then \
309
echo File descriptor test passed!; \
312
echo File descriptor test failed!; \
322
mxml.xml: mxmldoc-static mxml.h $(PUBLIBOBJS:.o=.c)
324
./mxmldoc-static mxml.xml mxml.h $(PUBLIBOBJS:.o=.c) >doc/reference.html
326
valgrind: mxmldoc-static
328
valgrind --tool=memcheck --leak-check=yes ./mxmldoc-static \
329
valgrind.xml mxml.h $(PUBLIBOBJS:.o=.c) \
330
>valgrind.html 2>valgrind.out
334
# All object files depend on the makefile...
337
$(OBJS): Makefile config.h
341
# End of "$Id: Makefile.in 23382 2006-04-29 15:44:02Z russell $".