mxml/Makefile.in

372 lines
7.7 KiB
Makefile
Raw Normal View History

2003-06-03 19:46:29 +00:00
#
2005-01-29 07:21:44 +00:00
# "$Id$"
2003-06-03 19:46:29 +00:00
#
# Makefile for Mini-XML, a small XML-like file parsing library.
2003-06-03 19:46:29 +00:00
#
# Copyright 2003-2007 by Michael Sweet.
2003-06-03 19:46:29 +00:00
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; either
# version 2, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
#
# Compiler tools definitions...
#
AR = @AR@
ARFLAGS = @ARFLAGS@
CC = @CC@
2003-06-15 00:44:34 +00:00
CFLAGS = $(OPTIM) @CFLAGS@ @CPPFLAGS@
CP = @CP@
2005-02-26 03:10:23 +00:00
DSO = @DSO@
DSOFLAGS = @DSOFLAGS@
2003-06-15 00:44:34 +00:00
LDFLAGS = $(OPTIM) @LDFLAGS@
INSTALL = @INSTALL@
2005-02-26 03:10:23 +00:00
LIBMXML = @LIBMXML@
LN = @LN@ -s
2003-06-15 00:44:34 +00:00
MKDIR = @MKDIR@
NROFF = @NROFF@
OPTIM = @OPTIM@
2003-06-03 19:46:29 +00:00
RANLIB = @RANLIB@
2003-06-15 00:44:34 +00:00
RM = @RM@ -f
2003-06-03 19:46:29 +00:00
SHELL = /bin/sh
#
# Configured directories...
#
prefix = @prefix@
exec_prefix = @exec_prefix@
2003-06-15 00:44:34 +00:00
bindir = @bindir@
2003-06-03 19:46:29 +00:00
includedir = @includedir@
libdir = @libdir@
2003-06-15 00:44:34 +00:00
mandir = @mandir@
docdir = @docdir@
BUILDROOT = $(DSTROOT)
#
# Manpage extensions...
#
CAT1EXT = @CAT1EXT@
2003-06-15 01:22:37 +00:00
CAT3EXT = @CAT3EXT@
2003-06-15 00:44:34 +00:00
MAN1EXT = @MAN1EXT@
2003-06-15 01:22:37 +00:00
MAN3EXT = @MAN3EXT@
2003-06-03 19:46:29 +00:00
#
# Install commands...
#
INSTALL_BIN = $(LIBTOOL) $(INSTALL) -m 755 -s
INSTALL_DATA = $(INSTALL) -m 644
INSTALL_DIR = $(INSTALL) -d
INSTALL_LIB = $(LIBTOOL) $(INSTALL) -m 755
INSTALL_MAN = $(INSTALL) -m 644
INSTALL_SCRIPT = $(INSTALL) -m 755
2003-06-03 19:46:29 +00:00
#
# Rules...
#
2003-06-15 01:22:37 +00:00
.SUFFIXES: .0 .1 .3 .c .man .o
2003-06-03 19:46:29 +00:00
.c.o:
$(CC) $(CFLAGS) -c $<
2003-06-15 01:22:37 +00:00
.man.0 .man.1 .man.3:
2003-06-15 00:44:34 +00:00
$(RM) $@
$(NROFF) -man $< >$@
2003-06-03 19:46:29 +00:00
#
# Targets...
#
2004-06-25 18:59:32 +00:00
DOCFILES = doc/mxml.html doc/mxmldoc.xsd \
README COPYING CHANGES
2004-05-16 05:25:38 +00:00
PUBLIBOBJS = mxml-attr.o mxml-entity.o mxml-file.o mxml-index.o \
mxml-node.o mxml-search.o mxml-set.o
LIBOBJS = $(PUBLIBOBJS) mxml-private.o mxml-string.o
OBJS = mxmldoc.o testmxml.o $(LIBOBJS)
2005-02-26 03:10:23 +00:00
TARGETS = $(LIBMXML) mxmldoc doc/mxml.$(CAT3EXT) \
2004-05-01 23:41:52 +00:00
doc/mxmldoc.$(CAT1EXT) testmxml mxml.xml
2003-06-03 19:46:29 +00:00
#
# Make everything...
#
all: Makefile config.h $(TARGETS)
2003-06-03 19:46:29 +00:00
#
# Clean everything...
#
clean:
$(RM) $(OBJS) $(TARGETS) doc/mxml.man
2005-02-26 05:27:25 +00:00
$(RM) mxmldoc-static libmxml.a
2006-05-06 12:36:35 +00:00
#
# Really clean everything...
#
distclean: clean
2003-06-15 00:44:34 +00:00
$(RM) config.cache config.log config.status
2006-05-06 12:36:35 +00:00
$(RM) Makefile config.h
2003-06-15 00:44:34 +00:00
$(RM) -r autom4te*.cache
2006-05-06 12:36:35 +00:00
$(RM) *.bck *.bak
2003-06-03 19:46:29 +00:00
#
# Install everything...
#
2005-02-26 03:10:23 +00:00
install: $(TARGETS) install-$(LIBMXML) install-libmxml.a
$(INSTALL_DIR) $(BUILDROOT)$(bindir)
$(INSTALL_BIN) mxmldoc $(BUILDROOT)$(bindir)
$(INSTALL_DIR) $(BUILDROOT)$(docdir)
for file in $(DOCFILES); do \
$(INSTALL_MAN) $$file $(BUILDROOT)$(docdir); \
done
$(INSTALL_DIR) $(BUILDROOT)$(includedir)
$(INSTALL_DATA) mxml.h $(BUILDROOT)$(includedir)
$(INSTALL_DIR) $(BUILDROOT)$(libdir)/pkgconfig
$(INSTALL_DATA) mxml.pc $(BUILDROOT)$(libdir)/pkgconfig
$(INSTALL_DIR) $(BUILDROOT)$(mandir)/cat1
$(INSTALL_MAN) doc/mxmldoc.$(CAT1EXT) $(BUILDROOT)$(mandir)/cat1/mxmldoc.$(CAT1EXT)
$(INSTALL_DIR) $(BUILDROOT)$(mandir)/cat3
$(INSTALL_MAN) doc/mxml.$(CAT3EXT) $(BUILDROOT)$(mandir)/cat3/mxml.$(CAT3EXT)
$(INSTALL_DIR) $(BUILDROOT)$(mandir)/man1
$(INSTALL_MAN) doc/mxmldoc.man $(BUILDROOT)$(mandir)/man1/mxmldoc.$(MAN1EXT)
$(INSTALL_DIR) $(BUILDROOT)$(mandir)/man3
$(INSTALL_MAN) doc/mxml.man $(BUILDROOT)$(mandir)/man3/mxml.$(MAN3EXT)
2003-06-03 19:46:29 +00:00
2005-02-26 03:10:23 +00:00
install-libmxml.a:
$(INSTALL_DIR) $(BUILDROOT)$(libdir)
$(INSTALL_LIB) libmxml.a $(BUILDROOT)$(libdir)
$(RANLIB) $(BUILDROOT)$(libdir)/libmxml.a
2005-02-26 03:10:23 +00:00
install-libmxml.so.1.3:
$(INSTALL_DIR) $(BUILDROOT)$(libdir)
$(INSTALL_LIB) libmxml.so.1.3 $(BUILDROOT)$(libdir)
2005-02-26 03:10:23 +00:00
$(RM) $(BUILDROOT)$(libdir)/libmxml.so
$(LN) libmxml.so.1.3 $(BUILDROOT)$(libdir)/libmxml.so
2005-02-26 03:10:23 +00:00
$(RM) $(BUILDROOT)$(libdir)/libmxml.so.1
$(LN) libmxml.so.1.3 $(BUILDROOT)$(libdir)/libmxml.so.1
2005-02-26 03:10:23 +00:00
install-libmxml.sl.1:
$(INSTALL_DIR) $(BUILDROOT)$(libdir)
$(INSTALL_LIB) libmxml.sl.1 $(BUILDROOT)$(libdir)
2005-02-26 03:10:23 +00:00
$(RM) $(BUILDROOT)$(libdir)/libmxml.so
$(LN) libmxml.sl.1 $(BUILDROOT)$(libdir)/libmxml.sl
install-libmxml.1.dylib:
$(INSTALL_DIR) $(BUILDROOT)$(libdir)
$(INSTALL_LIB) libmxml.1.dylib $(BUILDROOT)$(libdir)
2005-02-26 03:10:23 +00:00
$(RM) $(BUILDROOT)$(libdir)/libmxml.dylib
$(LN) libmxml.1.dylib $(BUILDROOT)$(libdir)/libmxml.dylib
2003-06-03 19:46:29 +00:00
#
# Uninstall everything...
#
2005-02-26 03:10:23 +00:00
uninstall: uninstall-$(LIBMXML) uninstall-libmxml.a
2004-02-04 21:24:03 +00:00
$(RM) $(BUILDROOT)$(bindir)/mxmldoc
$(RM) -r $(BUILDROOT)$(docdir)
$(RM) $(BUILDROOT)$(includedir)/mxml.h
$(RM) $(BUILDROOT)$(libdir)/pkgconfig/mxml.pc
2004-02-04 21:24:03 +00:00
$(RM) $(BUILDROOT)$(mandir)/cat1/mxmldoc.$(CAT1EXT)
$(RM) $(BUILDROOT)$(mandir)/cat3/mxml.$(CAT3EXT)
$(RM) $(BUILDROOT)$(mandir)/man1/mxmldoc.$(MAN1EXT)
$(RM) $(BUILDROOT)$(mandir)/man3/mxml.$(MAN3EXT)
2005-02-26 03:10:23 +00:00
uninstall-libmxml.a:
$(RM) $(BUILDROOT)$(libdir)/libmxml.a
uninstall-libmxml.so.1.3:
2005-02-26 03:10:23 +00:00
$(RM) $(BUILDROOT)$(libdir)/libmxml.so
$(RM) $(BUILDROOT)$(libdir)/libmxml.so.1
$(RM) $(BUILDROOT)$(libdir)/libmxml.so.1.3
2005-02-26 03:10:23 +00:00
uninstall-libmxml.sl.1:
$(RM) $(BUILDROOT)$(libdir)/libmxml.sl
$(RM) $(BUILDROOT)$(libdir)/libmxml.sl.1
uninstall-libmxml.1.dylib:
$(RM) $(BUILDROOT)$(libdir)/libmxml.dylib
$(RM) $(BUILDROOT)$(libdir)/libmxml.1.dylib
#
# Make packages using EPM (http://www.easysw.com/epm/)
#
epm: all
epm --output-dir dist -v -f native mxml
epm --output-dir dist -v -f portable mxml
#
# autoconf stuff...
#
Makefile: configure Makefile.in
if test -f config.status; then \
./config.status --recheck; \
./config.status; \
else \
./configure; \
fi
touch config.h
config.h: configure config.h.in
autoconf
if test -f config.status; then \
./config.status --recheck; \
./config.status; \
else \
./configure; \
fi
touch config.h
2003-06-03 19:46:29 +00:00
#
# libmxml.a
#
libmxml.a: $(LIBOBJS)
2003-06-15 00:44:34 +00:00
$(RM) $@
2003-06-03 19:46:29 +00:00
$(AR) $(ARFLAGS) $@ $(LIBOBJS)
$(RANLIB) $@
$(LIBOBJS): mxml.h
2005-02-26 03:10:23 +00:00
#
# libmxml.so.1.3
2005-02-26 03:10:23 +00:00
#
libmxml.so.1.3: $(LIBOBJS)
$(DSO) $(DSOFLAGS) -o libmxml.so.1.3 $(LIBOBJS)
2005-02-26 03:10:23 +00:00
$(RM) libmxml.so libmxml.so.1
$(LN) libmxml.so.1.3 libmxml.so
$(LN) libmxml.so.1.3 libmxml.so.1
2005-02-26 03:10:23 +00:00
#
# libmxml.sl.1
#
libmxml.sl.1: $(LIBOBJS)
$(DSO) $(DSOFLAGS) -o libmxml.sl.1 $(LIBOBJS)
$(RM) libmxml.sl libmxml.sl.1
$(LN) libmxml.sl.1 libmxml.sl
#
# libmxml.1.dylib
#
libmxml.1.dylib: $(LIBOBJS)
$(DSO) $(DSOFLAGS) -o libmxml.1.dylib \
-install_name $(libdir)/libmxml.dylib \
-current_version 1.3.0 \
2005-02-26 03:10:23 +00:00
-compatibility_version 1.0.0 \
$(LIBOBJS)
$(RM) libmxml.dylib libmxml.1.dylib
$(LN) libmxml.1.dylib libmxml.dylib
#
# mxmldoc
#
2005-02-26 03:10:23 +00:00
mxmldoc: $(LIBMXML) mxmldoc.o
2006-09-11 00:29:01 +00:00
$(CC) -L. $(LDFLAGS) -o $@ mxmldoc.o -lmxml
2005-02-26 03:10:23 +00:00
mxmldoc-static: libmxml.a mxmldoc.o
$(CC) $(LDFLAGS) -o $@ mxmldoc.o libmxml.a
mxmldoc.o: mxml.h
2003-06-03 19:46:29 +00:00
#
# testmxml
#
testmxml: libmxml.a testmxml.o
$(CC) $(LDFLAGS) -o $@ testmxml.o libmxml.a
2003-06-04 00:12:12 +00:00
@echo Testing library...
2003-07-20 13:49:09 +00:00
./testmxml test.xml >temp1.xml 2>temp1s.xml
./testmxml temp1.xml >temp2.xml 2>temp2s.xml
2003-06-04 00:12:12 +00:00
@if cmp temp1.xml temp2.xml; then \
2004-07-11 13:26:25 +00:00
echo Stdio file test passed!; \
2003-07-20 13:49:09 +00:00
$(RM) temp2.xml temp2s.xml; \
2003-06-04 00:12:12 +00:00
else \
2004-07-11 13:26:25 +00:00
echo Stdio file test failed!; \
2003-07-20 13:49:09 +00:00
fi
@if cmp temp1.xml temp1s.xml; then \
echo String test passed!; \
$(RM) temp1.xml temp1s.xml; \
else \
echo String test failed!; \
2003-06-04 00:12:12 +00:00
fi
2004-07-11 13:26:25 +00:00
@if cmp test.xml test.xmlfd; then \
echo File descriptor test passed!; \
$(RM) test.xmlfd; \
else \
echo File descriptor test failed!; \
fi
2003-06-03 19:46:29 +00:00
testmxml.o: mxml.h
2003-06-05 13:49:14 +00:00
#
# mxml.xml
#
2005-02-26 03:10:23 +00:00
mxml.xml: mxmldoc-static mxml.h $(PUBLIBOBJS:.o=.c)
2003-06-15 00:44:34 +00:00
$(RM) mxml.xml
2005-02-26 03:10:23 +00:00
./mxmldoc-static mxml.xml mxml.h $(PUBLIBOBJS:.o=.c) >doc/reference.html
2003-06-05 13:49:14 +00:00
2005-02-26 03:10:23 +00:00
valgrind: mxmldoc-static
$(RM) valgrind.xml
2005-02-26 05:27:25 +00:00
valgrind --tool=memcheck --leak-check=yes ./mxmldoc-static \
valgrind.xml mxml.h $(PUBLIBOBJS:.o=.c) \
>valgrind.html 2>valgrind.out
2003-06-05 13:49:14 +00:00
#
# doc/mxml.man
#
doc/mxml.man: mxmldoc-static mxml.xml
$(RM) doc/mxml.man
./mxmldoc-static --man mxml --title "Mini-XML API" \
--intro doc/intro.man mxml.xml >doc/mxml.man
#
# All object files depend on the makefile...
#
$(OBJS): Makefile config.h
2003-06-04 00:12:12 +00:00
2003-06-03 19:46:29 +00:00
#
2005-01-29 07:21:44 +00:00
# End of "$Id$".
2003-06-03 19:46:29 +00:00
#