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

  1. # Makefile for TeX 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, March 23, 1995.
  4.  
  5. # With this SMakefile several different versions of TeX can be
  6. # created (one at a time!).  The standard is No20IniTeX/No20VirTeX.
  7. # It is as close to the Web2C implementation as possible.
  8. #
  9. #     CHANGEFILE = ctex.ch
  10. #     HEADERFILE = texd.h
  11. #     DEFS       = cpu=ANY data=FAR
  12. #     PS         = No20
  13. #     LOBJ       = lib:c.o
  14. #     LIBRARIES  = lib:scmieee.lib lib:scnb.ib
  15. #
  16. # An improved version for standard Amigas will provide a runtime
  17. # memory configuration and resident versions of IniTeX and VirTeX.
  18. #
  19. #     CHANGEFILE = mtex.ch
  20. #     HEADERFILE = texmemory.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 IniTeX/VirTeX.  These use
  27. # the runtime memory configuration as well.
  28. #
  29. CHANGEFILE = mtex.ch
  30. HEADERFILE = texmemory.h
  31. DEFS       = cpu=68020 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. texpooldir = 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. commonh = $(srcdir)/../lib/andyconfig.h
  58. commono = ../lib/lib.lib $(kpathsea)
  59. commono_20 = ../lib/lib_20.lib $(kpathsea_20)
  60.  
  61. # Routines used in TeX and Metafont.
  62. extrac = $(srcdir)/../lib/andytexmf.c
  63. extrah = $(srcdir)/../lib/andytexmf.h $(srcdir)/../lib/texmfmem.h $(HEADERFILE)
  64.  
  65. # Routines used in TeX, Metafont, and BibTeX.
  66. fileioc = $(srcdir)/../lib/andyopeninout.c
  67. fileioo = openinout.o
  68.  
  69. objs = $(fileioo) tex0.o tex1.o tex2.o tex3.o tex4.o tex5.o tex6.o \
  70.   tex7.o tex8.o tex9.o
  71. iobjs = iextra.o initex.o
  72. vobjs = vextra.o itex.o
  73.  
  74. # Where the test files are.
  75. texsrcdir = $(srcdir)/../tex
  76. tripdir = $(texsrcdir)/TeXtrip
  77.  
  78. program = $(PS)initex $(PS)virtex patgen
  79.  
  80. # The -DTeX here is used for patgen, too, but that doesn't hurt anything.
  81. CC = sc
  82. CFLAGS = $(DEFS) math=IEEE stackcheck noicons optimize
  83. CPPFLAGS = define=_STRICT_ANSI define=TeX 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. INSTALL = copy
  93. INSTALL_PROGRAM = copy
  94. INSTALL_DATA = copy
  95.  
  96. # spiff -r5e-8 gives cleaner results than just `diff', but because it
  97. # also produces backspaces and other verbiage, I haven't taught
  98. # configure about it.
  99. DIFF = diff
  100. DIFFFLAGS = -l10000 -w
  101.  
  102. # The formats we know how to make.
  103. fmts = amslatex.fmt amstex.fmt etex.fmt inrstex.fmt latex.fmt \
  104.   picplus.fmt slitex.fmt tex.fmt texinfo.fmt 
  105.  
  106. # And how to make them.
  107. initex = TEXPOOL=. ./initex
  108.  
  109. # Need the web rules for patgen.
  110. .SUFFIXES:
  111. .SUFFIXES: .o .c .p .ch
  112. .p.c:
  113.     $(SHELL) $(srcdir)/../lib/convert.rexx $*.p $*.c
  114. .ch.p:
  115.     ../web/tangle $*.web $*.ch
  116. .c.o:
  117.     $(CC) $(CPPFLAGS) $(CFLAGS) $*.c
  118.  
  119. default: all
  120. all: $(program)
  121. triptrap: triptex
  122.  
  123. initex: $(iobjs) $(objs) $(commono_20)
  124.     $(CCLD) to initex from $(LOBJ) $(iobjs) $(objs) \
  125.     lib $(libs_20) $(LDFLAGS)
  126.  
  127. virtex: $(vobjs) $(objs) $(commono_20)
  128.     $(CCLD) to virtex from $(LOBJ) $(vobjs) $(objs) \
  129.     lib $(libs_20) $(LDFLAGS)
  130.  
  131. no20initex: $(iobjs) $(objs) $(commono)
  132.     $(CCLD) to no20initex from $(LOBJ) $(iobjs) $(objs) \
  133.     lib $(libs) $(LDFLAGS)
  134.  
  135. no20virtex: $(vobjs) $(objs) $(commono)
  136.     $(CCLD) to no20virtex from $(LOBJ) $(vobjs) $(objs) \
  137.     lib $(libs) $(LDFLAGS)
  138.  
  139. check: run-trip
  140. run-trip: $(PS)initex # triptex
  141.     -copy $(PS)initex triptex
  142.     -delete quiet trip.tex
  143.     -copy $(tripdir)/trip.tex .
  144.     -execute settripenv
  145.     ../fontutil/pltotf $(tripdir)/trip.pl trip.tfm
  146.     ../fontutil/tftopl ./trip.tfm trip.pl
  147.     -diff $(tripdir)/trip.pl trip.pl
  148.         -./triptex < $(tripdir)/trip1.in >NIL:
  149.     -diff $(tripdir)/tripin.log trip.log
  150.     -./triptex < $(tripdir)/trip2.in > trip.fot
  151. # We use $(DIFF) instead of `diff' only for those files where there
  152. # might actually be legitimate numerical differences.
  153.     -$(DIFF) $(DIFFFLAGS) $(tripdir)/trip.log trip.log
  154.     -diff $(tripdir)/trip.fot trip.fot
  155.     ../dviutil/dvitype trip.dvi < $(tripdir)/dvitype.in > trip.typ
  156.     -$(DIFF) $(DIFFFLAGS) $(tripdir)/trip.typ trip.typ
  157.  
  158. # Make format files automatically.
  159. fmts: $(fmts)
  160.  
  161. # AMSLaTeX requires that you
  162. # 1) move Lamport's lfonts.tex out of TeX's way (I use the lfonts.tex I
  163. # distribute with the sauter CM parameter files, and call it lfonts.sauter),
  164. # 2) say `lfonts.new' when lplain.tex can't find lfonts.tex,
  165. # 3) choose a ``fontdef'' file (I use fontdef.ori),
  166. # 4) a ``preload'' file, (I use preload.ori),
  167. # 5) and a ``basefont'' file.  (I use basefont).
  168. # How automatic, huh?  I can hardly wait for LaTeX 3.
  169. amslatex.fmt: initex
  170.     $(initex) lplain \\dump
  171.     mv lplain.fmt amslatex.fmt
  172.     mv lplain.log amslatex.log
  173.  
  174. # As of AMSTeX 2.1, the initialization file is named `amstex.ini'.
  175. # Because it explicitly reads plain.tex, we cannot use &./tex; that
  176. # produces a `Too late for \patterns' error.
  177. amstex.fmt: initex
  178.     $(initex) amstex.ini
  179.  
  180. etex.fmt: tex.fmt
  181.     touch eplain.aux # Makes cross-reference warnings work right.
  182.     $(initex) \&./tex eplain \\dump
  183.     mv eplain.fmt etex.fmt
  184.     mv eplain.log etex.log
  185.  
  186. inrstex.fmt: initex
  187.     $(initex) inrstex \\dump
  188.  
  189. latex.fmt: initex
  190.     $(initex) lplain \\dump
  191.     mv lplain.fmt latex.fmt
  192.     mv lplain.log latex.log
  193.  
  194. picplus.fmt: tex.fmt
  195.     $(initex) \&./tex picplus \\dump
  196.  
  197. slitex.fmt: initex
  198.     $(initex) splain \\dump
  199.     mv splain.fmt slitex.fmt
  200.     mv splain.log slitex.log
  201.  
  202. tex.fmt: initex
  203.     $(initex) plain \\dump
  204.     mv plain.fmt tex.fmt
  205.     mv plain.log tex.log
  206.  
  207. # Texinfo changes the escape character from `\' to `@'.
  208. texinfo.fmt: tex.fmt
  209.     $(initex) \&./tex texinfo @dump
  210.  
  211. # We change texd.h instead of the change file, to avoid retangling.
  212. # This target never gets executed on the Amiga.  It is only kept
  213. # for reference.
  214. triptex: stamp-trip
  215.     $(MAKE) $(makeargs) initex
  216.     mv initex triptex
  217.  
  218. stamp-trip: texd.h $(texsrcdir)/trip.sed
  219.     rm -f *.o texd.h.bak temp
  220.     sed -f $(texsrcdir)/trip.sed < texd.h > temp
  221.     mv texd.h texd.h.bak
  222.     mv temp texd.h
  223.     touch stamp-trip
  224.  
  225. clean-trip:
  226.     rm -f *.o texd.h triptex stamp-trip
  227. # Don't reinstall a texd.h with the test constants.
  228.     if grep 'memmax 2999' texd.h.bak >/dev/null 2>&1; then \
  229.           rm -f texd.h*; else mv texd.h.bak texd.h; fi
  230.  
  231. tex.p tex.pool: tex.web $(CHANGEFILE)
  232.     ../web/tangle tex.web $(CHANGEFILE)
  233.  
  234. # If you're building mltex, reportedly have to add:
  235. #        sed -e 's/xiiix/(/;s/xtttx/)/' tex.p >tex.pp
  236. #        mv tex.pp tex.p
  237.  
  238. ctex.ch: $(texsrcdir)/tex.ch $(texsrcdir)/tex.chch ../lib/texmfhistory.ch
  239.     - delete ctex.ch
  240.     $(WMERGE) $(texsrcdir)/tex.ch $(texsrcdir)/tex.chch andytex.ch
  241.     $(TIE) -c ctex.ch tex.web andytex.ch ../lib/texmfhistory.ch
  242. mtex.ch: $(texsrcdir)/tex.ch $(texsrcdir)/tex.chch \
  243.     ../lib/texmfhistory.ch $(texsrcdir)/texmemory.ch
  244.     - delete mtex.ch
  245.     $(WMERGE) $(texsrcdir)/tex.ch $(texsrcdir)/tex.chch andytex.ch
  246.     $(TIE) -c mtex.ch tex.web andytex.ch ../lib/texmfhistory.ch \
  247.     $(texsrcdir)/texmemory.ch
  248.  
  249. # The convert script produces the following. Touch texd.h to ensure its
  250. # timestamp is later than the rest.
  251. tex0.c: tex.p andycoerce.add $(commondefines)
  252.     $(SHELL) $(texsrcdir)/convert.rexx
  253.     touch texd.h
  254. tex1.c tex2.c tex3.c tex4.c tex5.c tex6.c tex7.c tex8.c tex9.c \
  255. itex.c coerce.h texd.h: tex0.c
  256.  
  257. texmemory.h: stamp-convert
  258.  
  259. stamp-convert: texd.h
  260.     copy texd.h texd.safe
  261.     $(SED) -f ../tex/texmemory.sed < texd.h > texd.temp
  262.     copy texd.temp texd.h
  263.     delete texd.temp
  264.     echo "" > stamp-convert
  265.  
  266. andycoerce.add: coerce.add coerce.add.ch
  267.     $(WMERGE) coerce.add coerce.add.ch andycoerce.add
  268.  
  269. # The (hand-coded) file $(extrac) and the (generated) file itex.c have
  270. # #ifdefs for INITEX, so we compile them differently.
  271. iextra.o: iextra.c $(commonh) $(extrah)
  272.     $(CC) $(CPPFLAGS) define=INITEX define=INI $(CFLAGS) iextra.c
  273.  
  274. initex.o: initex.c $(commonh) $(extrah)
  275.     $(CC) $(CPPFLAGS) define=INITEX $(CFLAGS) initex.c
  276.  
  277. # Avoid compiling files in another directory.
  278. iextra.c: $(extrac)
  279.     - delete iextra.c
  280.     $(LN) $(extrac) > iextra.c
  281.  
  282. initex.c: itex.c
  283.     - delete initex.c
  284.     $(LN) itex.c > initex.c
  285.  
  286. vextra.o: vextra.c
  287. vextra.c: $(extrac)
  288.     - delete vextra.c
  289.     $(LN) $(extrac) > vextra.c
  290.  
  291. $(fileioo): openinout.c
  292. openinout.c: $(fileioc)
  293.     - delete openinout.c
  294.     $(LN) $(fileioc) > openinout.c
  295.  
  296. $(iobjs) $(vobjs) $(objs): $(commonh) $(extrah)
  297.  
  298. tex0.o: tex0.c
  299. tex1.o: tex1.c
  300. tex2.o: tex2.c
  301. tex3.o: tex3.c
  302. tex4.o: tex4.c
  303. tex5.o: tex5.c
  304. tex6.o: tex6.c
  305. tex7.o: tex7.c
  306. tex8.o: tex8.c
  307. tex9.o: tex9.c
  308.  
  309. patgen: patgen.o $(commono)
  310.     $(CC) link to patgen $(CPPFLAGS) $(CFLAGS) data=far patgen.o $(commono)
  311. patgen.o: patgen.c $(commonh)
  312.     $(CC) $(CPPFLAGS) $(CFLAGS) data=far $*.c
  313. patgen.c: patgen.p $(commondefines)
  314. patgen.p: patgen.web andypatgen.ch
  315.     ../web/tangle patgen.web andypatgen.ch
  316. andypatgen.ch: patgen.ch patgen.chch
  317.     $(WMERGE) patgen.ch patgen.chch andypatgen.ch
  318.  
  319. c-sources: texd.h patgen.c
  320. .PHONY: c-sources
  321.  
  322. install: install-exec install-data
  323.  
  324. install-exec: all
  325.     $(INSTALL_PROGRAM) $(program) $(bindir)/
  326. install-data: tex.pool $(srcdir)/../config/tex.mcf
  327.     $(INSTALL_DATA) tex.pool $(texpooldir)
  328.     $(INSTALL_DATA) $(srcdir)/../config/tex.mcf) $(configdir)
  329.  
  330. clean:
  331.     - delete \#?.(bak|o|lnk|log|fmt)
  332.  
  333. veryclean: clean
  334.     - delete \#?.(dvi|pool|c|p|h|safe) andy\#? ctex.ch mtex.ch
  335.  
  336. extraclean: veryclean
  337.     - delete \#?.(aux|bbl|blg|orig|pl|rej)
  338.     - delete \#?.(i|s|tfm|vf|vpl)
  339.     - delete CONTENTS.tex texput.\#? patch\#? mfput.\#? stamp-\#?
  340.     - delete $(program) triptex trip.tex tex.mcf tripos.tex \
  341.     - delete 8terminal.tex trip.fot trip.typ
  342.