summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgstein <gstein>2001-12-07 10:19:30 +0000
committergstein <gstein>2001-12-07 10:19:30 +0000
commitd7083a85d7383312e1a7074148ca5af637945d7a (patch)
treefd1112921a37f7d19be03d1e2851f333dade81c3
parent95b6ee47d1aaadf9631dec10f18c930a55466163 (diff)
downloadlibexpat-d7083a85d7383312e1a7074148ca5af637945d7a.tar.gz
* Switch to a single, top-level Makefile (simplification, consistency)
* use libtool to compile/link all programs * remove */Makefile.in and remove them from configure * remove autom4te.cache after running autoconf * remove .o from the FILEMAP logic in configure and the Make system; provides more flexibility in the Makefile to use it * for VPATH builds: create the build subdirs by running "make mkdir-init" from the configure script * adjust .cvsignore files to account for presence of .libs now
-rw-r--r--Makefile.in95
-rwxr-xr-xbuildconf.sh3
-rw-r--r--configure.in25
-rw-r--r--examples/.cvsignore1
-rw-r--r--examples/Makefile.in39
-rw-r--r--lib/Makefile.in80
-rw-r--r--tests/.cvsignore1
-rw-r--r--tests/Makefile.in21
-rwxr-xr-xxmlwf/.cvsignore1
-rw-r--r--xmlwf/Makefile.in36
10 files changed, 90 insertions, 212 deletions
diff --git a/Makefile.in b/Makefile.in
index 87157af..e417120 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -33,6 +33,7 @@ SHELL = @SHELL@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
+
prefix = @prefix@
exec_prefix = @exec_prefix@
@@ -48,43 +49,33 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
mkinstalldirs = $(SHELL) $(top_srcdir)/conftools/mkinstalldirs
-CC = @CC@
-
-LIBTOOL = @LIBTOOL@
-
-SUBDIRS = lib examples xmlwf
-CONFIG_HEADERS = config.h
-
APIHEADER = expat.h
LIBRARY = libexpat.la
-default: lib xmlwf
-
-buildlib: lib
+default: buildlib xmlwf/xmlwf
-all: $(SUBDIRS)
+buildlib: lib/$(LIBRARY)
-$(SUBDIRS)::
- cd $@ && $(MAKE)
+all: lib/$(LIBRARY) xmlwf/xmlwf examples/elements examples/outline
clean:
cd lib && rm -f $(LIBRARY) *.o *.lo && rm -rf .libs _libs
- cd xmlwf && rm -f xmlwf *.o
- cd examples && rm -f elements outline *.o
+ cd xmlwf && rm -f xmlwf *.o *.lo && rm -rf .libs _libs
+ cd examples && rm -f elements outline *.o *.lo && rm -rf .libs _libs
find . -name core | xargs rm -f
distclean: clean
rm -f config.h config.status config.log config.cache libtool
- rm -f Makefile lib/Makefile examples/Makefile xmlwf/Makefile tests/Makefile
+ rm -f Makefile
extraclean: distclean
rm -f config.h.in configure
rm -f conftools/config.guess conftools/config.sub
rm -f conftools/ltconfig conftools/ltmain.sh
-check: $(SUBDIRS)
- cd tests && $(MAKE) check
+check: tests/runtests
+ @cd tests && ./runtests
install: xmlwf/xmlwf lib/$(LIBRARY) lib/$(APIHEADER)
$(mkinstalldirs) $(bindir) $(libdir) $(includedir)
@@ -97,7 +88,73 @@ uninstall:
$(LIBTOOL) --mode=uninstall rm -f $(libdir)/$(LIBRARY)
rm -f $(libdir)/$(APIHEADER)
-.PHONY: buildlib all $(SUBDIRS) \
+# for VPATH builds (invoked by configure)
+mkdir-init:
+ @for d in lib xmlwf examples tests ; do \
+ (mkdir $$d 2> /dev/null || test 1) ; \
+ done
+
+CC = @CC@
+LIBTOOL = @LIBTOOL@
+
+INCLUDES = -Ilib -I.
+LDFLAGS = @LDFLAGS@
+CPPFLAGS = @CPPFLAGS@
+CFLAGS = @CFLAGS@
+VSNFLAG = -version-info @LIBCURRENT@:@LIBREVISION@:@LIBAGE@
+
+### autoconf this?
+LTFLAGS = --silent
+
+COMPILE = $(CC) $(CFLAGS) $(DEFS) $(CPPFLAGS) $(INCLUDES)
+LTCOMPILE = $(LIBTOOL) $(LTFLAGS) --mode=compile $(COMPILE)
+LINK_LIB = $(LIBTOOL) $(LTFLAGS) --mode=link $(COMPILE) $(VSNFLAG) -rpath $(libdir) $(LDFLAGS) -o $@
+LINK_EXE = $(LIBTOOL) $(LTFLAGS) --mode=link $(COMPILE) $(LDFLAGS) -o $@
+
+LIB_OBJS = lib/xmlparse.lo lib/xmltok.lo lib/xmlrole.lo
+lib/$(LIBRARY): $(LIB_OBJS)
+ $(LINK_LIB) $(LIB_OBJS)
+
+lib/xmlparse.lo: lib/xmlparse.c lib/expat.h lib/xmlrole.h lib/xmltok.h \
+ $(top_builddir)/config.h
+
+lib/xmlrole.lo: lib/xmlrole.c lib/ascii.h lib/xmlrole.h \
+ $(top_builddir)/config.h
+
+lib/xmltok.lo: lib/xmltok.c lib/xmltok_impl.c lib/xmltok_ns.c \
+ lib/ascii.h lib/asciitab.h lib/iasciitab.h lib/latin1tab.h \
+ lib/nametab.h lib/utf8tab.h lib/xmltok.h lib/xmltok_impl.h \
+ $(top_builddir)/config.h
+
+
+XMLWF_OBJS = xmlwf/xmlwf.o xmlwf/xmlfile.o xmlwf/codepage.o xmlwf/@FILEMAP@.o
+xmlwf/xmlwf.o: xmlwf/xmlwf.c
+xmlwf/xmlfile.o: xmlwf/xmlfile.c
+xmlwf/codepage.o: xmlwf/codepage.c
+xmlwf/@FILEMAP@.o: xmlwf/@FILEMAP@.c
+xmlwf/xmlwf: $(XMLWF_OBJS)
+ $(LINK_EXE) $(XMLWF_OBJS) lib/$(LIBRARY)
+
+examples/elements.o: examples/elements.c
+examples/elements: examples/elements.o
+ $(LINK_EXE) $< lib/$(LIBRARY)
+
+examples/outline.o: examples/outline.c
+examples/outline: examples/outline.o
+ $(LINK_EXE) $< lib/$(LIBRARY)
+
+tests/runtests.o: tests/runtests.c
+tests/runtests: tests/runtests.o
+ $(LINK_EXE) $< lib/$(LIBRARY)
+
+.SUFFIXES: .c .lo .o
+
+.c.o:
+ $(COMPILE) -o $@ -c $<
+.c.lo:
+ $(LTCOMPILE) -o $@ -c $<
+
+.PHONY: buildlib all \
clean distclean extraclean maintainer-clean \
dist distdir \
install uninstall
diff --git a/buildconf.sh b/buildconf.sh
index 362ff81..3410a05 100755
--- a/buildconf.sh
+++ b/buildconf.sh
@@ -41,5 +41,8 @@ echo "Creating configure ..."
### do some work to toss config.cache?
autoconf
+# toss this; it gets created by autoconf on some systems
+rm -rf autom4te.cache
+
# exit with the right value, so any calling script can continue
exit 0
diff --git a/configure.in b/configure.in
index 436e3a3..a3f4eb7 100644
--- a/configure.in
+++ b/configure.in
@@ -79,27 +79,18 @@ AC_FUNC_MEMCMP
AC_FUNC_MMAP
if test "$ac_cv_func_mmap_fixed_mapped" = "yes"; then
- FILEMAP_OBJ=unixfilemap.o
+ FILEMAP=unixfilemap
else
- FILEMAP_OBJ=readfilemap.o
+ FILEMAP=readfilemap
fi
-AC_SUBST(FILEMAP_OBJ)
+AC_SUBST(FILEMAP)
AC_CHECK_FUNCS(memmove bcopy)
-dnl Generate makefiles only for the directories that are present;
-dnl this allows this (and the generated configure script) to work
-dnl in "embedded distributions", where only part of the Expat sources
-dnl are included in the sources for another project.
+AC_OUTPUT(Makefile)
-OUTPUT="Makefile lib/Makefile"
-if test -d ${srcdir}/xmlwf; then
- OUTPUT="$OUTPUT xmlwf/Makefile"
+abs_srcdir="`cd $srcdir && pwd`"
+abs_builddir="`pwd`"
+if test "$abs_srcdir" != "$abs_builddir"; then
+ make mkdir-init
fi
-if test -d ${srcdir}/examples; then
- OUTPUT="$OUTPUT examples/Makefile"
-fi
-if test -d ${srcdir}/tests; then
- OUTPUT="$OUTPUT tests/Makefile"
-fi
-AC_OUTPUT($OUTPUT)
diff --git a/examples/.cvsignore b/examples/.cvsignore
index f82d21e..88a4696 100644
--- a/examples/.cvsignore
+++ b/examples/.cvsignore
@@ -5,3 +5,4 @@ outline
outline.plg
Debug
Release
+.libs
diff --git a/examples/Makefile.in b/examples/Makefile.in
deleted file mode 100644
index db9b9f7..0000000
--- a/examples/Makefile.in
+++ /dev/null
@@ -1,39 +0,0 @@
-################################################################
-# Process this file with top-level configure script to produce Makefile
-#
-# Copyright 2000 Clark Cooper
-#
-# This file is part of EXPAT.
-#
-# EXPAT is free software; you can redistribute it and/or modify it
-# under the terms of the License (based on the MIT/X license) contained
-# in the file COPYING that comes with this distribution.
-#
-# EXPAT IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-# SOFTWARE OR THE USE OR OTHER DEALINGS IN EXPAT.
-#
-
-LIBDIR = ../lib/.libs
-INCDIR = ../lib
-
-CPPFLAGS = @CPPFLAGS@
-LDFLAGS = @LDFLAGS@ -static
-LIBS = -L$(LIBDIR) -lexpat
-CC = @CC@
-CFLAGS = @CFLAGS@ -I$(INCDIR)
-
-VPATH = @srcdir@
-
-
-all: elements outline
-
-elements: elements.o
- $(CC) -o $@ $< $(LDFLAGS) $(LIBS)
-
-outline: outline.o
- $(CC) -o $@ $< $(LDFLAGS) $(LIBS)
diff --git a/lib/Makefile.in b/lib/Makefile.in
deleted file mode 100644
index fd6635e..0000000
--- a/lib/Makefile.in
+++ /dev/null
@@ -1,80 +0,0 @@
-################################################################
-# Process this file with top-level configure script to produce Makefile
-#
-# Copyright 2000 Clark Cooper
-#
-# This file is part of EXPAT.
-#
-# EXPAT is free software; you can redistribute it and/or modify it
-# under the terms of the License (based on the MIT/X license) contained
-# in the file COPYING that comes with this distribution.
-#
-# EXPAT IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-# SOFTWARE OR THE USE OR OTHER DEALINGS IN EXPAT.
-#
-
-
-SHELL = @SHELL@
-
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
-VPATH = @srcdir@
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-
-libdir = @libdir@
-
-top_builddir = ..
-
-CC = @CC@
-LIBTOOL = @LIBTOOL@
-
-LIBRARY = libexpat.la
-LTOBJECTS = xmlparse.lo xmltok.lo xmlrole.lo
-
-INCLUDES = -I$(srcdir) -I. -I..
-DEFS = @DEFS@
-
-CPPFLAGS = @CPPFLAGS@
-LDFLAGS = @LDFLAGS@
-LIBS = @LIBS@
-CFLAGS = @CFLAGS@
-
-LIBREVISION = @LIBREVISION@
-LIBCURRENT = @LIBCURRENT@
-LIBAGE = @LIBAGE@
-
-COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
-LINK = $(LIBTOOL) --mode=link $(CC) -version-info $(LIBCURRENT):$(LIBREVISION):$(LIBAGE) $(CFLAGS) $(LDFLAGS) -o $@
-
-
-all: $(LIBRARY)
-
-.SUFFIXES: .c .lo .o
-.PHONY: all
-
-.c.o:
- $(COMPILE) -c $<
-
-.c.lo:
- $(LTCOMPILE) -c $<
-
-$(LIBRARY): $(LTOBJECTS)
- $(LINK) -rpath $(libdir) $(LDFLAGS) $(LTOBJECTS)
-
-xmlparse.o \
-xmlparse.lo: xmlparse.c expat.h xmlrole.h xmltok.h $(top_builddir)/config.h
-
-xmlrole.o \
-xmlrole.lo: xmlrole.c ascii.h xmlrole.h $(top_builddir)/config.h
-
-xmltok.o \
-xmltok.lo: xmltok.c xmltok_impl.c xmltok_ns.c \
- ascii.h asciitab.h iasciitab.h latin1tab.h nametab.h utf8tab.h \
- xmltok.h xmltok_impl.h $(top_builddir)/config.h
diff --git a/tests/.cvsignore b/tests/.cvsignore
index 0099d7b..337b651 100644
--- a/tests/.cvsignore
+++ b/tests/.cvsignore
@@ -1,2 +1,3 @@
Makefile
runtests
+.libs
diff --git a/tests/Makefile.in b/tests/Makefile.in
deleted file mode 100644
index fc8c47f..0000000
--- a/tests/Makefile.in
+++ /dev/null
@@ -1,21 +0,0 @@
-SHELL = @SHELL@
-
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
-VPATH = @srcdir@
-
-CC=@CC@
-CPPFLAGS = @CPPFLAGS@ -I../lib
-LDFLAGS = @LDFLAGS@ -L../lib
-LIBS = @LIBS@ -lexpat -lcheck
-CFLAGS = @CFLAGS@
-
-
-check: runtests
- @./runtests
-
-runtests.o: runtests.c
- $(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $@
-
-runtests: runtests.o
- $(CC) $(LDFLAGS) $< -o $@ $(LIBS)
diff --git a/xmlwf/.cvsignore b/xmlwf/.cvsignore
index 5e2763d..90464b4 100755
--- a/xmlwf/.cvsignore
+++ b/xmlwf/.cvsignore
@@ -3,3 +3,4 @@ Release
xmlwf.plg
Makefile
xmlwf
+.libs
diff --git a/xmlwf/Makefile.in b/xmlwf/Makefile.in
deleted file mode 100644
index f17ab78..0000000
--- a/xmlwf/Makefile.in
+++ /dev/null
@@ -1,36 +0,0 @@
-################################################################
-# Process this file with top-level configure script to produce Makefile
-#
-# Copyright 2000 Clark Cooper
-#
-# This file is part of EXPAT.
-#
-# EXPAT is free software; you can redistribute it and/or modify it
-# under the terms of the License (based on the MIT/X license) contained
-# in the file COPYING that comes with this distribution.
-#
-# EXPAT IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-# SOFTWARE OR THE USE OR OTHER DEALINGS IN EXPAT.
-#
-
-srcdir=@srcdir@
-
-LIBDIR= ../lib/.libs
-INCDIR= $(srcdir)/../lib
-
-LDFLAGS= @LDFLAGS@ -static
-CFLAGS= @CFLAGS@ -I$(INCDIR)
-CC = @CC@
-
-OBJS= xmlwf.o xmlfile.o codepage.o @FILEMAP_OBJ@
-LIBS= -L$(LIBDIR) -lexpat
-
-VPATH = @srcdir@
-
-xmlwf: $(OBJS)
- $(CC) -o xmlwf $(LDFLAGS) $(OBJS) $(LIBS)