home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-dist / unixtex-6.1b-src.tgz / tar.out / contrib / unixtex / web2c / mf / Makefile.in < prev    next >
Makefile  |  1996-09-28  |  6KB  |  270 lines

  1. # Makefile for Metafont.
  2.  
  3. SHELL = /bin/sh
  4. srcdir = @srcdir@
  5. VPATH = @srcdir@
  6.  
  7. # This is so kpathsea will get remade automatically if you change
  8. # something in it and recompile from the package directory.
  9. kpathsea_parent = ../..
  10. kpathsea_dir = $(kpathsea_parent)/kpathsea
  11. kpathsea = $(kpathsea_dir)/kpathsea.a
  12.  
  13. # Routines used everywhere.
  14. commondefines = $(srcdir)/../lib/common.defines $(srcdir)/../lib/texmf.defines
  15. commonh = $(srcdir)/../lib/config.h
  16. commono = ../lib/lib.a $(kpathsea)
  17.  
  18. # Routines used in TeX and Metafont.
  19. extrac = $(srcdir)/../lib/texmf.c
  20. extrah = $(srcdir)/../lib/texmf.h $(srcdir)/../lib/texmfmem.h mfd.h
  21.  
  22. # Routines used in TeX, Metafont, and BibTeX.
  23. fileioc = $(srcdir)/../lib/openinout.c
  24. fileioo = openinout.o
  25.  
  26. objs = $(fileioo) mf0.o mf1.o mf2.o mf3.o mf4.o mf5.o mf6.o mf7.o mf8.o \
  27.        mf9.o mf10.o 
  28. iobjs = iextra.o inimf.o
  29. vobjs = vextra.o imf.o
  30.  
  31. # Where the test files are.
  32. mfsrcdir = $(srcdir)/../mf
  33. trapdir = $(mfsrcdir)/MFtrap
  34.  
  35. program = inimf virmf
  36.  
  37. CC = @CC@
  38. CFLAGS =
  39. CPPFLAGS = -DMF -I../lib -I$(srcdir)/../lib -I../.. -I$(srcdir)/../..
  40.  
  41. CCLD = $(CC)
  42. RANLIB = @RANLIB@
  43. LN = @LN_S@
  44.  
  45. LDFLAGS = $(CFLAGS) $(XLDFLAGS)
  46. libs = $(commono) $(LIBS)
  47.  
  48. x_include_flags = @X_CFLAGS@
  49. x_lib_flags = @X_LIBS@
  50. x_extra_libs = @X_EXTRA_LIBS@
  51. wlibs = @wlibs@
  52. LIBS = @LIBS@
  53.  
  54. windowlib = MFwindow/window.a
  55. windowlibs = $(x_lib_flags) $(windowlib) $(wlibs) $(x_extra_libs)
  56.  
  57. INSTALL = @INSTALL@
  58. INSTALL_PROGRAM = @INSTALL_PROGRAM@
  59. INSTALL_DATA = @INSTALL_DATA@
  60.  
  61.  
  62. # The bases we know how to make.
  63. bases = plain.base cmmf.base
  64.  
  65. # Name of the file that defines the local devices.
  66. localmodes = modes.mf
  67.  
  68. # And how to make them.
  69. inimf = MFPOOL=. ./inimf
  70. # For AmigaOS with pre 41.2 ixemul.library, do this:
  71. #inimf = echo "$(srcdir)" >env:MFPOOL; ./inimf
  72.  
  73.  
  74. # What to pass to submakes.
  75. makeargs=SHELL='$(SHELL)' CC='$(CC)' CFLAGS='$(CFLAGS)' \
  76. LDFLAGS='$(LDFLAGS)' LIBS='$(libs)' RANLIB='$(RANLIB)' LN='$(LN)'
  77.  
  78.  
  79. .SUFFIXES:
  80. .SUFFIXES: .o .c
  81. .c.o:
  82.     $(CC) $(CPPFLAGS) $(CFLAGS) -c $<
  83.  
  84.  
  85. default: all
  86. all: $(program)
  87. triptrap: trapmf
  88.  
  89.  
  90. # It is a waste of disk space to have window support in inimf.
  91. inimf: $(iobjs) $(objs) $(commono)
  92.     $(CCLD) -o inimf $(LDFLAGS) $(iobjs) $(objs) $(libs)
  93.  
  94. virmf: $(vobjs) $(objs) $(windowlib) $(commono)
  95.     $(CCLD) -o virmf $(LDFLAGS) $(vobjs) $(objs) $(windowlibs) $(libs)
  96.  
  97. check: run-trap
  98. run-trap: trapmf 
  99.     rm -f trap.mf
  100.     -$(LN) $(trapdir)/trap.mf .
  101.     -$(SHELL) -c '. ./trapenv; \
  102.       ./trapmf < $(trapdir)/trap1.in > /dev/null 2>&1'
  103.     -diff $(trapdir)/trapin.log trap.log
  104.     -$(SHELL) -c '. ./trapenv; ./trapmf < $(trapdir)/trap2.in > trap.fot'
  105.     -diff $(trapdir)/trap.log trap.log
  106.     -diff $(trapdir)/trap.fot trap.fot
  107.     ../fontutil/tftopl ./trap.tfm trap.pl
  108.     -diff $(trapdir)/trap.pl trap.pl
  109.     $(SHELL) -c '. ./trapenv; \
  110.       ../fontutil/gftype -m -i ./trap.72270gf > trap.typ'
  111.     -diff $(trapdir)/trap.typ trap.typ
  112.  
  113.  
  114. # Make base files automatically.
  115. bases: $(bases)
  116.  
  117. mf.base: inimf
  118.     $(inimf) 'plain; input $(localmodes); dump'
  119.     mv plain.base mf.base
  120.     mv plain.log mf.log
  121.  
  122. cmmf.base: mf.base
  123.     $(inimf) \&./mf cmbase dump
  124.     mv cmbase.base cmmf.base
  125.     mv cmbase.log cmmf.log
  126.  
  127.  
  128. # The `ini_to_trap' script changes mfd.h, instead of the change file, so
  129. # retangling is not necessary.  After changing constants, making a
  130. # trapmf means making an inimf.
  131. trapmf: stamp-trap
  132.     $(MAKE) $(makeargs) inimf
  133.     mv inimf trapmf
  134.  
  135. stamp-trap: mfd.h $(mfsrcdir)/trap.sed
  136.     rm -f *.o temp
  137.     sed -f $(mfsrcdir)/trap.sed < mfd.h > temp
  138.     mv mfd.h mfd.h.bak
  139.     mv temp mfd.h
  140.     touch stamp-trap
  141.  
  142. clean-trap:
  143.     rm -f *.o mfd.h trapmf stamp-trap
  144. # Don't reinstall mfd.h with the test constants.
  145.     if grep 'memmax 3000' mfd.h.bak >/dev/null 2>&1; then \
  146.           rm -f mfd.h*; else mv mfd.h.bak mfd.h; fi
  147.  
  148. mf.p mf.pool: mf.web cmf.ch
  149.     ../web/tangle $(srcdir)/mf.web cmf.ch
  150.     cp $(srcdir)/mf.p mf.p
  151.     cp $(srcdir)/mf.pool mf.pool
  152.     rm -f $(srcdir)/mf.p $(srcdir)/mf.pool
  153.  
  154. cmf.ch: $(mfsrcdir)/mf.ch
  155.     rm -f cmf.ch
  156.     cp $(mfsrcdir)/mf.ch cmf.ch
  157.  
  158. # The convert script produces the following files:
  159. mf0.c mf1.c mf2.c mf3.c mf4.c mf5.c mf6.c mf7.c mf8.c mf9.c \
  160. imf.c coerce.h mfd.h: mf.p coerce.add $(commondefines)
  161.     $(SHELL) $(mfsrcdir)/convert $(srcdir)
  162.     touch mfd.h
  163.  
  164. # The (hand-coded) file $(extrac) and the (generated) file itex.c have
  165. # #ifdefs for INIMF, so we compile them differently.
  166. iextra.o: iextra.c $(commonh) $(extrah)
  167.     $(CC) $(CPPFLAGS) -DINIMF -DINI $(CFLAGS) -c iextra.c
  168.  
  169. inimf.o: inimf.c $(commonh) $(extrah)
  170.     $(CC) $(CPPFLAGS) -DINIMF $(CFLAGS) -c inimf.c
  171.  
  172. # Avoid compiling files in another directory.
  173. iextra.c: $(extrac)
  174.     rm -f iextra.c
  175.     $(LN) $(extrac) iextra.c
  176.  
  177. inimf.c: imf.c
  178.     rm -f inimf.c
  179.     $(LN) imf.c inimf.c
  180.  
  181. vextra.c: $(extrac)
  182.     rm -f vextra.c
  183.     $(LN) $(extrac) vextra.c
  184.  
  185. openinout.c: $(fileioc)
  186.     rm -f openinout.c
  187.     $(LN) $(fileioc) openinout.c
  188.  
  189. $(iobjs) $(vobjs) $(objs): $(commonh) $(extrah)
  190.  
  191. mf0.o: mf0.c
  192. mf1.o: mf1.c
  193. mf2.o: mf2.c
  194. mf3.o: mf3.c
  195. mf4.o: mf4.c
  196. mf5.o: mf5.c
  197. mf6.o: mf6.c
  198. mf7.o: mf7.c
  199. mf8.o: mf8.c
  200. mf9.o: mf9.c
  201. mf10.o: mf10.c
  202.  
  203. $(windowlib): mfd.h
  204.     cd MFwindow; $(MAKE) $(makeargs) x_include_flags='$(x_include_flags)'
  205.  
  206.  
  207. Makefile: Makefile.in ../config.status
  208.     (cd ..; sh config.status)
  209.  
  210. c-sources: mfd.h
  211. .PHONY: c-sources
  212.  
  213. install: install-exec install-data
  214.  
  215. install-exec: all
  216.     for p in $(program); do $(INSTALL_PROGRAM) $$p $(bindir)/$$p; done
  217.  
  218. install-data: mf.pool
  219.     $(SHELL) $(srcdir)/../../mkdirchain $(mfpooldir)
  220.     -if test -s mf.pool; then \
  221.       $(INSTALL_DATA) mf.pool $(mfpooldir)/mf.pool; else true; fi
  222.  
  223. TAGS: *.c *.h
  224.     etags -t *.c *.h
  225.  
  226.  
  227. mostlyclean::
  228.     rm -f *.o $(program) $(lib) $(programs)
  229.  
  230. clean:: mostlyclean
  231.     rm -f *.dvi *.pool
  232.  
  233. distclean:: clean
  234.     rm -f Makefile config.status c-auto.h
  235.  
  236. # Although we can remake configure and c-auto.h.in, we don't remove
  237. # them, since many people may lack Autoconf.  Use configclean for that.
  238. realclean:: distclean
  239.     rm -f TAGS *.info*
  240.  
  241. extraclean::
  242.     rm -f *.aux *.bak *.bbl *.blg *.dvi *.log *.orig *.pl *.rej
  243.     rm -f *.i *.s *.tfm *.vf *.vpl *\#* *gf *pk *~
  244.     rm -f CONTENTS.tex a.out core mfput.* patch* texput.*
  245.  
  246. configclean:
  247.     rm -f configure c-auto.h.in c-auto.h
  248.  
  249.  
  250. # Prevent GNU make 3 from overflowing arg limit on system V.
  251. .NOEXPORT:
  252.  
  253. mostlyclean::
  254.     rm -f stamp-* trapmf
  255.     rm -f mfd.h mfd.h.bak coerce.h *.log *.base 
  256.     rm -f trap.72270gf trap.fot trap.tfm trap.typ trap.pl trap.mf
  257.     cd MFwindow; $(MAKE) mostlyclean
  258.  
  259. clean::
  260.     rm -f *.c *.p *.h
  261.     cd MFwindow; $(MAKE) clean
  262.  
  263. distclean::
  264.     rm -f cmf.ch
  265.     cd MFwindow; $(MAKE) distclean
  266.  
  267. extraclean::
  268.     cd MFwindow; $(MAKE) extraclean
  269.