2003-06-03 19:46:29 +00:00
|
|
|
#
|
2004-05-01 23:41:52 +00:00
|
|
|
# "$Id: Makefile.in,v 1.18 2004/05/01 23:41:51 mike Exp $"
|
2003-06-03 19:46:29 +00:00
|
|
|
#
|
|
|
|
# Makefile for mini-XML, a small XML-like file parsing library.
|
|
|
|
#
|
2004-04-06 01:47:20 +00:00
|
|
|
# Copyright 2003-2004 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@
|
|
|
|
LDFLAGS = $(OPTIM) @LDFLAGS@
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
# 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-05-01 23:41:52 +00:00
|
|
|
DOCFILES = doc/mxml.html doc/mxml.pdf README COPYING CHANGES
|
2003-12-18 04:16:37 +00:00
|
|
|
PUBLIBOBJS = mxml-attr.o mxml-entity.o mxml-file.o mxml-node.o \
|
|
|
|
mxml-search.o mxml-set.o
|
2003-09-28 21:09:04 +00:00
|
|
|
LIBOBJS = $(PUBLIBOBJS) mxml-private.o mxml-string.o
|
2003-06-04 16:30:40 +00:00
|
|
|
OBJS = mxmldoc.o testmxml.o $(LIBOBJS)
|
2004-05-01 23:41:52 +00:00
|
|
|
TARGETS = libmxml.a mxmldoc doc/mxml.$(CAT3EXT) \
|
|
|
|
doc/mxmldoc.$(CAT1EXT) testmxml mxml.xml
|
2003-06-03 19:46:29 +00:00
|
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
# Make everything...
|
|
|
|
#
|
|
|
|
|
2003-09-28 12:44:39 +00:00
|
|
|
all: Makefile configure config.h $(TARGETS)
|
2003-06-03 19:46:29 +00:00
|
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
# Clean everything...
|
|
|
|
#
|
|
|
|
|
|
|
|
clean:
|
2003-06-15 00:44:34 +00:00
|
|
|
$(RM) $(OBJS) $(TARGETS)
|
|
|
|
$(RM) *.bck *.bak
|
|
|
|
$(RM) config.cache config.log config.status
|
|
|
|
$(RM) -r autom4te*.cache
|
2003-06-03 19:46:29 +00:00
|
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
# Install everything...
|
|
|
|
#
|
|
|
|
|
|
|
|
install: $(TARGETS)
|
2004-02-04 21:24:03 +00:00
|
|
|
-$(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)$(mandir)/cat1
|
2004-05-01 23:41:52 +00:00
|
|
|
$(CP) doc/mxmldoc.$(CAT1EXT) $(BUILDROOT)$(mandir)/cat1/mxmldoc.$(CAT1EXT)
|
2004-02-04 21:24:03 +00:00
|
|
|
-$(MKDIR) -p $(BUILDROOT)$(mandir)/cat3
|
2004-05-01 23:41:52 +00:00
|
|
|
$(CP) doc/mxml.$(CAT3EXT) $(BUILDROOT)$(mandir)/cat3/mxml.$(CAT3EXT)
|
2004-02-04 21:24:03 +00:00
|
|
|
-$(MKDIR) -p $(BUILDROOT)$(mandir)/man1
|
2004-05-01 23:41:52 +00:00
|
|
|
$(CP) doc/mxmldoc.man $(BUILDROOT)$(mandir)/man1/mxmldoc.$(MAN1EXT)
|
2004-02-04 21:24:03 +00:00
|
|
|
-$(MKDIR) -p $(BUILDROOT)$(mandir)/man3
|
2004-05-01 23:41:52 +00:00
|
|
|
$(CP) doc/mxml.man $(BUILDROOT)$(mandir)/man3/mxml.$(MAN3EXT)
|
2003-06-03 19:46:29 +00:00
|
|
|
|
|
|
|
|
2003-06-04 16:30:40 +00:00
|
|
|
#
|
|
|
|
# Uninstall everything...
|
|
|
|
#
|
|
|
|
|
|
|
|
uninstall:
|
2004-02-04 21:24:03 +00:00
|
|
|
$(RM) $(BUILDROOT)$(bindir)/mxmldoc
|
|
|
|
$(RM) -r $(BUILDROOT)$(docdir)
|
|
|
|
$(RM) $(BUILDROOT)$(includedir)/mxml.h
|
|
|
|
$(RM) $(BUILDROOT)$(libdir)/libmxml.a
|
|
|
|
$(RM) $(BUILDROOT)$(mandir)/cat1/mxmldoc.$(CAT1EXT)
|
|
|
|
$(RM) $(BUILDROOT)$(mandir)/cat3/mxml.$(CAT3EXT)
|
|
|
|
$(RM) $(BUILDROOT)$(mandir)/man1/mxmldoc.$(MAN1EXT)
|
|
|
|
$(RM) $(BUILDROOT)$(mandir)/man3/mxml.$(MAN3EXT)
|
2003-06-04 16:30:40 +00:00
|
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
# autoconf stuff...
|
|
|
|
#
|
|
|
|
|
|
|
|
Makefile: configure Makefile.in
|
|
|
|
if test -f config.status; then \
|
|
|
|
./config.status --recheck; \
|
|
|
|
./config.status; \
|
|
|
|
else \
|
|
|
|
./configure; \
|
|
|
|
fi
|
2003-09-28 12:44:39 +00:00
|
|
|
touch config.h
|
|
|
|
|
2003-06-04 16:30:40 +00:00
|
|
|
|
|
|
|
configure: configure.in
|
|
|
|
autoconf
|
|
|
|
if test -f config.status; then \
|
|
|
|
./config.status --recheck; \
|
|
|
|
./config.status; \
|
|
|
|
else \
|
|
|
|
./configure; \
|
|
|
|
fi
|
2003-09-28 12:44:39 +00:00
|
|
|
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-04 16:30:40 +00:00
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
2003-06-04 16:30:40 +00:00
|
|
|
#
|
|
|
|
# mxmldoc
|
|
|
|
#
|
|
|
|
|
|
|
|
mxmldoc: 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 \
|
2003-07-20 13:49:09 +00:00
|
|
|
echo File test passed!; \
|
|
|
|
$(RM) temp2.xml temp2s.xml; \
|
2003-06-04 00:12:12 +00:00
|
|
|
else \
|
2003-07-20 13:49:09 +00:00
|
|
|
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!; \
|
2003-06-04 00:12:12 +00:00
|
|
|
fi
|
2003-06-03 19:46:29 +00:00
|
|
|
|
|
|
|
testmxml.o: mxml.h
|
|
|
|
|
2003-06-04 16:30:40 +00:00
|
|
|
|
2003-06-05 13:49:14 +00:00
|
|
|
#
|
|
|
|
# mxml.xml
|
|
|
|
#
|
|
|
|
|
2003-09-28 21:09:04 +00:00
|
|
|
mxml.xml: mxmldoc mxml.h $(PUBLIBOBJS:.o=.c)
|
2003-06-15 00:44:34 +00:00
|
|
|
$(RM) mxml.xml
|
2004-05-01 23:41:52 +00:00
|
|
|
./mxmldoc mxml.xml mxml.h $(PUBLIBOBJS:.o=.c) >doc/reference.html
|
2003-06-05 13:49:14 +00:00
|
|
|
|
2003-12-03 22:17:57 +00:00
|
|
|
valgrind: mxmldoc
|
|
|
|
$(RM) valgrind.xml
|
|
|
|
valgrind --leak-check=yes ./mxmldoc valgrind.xml mxml.h \
|
|
|
|
$(PUBLIBOBJS:.o=.c) >valgrind.html 2>valgrind.out
|
|
|
|
|
2003-06-05 13:49:14 +00:00
|
|
|
|
2003-06-04 16:30:40 +00:00
|
|
|
#
|
|
|
|
# All object files depend on the makefile...
|
|
|
|
#
|
|
|
|
|
2003-07-20 13:41:17 +00:00
|
|
|
$(OBJS): Makefile config.h
|
2003-06-04 00:12:12 +00:00
|
|
|
|
2003-06-03 19:46:29 +00:00
|
|
|
|
|
|
|
#
|
2004-05-01 23:41:52 +00:00
|
|
|
# End of "$Id: Makefile.in,v 1.18 2004/05/01 23:41:51 mike Exp $".
|
2003-06-03 19:46:29 +00:00
|
|
|
#
|