mirror of
https://github.com/michaelrsweet/mxml.git
synced 2024-11-17 08:25:31 +00:00
262 lines
5.1 KiB
Makefile
262 lines
5.1 KiB
Makefile
#
|
|
# "$Id: Makefile.in,v 1.21 2004/05/16 05:25:38 mike Exp $"
|
|
#
|
|
# Makefile for Mini-XML, a small XML-like file parsing library.
|
|
#
|
|
# Copyright 2003-2004 by Michael Sweet.
|
|
#
|
|
# 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@
|
|
CFLAGS = $(OPTIM) @CFLAGS@ @CPPFLAGS@
|
|
CP = @CP@
|
|
LDFLAGS = $(OPTIM) @LDFLAGS@
|
|
MKDIR = @MKDIR@
|
|
NROFF = @NROFF@
|
|
OPTIM = @OPTIM@
|
|
RANLIB = @RANLIB@
|
|
RM = @RM@ -f
|
|
SHELL = /bin/sh
|
|
|
|
|
|
#
|
|
# Configured directories...
|
|
#
|
|
|
|
prefix = @prefix@
|
|
exec_prefix = @exec_prefix@
|
|
bindir = @bindir@
|
|
includedir = @includedir@
|
|
libdir = @libdir@
|
|
mandir = @mandir@
|
|
docdir = @docdir@
|
|
BUILDROOT = $(DSTROOT)
|
|
|
|
|
|
#
|
|
# Manpage extensions...
|
|
#
|
|
|
|
CAT1EXT = @CAT1EXT@
|
|
CAT3EXT = @CAT3EXT@
|
|
MAN1EXT = @MAN1EXT@
|
|
MAN3EXT = @MAN3EXT@
|
|
|
|
|
|
#
|
|
# Rules...
|
|
#
|
|
|
|
.SUFFIXES: .0 .1 .3 .c .man .o
|
|
.c.o:
|
|
$(CC) $(CFLAGS) -c $<
|
|
.man.0 .man.1 .man.3:
|
|
$(RM) $@
|
|
$(NROFF) -man $< >$@
|
|
|
|
|
|
#
|
|
# Targets...
|
|
#
|
|
|
|
DOCFILES = doc/mxml.html doc/mxml.pdf doc/mxmldoc.xsd \
|
|
README COPYING CHANGES
|
|
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)
|
|
TARGETS = libmxml.a mxmldoc doc/mxml.$(CAT3EXT) \
|
|
doc/mxmldoc.$(CAT1EXT) testmxml mxml.xml
|
|
|
|
|
|
#
|
|
# Make everything...
|
|
#
|
|
|
|
all: Makefile configure config.h $(TARGETS)
|
|
|
|
|
|
#
|
|
# Clean everything...
|
|
#
|
|
|
|
clean:
|
|
$(RM) $(OBJS) $(TARGETS)
|
|
$(RM) *.bck *.bak
|
|
$(RM) config.cache config.log config.status
|
|
$(RM) -r autom4te*.cache
|
|
|
|
|
|
#
|
|
# Install everything...
|
|
#
|
|
|
|
install: $(TARGETS)
|
|
-$(MKDIR) -p $(BUILDROOT)$(bindir)
|
|
$(CP) mxmldoc $(BUILDROOT)$(bindir)
|
|
-$(MKDIR) -p $(BUILDROOT)$(docdir)
|
|
$(CP) $(DOCFILES) $(BUILDROOT)$(docdir)
|
|
-$(MKDIR) -p $(BUILDROOT)$(includedir)
|
|
$(CP) mxml.h $(BUILDROOT)$(includedir)
|
|
-$(MKDIR) -p $(BUILDROOT)$(libdir)
|
|
$(CP) libmxml.a $(BUILDROOT)$(libdir)
|
|
-$(MKDIR) -p $(BUILDROOT)$(libdir)/pkgconfig
|
|
$(CP) mxml.pc $(BUILDROOT)$(libdir)/pkgconfig
|
|
-$(MKDIR) -p $(BUILDROOT)$(mandir)/cat1
|
|
$(CP) doc/mxmldoc.$(CAT1EXT) $(BUILDROOT)$(mandir)/cat1/mxmldoc.$(CAT1EXT)
|
|
-$(MKDIR) -p $(BUILDROOT)$(mandir)/cat3
|
|
$(CP) doc/mxml.$(CAT3EXT) $(BUILDROOT)$(mandir)/cat3/mxml.$(CAT3EXT)
|
|
-$(MKDIR) -p $(BUILDROOT)$(mandir)/man1
|
|
$(CP) doc/mxmldoc.man $(BUILDROOT)$(mandir)/man1/mxmldoc.$(MAN1EXT)
|
|
-$(MKDIR) -p $(BUILDROOT)$(mandir)/man3
|
|
$(CP) doc/mxml.man $(BUILDROOT)$(mandir)/man3/mxml.$(MAN3EXT)
|
|
|
|
|
|
#
|
|
# Uninstall everything...
|
|
#
|
|
|
|
uninstall:
|
|
$(RM) $(BUILDROOT)$(bindir)/mxmldoc
|
|
$(RM) -r $(BUILDROOT)$(docdir)
|
|
$(RM) $(BUILDROOT)$(includedir)/mxml.h
|
|
$(RM) $(BUILDROOT)$(libdir)/libmxml.a
|
|
$(RM) $(BUILDROOT)$(libdir)/pkgconfig/mxml.pc
|
|
$(RM) $(BUILDROOT)$(mandir)/cat1/mxmldoc.$(CAT1EXT)
|
|
$(RM) $(BUILDROOT)$(mandir)/cat3/mxml.$(CAT3EXT)
|
|
$(RM) $(BUILDROOT)$(mandir)/man1/mxmldoc.$(MAN1EXT)
|
|
$(RM) $(BUILDROOT)$(mandir)/man3/mxml.$(MAN3EXT)
|
|
|
|
|
|
#
|
|
# 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
|
|
|
|
|
|
configure: configure.in
|
|
autoconf
|
|
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
|
|
|
|
|
|
#
|
|
# libmxml.a
|
|
#
|
|
|
|
libmxml.a: $(LIBOBJS)
|
|
$(RM) $@
|
|
$(AR) $(ARFLAGS) $@ $(LIBOBJS)
|
|
$(RANLIB) $@
|
|
|
|
$(LIBOBJS): mxml.h
|
|
|
|
|
|
#
|
|
# mxmldoc
|
|
#
|
|
|
|
mxmldoc: libmxml.a mxmldoc.o
|
|
$(CC) $(LDFLAGS) -o $@ mxmldoc.o libmxml.a
|
|
|
|
mxmldoc.o: mxml.h
|
|
|
|
|
|
#
|
|
# testmxml
|
|
#
|
|
|
|
testmxml: libmxml.a testmxml.o
|
|
$(CC) $(LDFLAGS) -o $@ testmxml.o libmxml.a
|
|
@echo Testing library...
|
|
./testmxml test.xml >temp1.xml 2>temp1s.xml
|
|
./testmxml temp1.xml >temp2.xml 2>temp2s.xml
|
|
@if cmp temp1.xml temp2.xml; then \
|
|
echo File test passed!; \
|
|
$(RM) temp2.xml temp2s.xml; \
|
|
else \
|
|
echo File test failed!; \
|
|
fi
|
|
@if cmp temp1.xml temp1s.xml; then \
|
|
echo String test passed!; \
|
|
$(RM) temp1.xml temp1s.xml; \
|
|
else \
|
|
echo String test failed!; \
|
|
fi
|
|
|
|
testmxml.o: mxml.h
|
|
|
|
|
|
#
|
|
# mxml.xml
|
|
#
|
|
|
|
mxml.xml: mxmldoc mxml.h $(PUBLIBOBJS:.o=.c)
|
|
$(RM) mxml.xml
|
|
./mxmldoc mxml.xml mxml.h $(PUBLIBOBJS:.o=.c) >doc/reference.html
|
|
|
|
valgrind: mxmldoc
|
|
$(RM) valgrind.xml
|
|
valgrind --leak-check=yes ./mxmldoc valgrind.xml mxml.h \
|
|
$(PUBLIBOBJS:.o=.c) >valgrind.html 2>valgrind.out
|
|
|
|
|
|
#
|
|
# All object files depend on the makefile...
|
|
#
|
|
|
|
$(OBJS): Makefile config.h
|
|
|
|
|
|
#
|
|
# End of "$Id: Makefile.in,v 1.21 2004/05/16 05:25:38 mike Exp $".
|
|
#
|