mxml/Makefile.in

222 lines
4.1 KiB
Makefile
Raw Normal View History

2003-06-03 19:46:29 +00:00
#
# "$Id: Makefile.in,v 1.8 2003/06/15 01:29:02 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
2003-06-03 19:46:29 +00:00
LIBOBJS = mxml-attr.o mxml-file.o mxml-node.o mxml-search.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 $(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
configure: configure.in
autoconf
if test -f config.status; then \
./config.status --recheck; \
./config.status; \
else \
./configure; \
fi
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...
@./testmxml test.xml >temp1.xml
@./testmxml temp1.xml >temp2.xml
@if cmp temp1.xml temp2.xml; then \
echo Test passed!; \
2003-06-15 00:44:34 +00:00
$(RM) temp1.xml temp2.xml; \
2003-06-04 00:12:12 +00:00
else \
echo 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
#
mxml.xml: mxmldoc mxml.h $(LIBOBJS:.o=.c)
2003-06-15 00:44:34 +00:00
$(RM) mxml.xml
2003-06-05 13:49:14 +00:00
./mxmldoc mxml.xml mxml.h $(LIBOBJS:.o=.c) >documentation.html
#
# All object files depend on the makefile...
#
2003-06-04 00:12:12 +00:00
$(OBJS): Makefile
2003-06-03 19:46:29 +00:00
#
# End of "$Id: Makefile.in,v 1.8 2003/06/15 01:29:02 mike Exp $".
2003-06-03 19:46:29 +00:00
#