1################################################################ 2# Process this file with top-level configure script to produce Makefile 3# 4# Copyright 2000 Clark Cooper 5# 6# This file is part of EXPAT. 7# 8# EXPAT is free software; you can redistribute it and/or modify it 9# under the terms of the License (based on the MIT/X license) contained 10# in the file COPYING that comes with this distribution. 11# 12# EXPAT IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 13# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 14# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 15# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 16# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 17# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 18# SOFTWARE OR THE USE OR OTHER DEALINGS IN EXPAT. 19# 20 21SHELL = @SHELL@ 22 23srcdir = @srcdir@ 24top_srcdir = @top_srcdir@ 25VPATH = @srcdir@ 26 27prefix = @prefix@ 28exec_prefix = @exec_prefix@ 29 30bindir = @bindir@ 31libdir = @libdir@ 32includedir = @includedir@ 33mandir = ${prefix}/man/man1 34 35top_builddir = . 36 37 38INSTALL = @INSTALL@ 39INSTALL_PROGRAM = @INSTALL_PROGRAM@ 40INSTALL_DATA = @INSTALL_DATA@ 41mkinstalldirs = $(SHELL) $(top_srcdir)/conftools/mkinstalldirs 42 43MANFILE = $(srcdir)/doc/xmlwf.1 44APIHEADER = $(srcdir)/lib/expat.h 45LIBRARY = libexpat.la 46 47 48default: buildlib xmlwf/xmlwf 49 50buildlib: $(LIBRARY) 51 52all: $(LIBRARY) xmlwf/xmlwf examples/elements examples/outline 53 54clean: 55 cd lib && rm -f $(LIBRARY) *.o *.lo && rm -rf .libs _libs 56 cd xmlwf && rm -f xmlwf *.o *.lo && rm -rf .libs _libs 57 cd examples && rm -f elements outline *.o *.lo && rm -rf .libs _libs 58 cd tests && rm -rf .libs runtests runtests.o chardata.o 59 rm -rf .libs libexpat.la 60 find . -name core | xargs rm -f 61 62distclean: clean 63 rm -f expat_config.h config.status config.log config.cache libtool 64 rm -f Makefile 65 66extraclean: distclean 67 rm -f expat_config.h.in configure 68 rm -f conftools/ltconfig conftools/ltmain.sh conftools/libtool.m4 69 70check: tests/runtests 71 tests/runtests 72 73install: xmlwf/xmlwf installlib 74 $(mkinstalldirs) $(bindir) $(mandir) 75 $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) xmlwf/xmlwf $(bindir)/xmlwf 76 $(INSTALL_DATA) $(MANFILE) $(mandir) 77 78installlib: $(LIBRARY) $(APIHEADER) 79 $(mkinstalldirs) $(libdir) $(includedir) 80 $(LIBTOOL) --mode=install $(INSTALL) $(LIBRARY) $(libdir)/$(LIBRARY) 81 $(INSTALL_DATA) $(APIHEADER) $(includedir) 82 83uninstall: uninstalllib 84 $(LIBTOOL) --mode=uninstall rm -f $(bindir)/xmlwf 85 rm -f $(mandir)/xmlwf.1 86 87uninstalllib: 88 $(LIBTOOL) --mode=uninstall rm -f $(libdir)/$(LIBRARY) 89 rm -f $(includedir)/$(APIHEADER) 90 91# for VPATH builds (invoked by configure) 92mkdir-init: 93 @for d in lib xmlwf examples tests ; do \ 94 (mkdir $$d 2> /dev/null || test 1) ; \ 95 done 96 97CC = @CC@ 98LIBTOOL = @LIBTOOL@ 99 100INCLUDES = -I$(srcdir)/lib -I. 101LDFLAGS = @LDFLAGS@ 102CPPFLAGS = @CPPFLAGS@ 103CFLAGS = @CFLAGS@ 104VSNFLAG = -version-info @LIBCURRENT@:@LIBREVISION@:@LIBAGE@ 105 106### autoconf this? 107LTFLAGS = --silent 108 109COMPILE = $(CC) $(CFLAGS) $(DEFS) $(CPPFLAGS) $(INCLUDES) 110LTCOMPILE = $(LIBTOOL) $(LTFLAGS) --mode=compile $(COMPILE) 111LINK_LIB = $(LIBTOOL) $(LTFLAGS) --mode=link $(COMPILE) -no-undefined $(VSNFLAG) -rpath $(libdir) $(LDFLAGS) -o $@ 112LINK_EXE = $(LIBTOOL) $(LTFLAGS) --mode=link $(COMPILE) $(LDFLAGS) -o $@ 113 114LIB_OBJS = lib/xmlparse.lo lib/xmltok.lo lib/xmlrole.lo 115$(LIBRARY): $(LIB_OBJS) 116 $(LINK_LIB) $(LIB_OBJS) 117 118lib/xmlparse.lo: lib/xmlparse.c lib/expat.h lib/xmlrole.h lib/xmltok.h \ 119 $(top_builddir)/expat_config.h lib/internal.h 120 121lib/xmlrole.lo: lib/xmlrole.c lib/ascii.h lib/xmlrole.h \ 122 $(top_builddir)/expat_config.h lib/internal.h 123 124lib/xmltok.lo: lib/xmltok.c lib/xmltok_impl.c lib/xmltok_ns.c \ 125 lib/ascii.h lib/asciitab.h lib/iasciitab.h lib/latin1tab.h \ 126 lib/nametab.h lib/utf8tab.h lib/xmltok.h lib/xmltok_impl.h \ 127 $(top_builddir)/expat_config.h 128 129 130XMLWF_OBJS = xmlwf/xmlwf.o xmlwf/xmlfile.o xmlwf/codepage.o xmlwf/@FILEMAP@.o 131xmlwf/xmlwf.o: xmlwf/xmlwf.c 132xmlwf/xmlfile.o: xmlwf/xmlfile.c 133xmlwf/codepage.o: xmlwf/codepage.c 134xmlwf/@FILEMAP@.o: xmlwf/@FILEMAP@.c 135xmlwf/xmlwf: $(XMLWF_OBJS) $(LIBRARY) 136 $(LINK_EXE) $(XMLWF_OBJS) $(LIBRARY) 137 138examples/elements.o: examples/elements.c 139examples/elements: examples/elements.o $(LIBRARY) 140 $(LINK_EXE) $< $(LIBRARY) 141 142examples/outline.o: examples/outline.c 143examples/outline: examples/outline.o $(LIBRARY) 144 $(LINK_EXE) $< $(LIBRARY) 145 146tests/chardata.o: tests/chardata.c tests/chardata.h 147tests/runtests.o: tests/runtests.c tests/chardata.h 148tests/runtests: tests/runtests.o tests/chardata.o $(LIBRARY) 149 $(LINK_EXE) $^ -lcheck 150 151tests/xmlts.zip: 152 wget --output-document=tests/xmlts.zip \ 153 http://www.w3.org/XML/Test/xmlts20020606.zip 154 155tests/XML-Test-Suite: tests/xmlts.zip 156 cd tests && unzip -q xmlts.zip 157 158run-xmltest: xmlwf/xmlwf tests/XML-Test-Suite 159 tests/xmltest.sh 160 161.SUFFIXES: .c .lo .o 162 163.c.o: 164 $(COMPILE) -o $@ -c $< 165.c.lo: 166 $(LTCOMPILE) -o $@ -c $< 167 168.PHONY: buildlib all \ 169 clean distclean extraclean maintainer-clean \ 170 dist distdir \ 171 install uninstall 172