Makefile 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  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. SHELL = /bin/bash
  21. srcdir = .
  22. top_srcdir = .
  23. prefix = /usr/local
  24. exec_prefix = ${prefix}
  25. bindir = ${exec_prefix}/bin
  26. libdir = ${exec_prefix}/lib
  27. includedir = ${prefix}/include
  28. man1dir = ${prefix}/man/man1
  29. top_builddir = .
  30. INSTALL = /usr/bin/install -c
  31. INSTALL_PROGRAM = ${INSTALL}
  32. INSTALL_DATA = ${INSTALL} -m 644
  33. mkinstalldirs = $(SHELL) $(top_srcdir)/conftools/mkinstalldirs
  34. MANFILE = $(srcdir)/doc/xmlwf.1
  35. APIHEADER = $(srcdir)/lib/expat.h $(srcdir)/lib/expat_external.h
  36. LIBRARY = libexpat.la
  37. DESTDIR = $(INSTALL_ROOT)
  38. default: buildlib xmlwf/xmlwf
  39. buildlib: $(LIBRARY)
  40. all: $(LIBRARY) xmlwf/xmlwf examples/elements examples/outline
  41. clean:
  42. cd lib && rm -f $(LIBRARY) *.o *.lo && rm -rf .libs _libs
  43. cd xmlwf && rm -f xmlwf *.o *.lo && rm -rf .libs _libs
  44. cd examples && rm -f elements outline *.o *.lo && rm -rf .libs _libs
  45. cd tests && rm -rf .libs runtests runtests.o runtestspp runtestspp.o
  46. cd tests && rm -f chardata.o minicheck.o
  47. rm -rf .libs libexpat.la
  48. rm -f examples/core tests/core xmlwf/core
  49. clobber: clean
  50. distclean: clean
  51. rm -f expat_config.h config.status config.log config.cache libtool
  52. rm -f Makefile
  53. extraclean: distclean
  54. rm -f expat_config.h.in configure
  55. rm -f conftools/ltconfig conftools/ltmain.sh conftools/libtool.m4
  56. check: tests/runtests tests/runtestspp
  57. tests/runtests
  58. tests/runtestspp
  59. install: xmlwf/xmlwf installlib
  60. $(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(man1dir)
  61. $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) xmlwf/xmlwf $(DESTDIR)$(bindir)/xmlwf
  62. $(INSTALL_DATA) $(MANFILE) $(DESTDIR)$(man1dir)
  63. installlib: $(LIBRARY) $(APIHEADER)
  64. $(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir)
  65. $(LIBTOOL) --mode=install $(INSTALL) $(LIBRARY) $(DESTDIR)$(libdir)/$(LIBRARY)
  66. for FN in $(APIHEADER) ; do $(INSTALL_DATA) $$FN $(DESTDIR)$(includedir) ; done
  67. uninstall: uninstalllib
  68. $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(bindir)/xmlwf
  69. rm -f $(DESTDIR)$(man1dir)/xmlwf.1
  70. uninstalllib:
  71. $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$(LIBRARY)
  72. rm -f $(DESTDIR)$(includedir)/expat.h
  73. rm -f $(DESTDIR)$(includedir)/expat_external.h
  74. # for VPATH builds (invoked by configure)
  75. mkdir-init:
  76. @for d in lib xmlwf examples tests ; do \
  77. (mkdir $$d 2> /dev/null || test 1) ; \
  78. done
  79. CC = gcc
  80. CXX = g++
  81. LIBTOOL = $(SHELL) $(top_builddir)/libtool
  82. INCLUDES = -I$(srcdir)/lib -I.
  83. LDFLAGS =
  84. CPPFLAGS = -DHAVE_EXPAT_CONFIG_H
  85. CFLAGS = -g -O2 -Wall -Wmissing-prototypes -Wstrict-prototypes -fexceptions
  86. CXXFLAGS = -g -O2 -Wall -fexceptions
  87. VSNFLAG = -version-info 6:2:5
  88. ### autoconf this?
  89. LTFLAGS = --silent
  90. COMPILE = $(CC) $(INCLUDES) $(CFLAGS) $(DEFS) $(CPPFLAGS)
  91. CXXCOMPILE = $(CXX) $(INCLUDES) $(CXXFLAGS) $(DEFS) $(CPPFLAGS)
  92. LTCOMPILE = $(LIBTOOL) $(LTFLAGS) --mode=compile $(COMPILE)
  93. LINK_LIB = $(LIBTOOL) $(LTFLAGS) --mode=link $(COMPILE) -no-undefined $(VSNFLAG) -rpath $(libdir) $(LDFLAGS) -o $@
  94. LINK_EXE = $(LIBTOOL) $(LTFLAGS) --mode=link $(COMPILE) $(LDFLAGS) -o $@
  95. LINK_CXX_EXE = $(LIBTOOL) $(LTFLAGS) --mode=link $(CXXCOMPILE) $(LDFLAGS) -o $@
  96. LIB_OBJS = lib/xmlparse.lo lib/xmltok.lo lib/xmlrole.lo
  97. $(LIBRARY): $(LIB_OBJS)
  98. $(LINK_LIB) $(LIB_OBJS)
  99. lib/xmlparse.lo: lib/xmlparse.c lib/expat.h lib/xmlrole.h lib/xmltok.h \
  100. $(top_builddir)/expat_config.h lib/expat_external.h lib/internal.h
  101. lib/xmlrole.lo: lib/xmlrole.c lib/ascii.h lib/xmlrole.h \
  102. $(top_builddir)/expat_config.h lib/expat_external.h lib/internal.h
  103. lib/xmltok.lo: lib/xmltok.c lib/xmltok_impl.c lib/xmltok_ns.c \
  104. lib/ascii.h lib/asciitab.h lib/iasciitab.h lib/latin1tab.h \
  105. lib/nametab.h lib/utf8tab.h lib/xmltok.h lib/xmltok_impl.h \
  106. $(top_builddir)/expat_config.h lib/expat_external.h lib/internal.h
  107. XMLWF_OBJS = xmlwf/xmlwf.o xmlwf/xmlfile.o xmlwf/codepage.o xmlwf/unixfilemap.o
  108. xmlwf/xmlwf.o: xmlwf/xmlwf.c
  109. xmlwf/xmlfile.o: xmlwf/xmlfile.c
  110. xmlwf/codepage.o: xmlwf/codepage.c
  111. xmlwf/unixfilemap.o: xmlwf/unixfilemap.c
  112. xmlwf/xmlwf: $(XMLWF_OBJS) $(LIBRARY)
  113. $(LINK_EXE) $(XMLWF_OBJS) $(LIBRARY)
  114. examples/elements.o: examples/elements.c
  115. examples/elements: examples/elements.o $(LIBRARY)
  116. $(LINK_EXE) $< $(LIBRARY)
  117. examples/outline.o: examples/outline.c
  118. examples/outline: examples/outline.o $(LIBRARY)
  119. $(LINK_EXE) $< $(LIBRARY)
  120. tests/chardata.o: tests/chardata.c tests/chardata.h
  121. tests/minicheck.o: tests/minicheck.c tests/minicheck.h
  122. tests/runtests.o: tests/runtests.c tests/chardata.h
  123. tests/runtests: tests/runtests.o tests/chardata.o tests/minicheck.o $(LIBRARY)
  124. $(LINK_EXE) tests/runtests.o tests/chardata.o tests/minicheck.o $(LIBRARY)
  125. tests/runtestspp.o: tests/runtestspp.cpp tests/runtests.c tests/chardata.h
  126. tests/runtestspp: tests/runtestspp.o tests/chardata.o tests/minicheck.o $(LIBRARY)
  127. $(LINK_CXX_EXE) tests/runtestspp.o tests/chardata.o tests/minicheck.o $(LIBRARY)
  128. tests/xmlts.zip:
  129. wget --output-document=tests/xmlts.zip \
  130. http://www.w3.org/XML/Test/xmlts20020606.zip
  131. tests/XML-Test-Suite: tests/xmlts.zip
  132. cd tests && unzip -q xmlts.zip
  133. run-xmltest: xmlwf/xmlwf tests/XML-Test-Suite
  134. tests/xmltest.sh
  135. .SUFFIXES: .c .cpp .lo .o
  136. .cpp.o:
  137. $(CXXCOMPILE) -o $@ -c $<
  138. .c.o:
  139. $(COMPILE) -o $@ -c $<
  140. .c.lo:
  141. $(LTCOMPILE) -o $@ -c $<
  142. .PHONY: buildlib all \
  143. clean distclean extraclean maintainer-clean \
  144. dist distdir \
  145. install uninstall