home *** CD-ROM | disk | FTP | other *** search
/ Dream 45 / Amiga_Dream_45.iso / Amiga / Magazine / Dossier-LaTeX / AmiWeb2C.lha / source / web2c-6.1 / web2c / mf / SMakefile < prev   
Makefile  |  1995-04-12  |  9KB  |  298 lines

  1. # Makefile for Metafont in its various incarnations.  It is appropriate
  2. # for the SAS/C Development System Version 6.x by SAS Institute Inc.
  3. # and was written by Andreas Scherer, April 12, 1995.
  4.  
  5. # With this SMakefile several different versions of MetaFont can be
  6. # created (one at a time!).  The standard is No20IniMF/No20VirMF.
  7. # It is as close to the Web2C implementation as possible.
  8. #
  9. #      CHANGEFILE = cmf.ch
  10. #      HEADERFILE = mfd.h
  11. #      DEFS       = cpu=ANY data=FAR
  12. #      PS         = No20
  13. #      LOBJ       = lib:c.o
  14. #      LIBRARIES  = lib:scmieee.lib lib:scnb.lib
  15. #
  16. # An improved version for standard Amigas will provide a runtime
  17. # memory configuration and resident versions of IniMF and Virmf.
  18. #
  19. #      CHANGEFILE = mmf.ch
  20. #      HEADERFILE = mfmemory.h
  21. #      DEFS       = cpu=ANY define=VARMEM
  22. #      PS         = No20
  23. #      LOBJ       = lib:cres.o
  24. #      LIBRARIES  = lib:scmieee.lib lib:sc.lib
  25. #
  26. # Advanced hardware configurations work with IniMF/VirMF.  These use
  27. # the runtime memory configuration as well.
  28. #
  29. CHANGEFILE = mmf_20.ch
  30. HEADERFILE = mfmemory.h
  31. DEFS       = cpu=68020 define=SPEEDUP define=VARMEM
  32. PS         =
  33. LOBJ       = lib:cres.o
  34. LIBRARIES  = lib:scmieee.lib lib:sc.lib
  35.  
  36. SED = sed
  37. SHELL = rx
  38. TIE = tie
  39. WMERGE = wmerge
  40. srcdir = .
  41. VPATH = .
  42.  
  43. # The missing `configure' mechanism requires this to be done by hand.
  44. bindir = TeXMF:bin/web2c61
  45. configdir = TeXMF:web2c61/config
  46. mfpooldir = TeXMF:web2c61/pool
  47.  
  48. # This is so kpathsea will get remade automatically if you change
  49. # something in it and recompile from the package directory.
  50. kpathsea_parent = ../..
  51. kpathsea_dir = $(kpathsea_parent)/kpathsea
  52. kpathsea = $(kpathsea_dir)/kpathsea.lib
  53. kpathsea_20 = $(kpathsea_dir)/kpathsea_20.lib
  54.  
  55. # Routines used everywhere.
  56. commondefines = $(srcdir)/../lib/common.defines $(srcdir)/../lib/texmf.defines \
  57.     $(srcdir)/../lib/texmfextras.defines
  58. commonh = $(srcdir)/../lib/andyconfig.h
  59. commono = ../lib/lib.lib $(kpathsea)
  60. commono_20 = ../lib/lib_20.lib $(kpathsea_20)
  61.  
  62. # Routines used in TeX and Metafont.
  63. extrac = $(srcdir)/../lib/andytexmf.c
  64. extrah = $(srcdir)/../lib/andytexmf.h $(srcdir)/../lib/texmfmem.h $(HEADERFILE)
  65.  
  66. # Routines used in TeX, Metafont, and BibTeX.
  67. fileioc = $(srcdir)/../lib/andyopeninout.c
  68. fileioo = openinout.o
  69.  
  70. objs = $(fileioo) mf0.o mf1.o mf2.o mf3.o mf4.o mf5.o mf6.o mf7.o mf8.o \
  71.        mf9.o mf10.o
  72. iobjs = iextra.o inimf.o
  73. vobjs = vextra.o imf.o
  74.  
  75. # Where the test files are.
  76. mfsrcdir = $(srcdir)/../mf
  77. trapdir = $(mfsrcdir)/MFtrap
  78.  
  79. program = $(PS)inimf $(PS)virmf
  80.  
  81. CC = sc
  82. CFLAGS = $(DEFS) math=IEEE code=far stackcheck noicons optimize
  83. CPPFLAGS = define=_STRICT_ANSI define=MF idir=$(srcdir)/../lib idir=../..
  84.  
  85. CCLD = slink
  86. LN = type
  87.  
  88. LDFLAGS = noicons $(XLDFLAGS)
  89. libs = $(commono) $(LIBRARIES)
  90. libs_20 = $(commono_20) $(LIBRARIES)
  91.  
  92. # This code was written by Stefan Scherer especially for
  93. # this Amiga implementation.
  94. windowlib = MFwindow/amiga.o
  95. speedup = 64bit/64bit.o
  96.  
  97. INSTALL = copy
  98. INSTALL_PROGRAM = copy
  99. INSTALL_DATA = copy
  100.  
  101. # The bases we know how to make.
  102. bases = plain.base cmmf.base
  103.  
  104. # Name of the file that defines the local devices.
  105. localmodes = modes.mf
  106.  
  107. # And how to make them.
  108. inimf = MFPOOL=. ./$(PS)inimf
  109.  
  110. .SUFFIXES:
  111. .SUFFIXES: .o .c
  112. .c.o:
  113.     $(CC) $(CPPFLAGS) $(CFLAGS) $*.c
  114.  
  115. default: all
  116. all: $(program)
  117. triptrap: trapmf
  118.  
  119. # It is a waste of disk space to have window support in inimf.
  120. inimf: $(iobjs) $(objs) $(windowlib) $(commono_20) $(speedup)
  121.     $(CCLD) to inimf from $(LOBJ) $(iobjs) $(objs) \
  122.     $(windowlib) $(speedup) lib $(libs_20) $(LDFLAGS)
  123.  
  124. virmf: $(vobjs) $(objs) $(windowlib) $(commono_20) $(speedup)
  125.     $(CCLD) to virmf from $(LOBJ) $(vobjs) $(objs) \
  126.     $(windowlib) $(speedup) lib $(libs_20) $(LDFLAGS)
  127.  
  128. no20inimf: $(iobjs) $(objs) $(windowlib) $(commono)
  129.     $(CCLD) to no20inimf from $(LOBJ) $(iobjs) $(objs) \
  130.     $(windowlib) lib $(libs) $(LDFLAGS)
  131.  
  132. no20virmf: $(vobjs) $(objs) $(windowlib) $(commono)
  133.     $(CCLD) to no20virmf from $(LOBJ) $(vobjs) $(objs) \
  134.     $(windowlib) lib $(libs) $(LDFLAGS)
  135.  
  136. check: run-trap
  137. run-trap: $(PS)inimf # trapmf 
  138.     copy $(PS)inimf trapmf clone
  139.     - delete quiet trap.mf
  140.     -copy $(trapdir)/trap.mf .
  141.     -execute settrapenv
  142.     -./trapmf < $(trapdir)/trap1.in > NIL:
  143.     -diff $(trapdir)/trapin.log trap.log
  144.     -./trapmf < $(trapdir)/trap2.in > trap.fot
  145.     -diff $(trapdir)/trap.log trap.log -l10000
  146.     -diff $(trapdir)/trap.fot trap.fot
  147.     ../fontutil/tftopl ./trap.tfm trap.pl
  148.     -diff $(trapdir)/trap.pl trap.pl
  149.     ../fontutil/gftype -m -i ./trap.72270gf > trap.typ
  150.     -diff $(trapdir)/trap.typ trap.typ
  151.  
  152. # Make base files automatically.
  153. bases: $(bases)
  154.  
  155. mf.base: $(PS)inimf
  156.     $(inimf) "plain; input $(localmodes); dump"
  157.     rename plain.base mf.base
  158.     rename plain.log mf.log
  159.  
  160. cmmf.base: mf.base
  161.     $(inimf) "&./mf cmbase dump"
  162.     rename cmbase.base cmmf.base
  163.     rename cmbase.log cmmf.log
  164.  
  165. # The `ini_to_trap' script changes mfd.h, instead of the change file, so
  166. # retangling is not necessary.  After changing constants, making a
  167. # trapmf means making an inimf.
  168. #
  169. # This target never gets executed on the Amiga.  It's kept here for
  170. # reference only.
  171. trapmf: stamp-trap
  172.     $(MAKE) $(makeargs) inimf
  173.     mv inimf trapmf
  174.  
  175. stamp-trap: mfd.h $(mfsrcdir)/trap.sed
  176.     rm -f *.o temp
  177.     sed -f $(mfsrcdir)/trap.sed < mfd.h > temp
  178.     mv mfd.h mfd.h.bak
  179.     mv temp mfd.h
  180.     touch stamp-trap
  181.  
  182. clean-trap:
  183.     rm -f *.o mfd.h trapmf stamp-trap
  184. # Don't reinstall mfd.h with the test constants.
  185.     if grep 'memmax 3000' mfd.h.bak >/dev/null 2>&1; then \
  186.           rm -f mfd.h*; else mv mfd.h.bak mfd.h; fi
  187.  
  188. mf.p mf.pool: mf.web $(CHANGEFILE)
  189.     ../web/tangle mf.web $(CHANGEFILE)
  190.  
  191. cmf.ch: $(mfsrcdir)/mf.ch $(mfsrcdir)/mf.chch ../lib/texmfhistory.ch
  192.     - delete cmf.ch
  193.     $(WMERGE) $(mfsrcdir)/mf.ch $(mfsrcdir)/mf.chch andymf.ch
  194.     $(TIE) -c cmf.ch mf.web andymf.ch ../lib/texmfhistory.ch
  195. mmf.ch: $(mfsrcdir)/mf.ch $(mfsrcdir)/mf.chch \
  196.      ../lib/texmfhistory.ch $(mfsrcdir)/mfmemory.ch
  197.     - delete mmf.ch
  198.     $(WMERGE) $(mfsrcdir)/mf.ch $(mfsrcdir)/mf.chch andymf.ch
  199.     $(TIE) -c mmf.ch mf.web andymf.ch ../lib/texmfhistory.ch \
  200.     $(mfsrcdir)/mfmemory.ch
  201. mmf_20.ch: $(mfsrcdir)/mf.ch $(mfsrcdir)/mf.chch ../lib/texmfhistory.ch \
  202.     $(mfsrcdir)/mfmemory.ch $(mfsrcdir)/mf_20.ch
  203.     - delete mmf_20.ch
  204.     $(WMERGE) $(mfsrcdir)/mf.ch $(mfsrcdir)/mf.chch andymf.ch
  205.     $(TIE) -c mmf_20.ch mf.web andymf.ch $(mfsrcdir)/mf_20.ch \
  206.     ../lib/texmfhistory.ch $(mfsrcdir)/mfmemory.ch
  207.  
  208. # The convert script produces the following files:
  209. mf0.c: mf.p andycoerce.add $(commondefines)
  210.     $(SHELL) $(mfsrcdir)/convert.rexx
  211.     touch mfd.h
  212. mf1.c mf2.c mf3.c mf4.c mf5.c mf6.c mf7.c mf8.c mf9.c mf10.c \
  213. imf.c coerce.h mfd.h: mf0.c
  214.  
  215. mfmemory.h: stamp-convert
  216.  
  217. stamp-convert: mfd.h
  218.     copy mfd.h mfd.safe
  219.     $(SED) -f $(mfsrcdir)/mfmemory.sed < mfd.h > mfd.temp
  220.     copy mfd.temp mfd.h
  221.     delete mfd.temp
  222.     echo "" > stamp-convert
  223.  
  224. andycoerce.add: coerce.add coerce.add.ch
  225.     $(WMERGE) coerce.add coerce.add.ch andycoerce.add
  226.  
  227. # The (hand-coded) file $(extrac) and the (generated) file imf.c have
  228. # #ifdefs for INIMF, so we compile them differently.
  229. iextra.o: iextra.c $(commonh) $(extrah)
  230.     $(CC) $(CPPFLAGS) define=INIMF define=INI $(CFLAGS) iextra.c
  231.  
  232. inimf.o: inimf.c $(commonh) $(extrah)
  233.     $(CC) $(CPPFLAGS) define=INIMF $(CFLAGS) inimf.c
  234.  
  235. # Avoid compiling files in another directory.
  236. iextra.c: $(extrac)
  237.     - delete iextra.c
  238.     $(LN) $(extrac) >iextra.c
  239.  
  240. inimf.c: imf.c
  241.     - delete inimf.c
  242.     $(LN) imf.c > inimf.c
  243.  
  244. vextra.o: vextra.c
  245. vextra.c: $(extrac)
  246.     - delete vextra.c
  247.     $(LN) $(extrac) > vextra.c
  248.  
  249. $(fileioo): openinout.c
  250. openinout.c: $(fileioc)
  251.     - delete openinout.c
  252.     $(LN) $(fileioc) > openinout.c
  253.  
  254. $(iobjs) $(vobjs) $(objs): $(commonh) $(extrah)
  255.  
  256. mf0.o: mf0.c
  257. mf1.o: mf1.c
  258. mf2.o: mf2.c
  259. mf3.o: mf3.c
  260. mf4.o: mf4.c
  261.     $(CC) $(CPPFLAGS) $(CFLAGS) NOOPTPEEP mf4.c # Don't try suicide!
  262. mf5.o: mf5.c
  263. mf6.o: mf6.c
  264. mf7.o: mf7.c
  265. mf8.o: mf8.c
  266. mf9.o: mf9.c
  267. mf10.o: mf10.c
  268.  
  269. $(windowlib): MFwindow/amiga.c
  270. MFwindow/amiga.c: mfd.h $(commonh)
  271.  
  272. $(speedup): 64bit/64bit.a
  273.     asm -iINCLUDE: -m2 64bit/64bit.a
  274.  
  275. c-sources: mfd.h
  276. .PHONY: c-sources
  277.  
  278. install: install-exec install-data
  279.  
  280. install-exec: all
  281.     $(INSTALL_PROGRAM) $(program) $(bindir)
  282. install-data: mf.pool $(srcdir)/../config/mf.mcf
  283.     $(INSTALL_DATA) mf.pool $(mfpooldir)/mf.pool
  284.     $(INSTALL_DATA) $(srcdir)/../config/mf.mcf $(configdir)/mf.mcf
  285.  
  286. clean:
  287.     - delete \#?.(bak|o|lnk|log|base) $(windowlib) $(speedup)
  288.  
  289. veryclean: clean
  290.     - delete \#?.(dvi|pool|c|p|h|safe) andy\#? ?mf.ch ?mf_20.ch
  291.  
  292. extraclean: veryclean
  293.     - delete \#?.(aux|bbl|blg|orig|pl|rej)
  294.     - delete \#?.(i|s|tfm|vf|vpl) \#?(gf|pk)
  295.     - delete CONTENTS.tex mfput.\#? patch\#? texput.\#? stamp-\#?
  296.     - delete $(program) trapmf trap.mf mf.mcf trap.fot trap.typ
  297.