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 / tex / Makefile.in < prev    next >
Encoding:
Makefile  |  1996-09-28  |  8.4 KB  |  322 lines

  1. # Makefile for TeX.
  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 texd.h
  21.  
  22. # Routines used in TeX, Metafont, and BibTeX.
  23. fileioc = $(srcdir)/../lib/openinout.c
  24. fileioo = openinout.o
  25.  
  26. objs = $(fileioo) tex0.o tex1.o tex2.o tex3.o tex4.o tex5.o tex6.o \
  27.   tex7.o tex8.o tex9.o $(extra_tex_obj)
  28. iobjs = iextra.o initex.o
  29. vobjs = vextra.o itex.o
  30.  
  31. # Where the test files are.
  32. texsrcdir = $(srcdir)/../tex
  33. tripdir = $(texsrcdir)/TeXtrip
  34.  
  35. program = initex virtex patgen
  36.  
  37. # The -DTeX here is used for patgen, too, but that doesn't hurt anything.
  38. CC = @CC@
  39. CFLAGS =
  40. CPPFLAGS = -DTeX -I../lib -I$(srcdir)/../lib -I../.. -I$(srcdir)/../..
  41.  
  42. CCLD = $(CC)
  43. LDFLAGS = $(CFLAGS) $(XLDFLAGS)
  44. LIBS = @LIBS@ $(extralibs)
  45. libs = $(commono) $(LIBS)
  46.  
  47. INSTALL = @INSTALL@
  48. INSTALL_PROGRAM = @INSTALL_PROGRAM@
  49. INSTALL_DATA = @INSTALL_DATA@
  50.  
  51. LN = @LN_S@
  52.  
  53. # spiff -r5e-8 gives cleaner results than just `diff', but because it
  54. # also produces backspaces and other verbiage, I haven't taught
  55. # configure about it.
  56. DIFF = diff
  57. DIFFFLAGS =
  58.  
  59. # The formats we know how to make.
  60. fmts = amslatex.fmt amstex.fmt etex.fmt inrstex.fmt latex.fmt \
  61.   picplus.fmt slitex.fmt tex.fmt texinfo.fmt 
  62.  
  63. # And how to make them.
  64. initex = TEXPOOL=. ./initex
  65. # For AmigaOS with pre 41.2 ixemul.library, do this:
  66. #initex = echo "$(srcdir)" >env:TEXPOOL; ./initex
  67.  
  68.  
  69. # What to pass to submakes.
  70. makeargs=SHELL='$(SHELL)' CC='$(CC)' CFLAGS='$(CFLAGS)' CCLD='$(CCLD)' \
  71. LDFLAGS='$(LDFLAGS)' LIBS='$(libs)' LN='$(LN)'
  72.  
  73.  
  74. # Need the web rules for patgen.
  75. .SUFFIXES:
  76. .SUFFIXES: .o .c .p .ch
  77. .p.c:
  78.     $(SHELL) $(srcdir)/../lib/convert $< $*.c $(srcdir)
  79. .ch.p:
  80.     ../web/tangle $(srcdir)/$*.web $<
  81.     cp $(srcdir)/$*.p $*.p
  82.     rm -f $(srcdir)/$*.p
  83. .c.o:
  84.     $(CC) $(CPPFLAGS) $(CFLAGS) -c $<
  85.  
  86.  
  87. default: all
  88. all: $(program)
  89. triptrap: triptex
  90.  
  91. initex: $(iobjs) $(objs) $(commono)
  92.     $(CCLD) -o initex $(LDFLAGS) $(iobjs) $(objs) $(libs)
  93.  
  94. virtex: $(vobjs) $(objs) $(commono)
  95.     $(CCLD) -o virtex $(LDFLAGS) $(vobjs) $(objs) $(libs)
  96.  
  97. check: run-trip
  98. run-trip: triptex
  99.     rm -f trip.tex
  100.     -$(LN) $(tripdir)/trip.tex .
  101.     ../fontutil/pltotf $(tripdir)/trip.pl trip.tfm
  102.     ../fontutil/tftopl ./trip.tfm trip.pl
  103.     -diff $(tripdir)/trip.pl trip.pl
  104.     -$(SHELL) -c '. ./tripenv; \
  105.           ./triptex < $(tripdir)/trip1.in >/dev/null 2>&1'
  106.     -diff $(tripdir)/tripin.log trip.log
  107.     -$(SHELL) -c '. ./tripenv; ./triptex < $(tripdir)/trip2.in > trip.fot'
  108. # We use $(DIFF) instead of `diff' only for those files where there
  109. # might actually be legitimate numerical differences.
  110.     -$(DIFF) $(DIFFFLAGS) $(tripdir)/trip.log trip.log
  111.     -diff $(tripdir)/trip.fot trip.fot
  112.     $(SHELL) -c '. ./tripenv; \
  113.       ../dviutil/dvitype trip.dvi < $(tripdir)/dvitype.in > trip.typ'
  114.     -$(DIFF) $(DIFFFLAGS) $(tripdir)/trip.typ trip.typ
  115.  
  116.  
  117. # Make format files automatically.
  118. fmts: $(fmts)
  119.  
  120. # AMSLaTeX requires that you
  121. # 1) move Lamport's lfonts.tex out of TeX's way (I use the lfonts.tex I
  122. # distribute with the sauter CM parameter files, and call it lfonts.sauter),
  123. # 2) say `lfonts.new' when lplain.tex can't find lfonts.tex,
  124. # 3) choose a ``fontdef'' file (I use fontdef.ori),
  125. # 4) a ``preload'' file, (I use preload.ori),
  126. # 5) and a ``basefont'' file.  (I use basefont).
  127. # How automatic, huh?  I can hardly wait for LaTeX 3.
  128. amslatex.fmt: initex
  129.     $(initex) lplain \\dump
  130.     mv lplain.fmt amslatex.fmt
  131.     mv lplain.log amslatex.log
  132.  
  133. # As of AMSTeX 2.1, the initialization file is named `amstex.ini'.
  134. # Because it explicitly reads plain.tex, we cannot use &./tex; that
  135. # produces a `Too late for \patterns' error.
  136. amstex.fmt: initex
  137.     $(initex) amstex.ini
  138.  
  139. etex.fmt: tex.fmt
  140.     touch eplain.aux # Makes cross-reference warnings work right.
  141.     $(initex) \&./tex eplain \\dump
  142.     mv eplain.fmt etex.fmt
  143.     mv eplain.log etex.log
  144.  
  145. inrstex.fmt: initex
  146.     $(initex) inrstex \\dump
  147.  
  148. latex.fmt: initex
  149.     $(initex) lplain \\dump
  150.     mv lplain.fmt latex.fmt
  151.     mv lplain.log latex.log
  152.  
  153. picplus.fmt: tex.fmt
  154.     $(initex) \&./tex picplus \\dump
  155.  
  156. slitex.fmt: initex
  157.     $(initex) splain \\dump
  158.     mv splain.fmt slitex.fmt
  159.     mv splain.log slitex.log
  160.  
  161. tex.fmt: initex
  162.     $(initex) plain \\dump
  163.     mv plain.fmt tex.fmt
  164.     mv plain.log tex.log
  165.  
  166. # Texinfo changes the escape character from `\' to `@'.
  167. texinfo.fmt: tex.fmt
  168.     $(initex) \&./tex texinfo @dump
  169.  
  170.  
  171. # We change texd.h instead of the change file, to avoid retangling.
  172. triptex: stamp-trip
  173.     $(MAKE) $(makeargs) initex
  174.     mv initex triptex
  175.  
  176. stamp-trip: texd.h $(texsrcdir)/trip.sed
  177.     rm -f *.o texd.h.bak temp
  178.     sed -f $(texsrcdir)/trip.sed < texd.h > temp
  179.     mv texd.h texd.h.bak
  180.     mv temp texd.h
  181.     touch stamp-trip
  182.  
  183. clean-trip:
  184.     rm -f *.o texd.h triptex stamp-trip
  185. # Don't reinstall a texd.h with the test constants.
  186.     if grep 'memmax 2999' texd.h.bak >/dev/null 2>&1; then \
  187.           rm -f texd.h*; else mv texd.h.bak texd.h; fi
  188.  
  189. tex.p tex.pool: tex.web ctex.ch
  190.     ../web/tangle $(srcdir)/tex.web ctex.ch
  191.     cp $(srcdir)/tex.p tex.p
  192.     cp $(srcdir)/tex.pool tex.pool
  193.     rm -f $(srcdir)/tex.p $(srcdir)/tex.pool
  194.  
  195. # If you're building mltex, reportedly have to add:
  196. #        sed -e 's/xiiix/(/;s/xtttx/)/' tex.p >tex.pp
  197. #        mv tex.pp tex.p
  198.  
  199. ctex.ch: $(texsrcdir)/tex.ch
  200.     rm -f ctex.ch
  201.     cp $(texsrcdir)/tex.ch ctex.ch
  202.  
  203. # The convert script produces the following. Touch texd.h to ensure its
  204. # timestamp is later than the rest.
  205. tex0.c tex1.c tex2.c tex3.c tex4.c tex5.c tex6.c tex7.c tex8.c tex9.c \
  206. itex.c coerce.h texd.h: tex.p coerce.add $(commondefines)
  207.     $(SHELL) $(texsrcdir)/convert $(srcdir)
  208.     touch texd.h
  209.  
  210. # The (hand-coded) file $(extrac) and the (generated) file itex.c have
  211. # #ifdefs for INITEX, so we compile them differently.
  212. iextra.o: iextra.c $(commonh) $(extrah)
  213.     $(CC) $(CPPFLAGS) -DINITEX -DINI $(CFLAGS) -c iextra.c
  214.  
  215. initex.o: initex.c $(commonh) $(extrah)
  216.     $(CC) $(CPPFLAGS) -DINITEX $(CFLAGS) -c initex.c
  217.  
  218. # Avoid compiling files in another directory.
  219. iextra.c: $(extrac)
  220.     rm -f iextra.c
  221.     $(LN) $(extrac) iextra.c
  222.  
  223. initex.c: itex.c
  224.     rm -f initex.c
  225.     $(LN) itex.c initex.c
  226.  
  227. vextra.c: $(extrac)
  228.     rm -f vextra.c
  229.     $(LN) $(extrac) vextra.c
  230.  
  231. openinout.c: $(fileioc)
  232.     rm -f openinout.c
  233.     $(LN) $(fileioc) openinout.c
  234.  
  235. $(iobjs) $(vobjs) $(objs): $(commonh) $(extrah)
  236.  
  237. tex0.o: tex0.c
  238. tex1.o: tex1.c
  239. tex2.o: tex2.c
  240. tex3.o: tex3.c
  241. tex4.o: tex4.c
  242. tex5.o: tex5.c
  243. tex6.o: tex6.c
  244. tex7.o: tex7.c
  245. tex8.o: tex8.c
  246. tex9.o: tex9.c
  247.  
  248.  
  249. patgen: patgen.o $(commono)
  250.     $(CCLD) -o patgen $(LDFLAGS) patgen.o $(libs)
  251. patgen.o: patgen.c $(commonh)
  252. patgen.c: patgen.p $(commondefines)
  253. patgen.p: patgen.web patgen.ch
  254.  
  255.  
  256. Makefile: Makefile.in ../config.status
  257.     (cd ..; sh config.status)
  258.  
  259.  
  260. c-sources: texd.h patgen.c
  261. .PHONY: c-sources
  262.  
  263. install: install-exec install-data
  264.  
  265. install-exec: all
  266.     $(srcdir)/../../mkdirchain $(texpooldir) $(texdatadir) $(fontdir)
  267.     for p in $(program); do $(INSTALL_PROGRAM) $$p $(bindir)/$$p; done
  268.  
  269. # The dependency should really be tex.pool, but can't do that in suffix rules.
  270. install-data: tex0.c
  271.     $(SHELL) $(srcdir)/../../mkdirchain $(texpooldir) $(fontdir)
  272.     -if test -s tex.pool; then \
  273.       $(INSTALL_DATA) tex.pool $(texpooldir)/tex.pool; else true; fi
  274.     if test ! -f $(fontdir)/texfonts.map                \
  275.        || grep 'original texfonts.map --' $(fontdir)/texfonts.map    \
  276.               >/dev/null 2>&1; then                    \
  277.          $(INSTALL_DATA) $(texsrcdir)/texfonts.map $(fontdir)/texfonts.map;\
  278.         else true; fi
  279.  
  280. TAGS: *.c *.h
  281.     etags -t *.c *.h
  282.  
  283.  
  284. mostlyclean::
  285.     rm -f *.o $(program) $(lib) $(programs)
  286.  
  287. clean:: mostlyclean
  288.     rm -f *.dvi *.pool
  289.  
  290. distclean:: clean
  291.     rm -f Makefile config.status c-auto.h
  292.  
  293. # Although we can remake configure and c-auto.h.in, we don't remove
  294. # them, since many people may lack Autoconf.  Use configclean for that.
  295. realclean:: distclean
  296.     rm -f TAGS *.info*
  297.  
  298. extraclean::
  299.     rm -f *.aux *.bak *.bbl *.blg *.dvi *.log *.orig *.pl *.rej
  300.     rm -f *.i *.s *.tfm *.vf *.vpl *\#* *gf *pk *~
  301.     rm -f CONTENTS.tex a.out core mfput.* patch* texput.*
  302.  
  303. configclean:
  304.     rm -f configure c-auto.h.in c-auto.h
  305.  
  306.  
  307. # Prevent GNU make 3 from overflowing arg limit on system V.
  308. .NOEXPORT:
  309.  
  310. mostlyclean::
  311.     rm -f stamp-* triptex
  312.     rm -f texd.h texd.h.bak coerce.h *.log *.fmt
  313.     rm -f 8terminal.tex tripos.tex trip.typ trip.dvi trip.fot
  314.     rm -f trip.pl trip.tfm trip.tex
  315.  
  316. clean::
  317.     rm -f *.c *.h *.p
  318.  
  319. distclean:: clean
  320.     rm -f ctex.ch
  321.