mxml/Makefile.in

244 lines
4.6 KiB
Makefile
Raw Normal View History

2003-06-03 19:46:29 +00:00
#
# "$Id: Makefile.in,v 1.13 2003/09/28 21:09:03 mike Exp $"
2003-06-03 19:46:29 +00:00
#
# Makefile for mini-XML, a small XML-like file parsing library.
#
# Copyright 2003 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@
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...
#
DOCFILES = documentation.html README COPYING CHANGES
PUBLIBOBJS = mxml-attr.o mxml-file.o mxml-node.o mxml-search.o \
mxml-set.o
LIBOBJS = $(PUBLIBOBJS) mxml-private.o mxml-string.o
OBJS = mxmldoc.o testmxml.o $(LIBOBJS)
2003-06-15 01:22:37 +00:00
TARGETS = libmxml.a mxmldoc mxml.$(CAT3EXT) mxmldoc.$(CAT1EXT) \
testmxml mxml.xml
2003-06-03 19:46:29 +00:00
#
# Make everything...
#
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)
2003-06-15 00:44:34 +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
$(CP) mxmldoc.$(CAT1EXT) $(BUILDROOT)/$(mandir)/cat1/mxmldoc.$(CAT1EXT)
2003-06-15 01:22:37 +00:00
-$(MKDIR) -p $(BUILDROOT)/$(mandir)/cat3
$(CP) mxml.$(CAT3EXT) $(BUILDROOT)/$(mandir)/cat3/mxml.$(CAT3EXT)
2003-06-15 00:44:34 +00:00
-$(MKDIR) -p $(BUILDROOT)/$(mandir)/man1
$(CP) mxmldoc.man $(BUILDROOT)/$(mandir)/man1/mxmldoc.$(MAN1EXT)
2003-06-15 01:22:37 +00:00
-$(MKDIR) -p $(BUILDROOT)/$(mandir)/man3
$(CP) mxml.man $(BUILDROOT)/$(mandir)/man3/mxml.$(MAN3EXT)
2003-06-03 19:46:29 +00:00
#
# Uninstall everything...
#
uninstall:
2003-06-15 00:44:34 +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)
2003-06-15 01:22:37 +00:00
$(RM) $(BUILDROOT)/$(mandir)/cat3/mxml.$(CAT3EXT)
2003-06-15 00:44:34 +00:00
$(RM) $(BUILDROOT)/$(mandir)/man1/mxmldoc.$(MAN1EXT)
2003-06-15 01:22:37 +00:00
$(RM) $(BUILDROOT)/$(mandir)/man3/mxml.$(MAN3EXT)
#
# 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
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
#
# 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-05 13:49:14 +00:00
#
# mxml.xml
#
mxml.xml: mxmldoc mxml.h $(PUBLIBOBJS:.o=.c)
2003-06-15 00:44:34 +00:00
$(RM) mxml.xml
./mxmldoc mxml.xml mxml.h $(PUBLIBOBJS:.o=.c) >documentation.html
2003-06-05 13:49:14 +00:00
#
# 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
#
# End of "$Id: Makefile.in,v 1.13 2003/09/28 21:09:03 mike Exp $".
2003-06-03 19:46:29 +00:00
#