# Makefile for web2c --kb@mail.tug.org. Public domain.
version = 7.0

# These lines define the memory dumps that fmts/bases/mems will make and
# install-fmts/install-bases/install-mems will install. plain.* is
# created automatically (as a link).  See the Formats node in
# doc/web2c.texi for details on the fmts.
#fmts = latex.fmt # amstex.fmt eplain.fmt texinfo.fmt
LATEX = latex209
fmts = latex209.fmt latex2e.fmt latex.fmt slitex.fmt amstex.fmt amslatex.fmt \
	texinfo.fmt eplain.fmt \
	etex.fmt etex_latex209.fmt etex_latex2e.fmt etex_latex.fmt \
	etex_slitex.fmt etex_amstex.fmt etex_amslatex.fmt etex_texinfo.fmt \
	etex_eplain.fmt
bases = cmmf.base # Not recommended, but we keep it for compatibility.
mems =  # mfplain.mem is probably not generally useful.

# This should be tex.ch for TeX and tex-merged.ch for e-TeX.
TEXCH = tex-merged.ch

# The name of the file that defines your local devices for Metafont.
# (Only relevant during `make bases'.)  I recommend `modes.mf', which
# defines all known modes, plus useful definitions for all fonts.  It's
# available from ftp://ftp.tug.org/tex/modes.mf, among other places.
localmodes = modes

ac_include ../make/paths.make

# Used for installation.
LN = @LN_S@

# Used for triptrap.
DIFF = ./triptrapdiff.pl
DIFFFLAGS =

.SUFFIXES: # get rid of .p.o
ac_include ../make/common.make
ac_include ../make/programs.make
##ifeq ($(CC), gcc)
##XDEFS = -Wimplicit -Wreturn-type -Wcomment -Wformat -D__USE_FIXED_PROTOTYPES__
##endif

# Make `#include <X11/...>' and `-lX...' work.
# This matches xdvik.
# wlibs is substituted by web2c's configure, LIBS by general configure
# routines, and the others by AC_PATH_XTRA.
# All the x_... variables will be empty if we aren't supporting X.
x_cppflags = @X_CFLAGS@
x_ldflags = @X_LIBS@
x_pre_libs = @X_PRE_LIBS@
x_extra_libs = @X_EXTRA_LIBS@
x_tool_libs = @x_tool_libs@
x_ext_lib = @x_ext_lib@
wlibs = @wlibs@
# Follow the library order used in X11R6 itself:
#   -lXaw -lXmu -lXt -lSM -lICE -lXext -lX11 (some may not be present).
windowlink = $(windowlib) $(x_ldflags) $(x_tool_libs) $(x_pre_libs) $(x_ext_lib) $(wlibs) $(x_extra_libs)

# With --enable-ipc, TeX may need to link with -lsocket.
socketlibs = @socketlibs@

common_makeargs = $(MFLAGS) CC='$(CC)' CFLAGS='$(CFLAGS)' $(XMAKEARGS)
window_makeargs = x_cppflags='$(x_cppflags)' $(common_makeargs)
install_makeargs = INSTALL='$(INSTALL)' INSTALL_DATA='$(INSTALL_DATA)' \
  INSTALL_PROGRAM='$(INSTALL_PROGRAM)' \
  $(makevars) $(common_makeargs)  

proglib = lib/lib.a
windowlib = window/window.a

# The sh script that does the conversion:
web2c = srcdir=$(srcdir) $(shared_env) $(SHELL) $(srcdir)/web2c/convert
# Additional dependencies:
web2c_aux = web2c/convert web2c/common.defines
web2c_programs = web2c/fixwrites web2c/splitup web2c/web2c

# Unfortunately, suffix rules can't have dependencies, or multiple
# targets, and we can't assume all makes supports pattern rules.
.SUFFIXES: .p .c .ch .p
.p.c: # really depends on $(web2c_programs), and generates .h.
	 $(web2c) $*
.ch.p: # really depends on ./tangle; for mf/mp/tex, also generates .pool
	$(shared_env) ./tangle $(srcdir)/$*.web $<

# These definitions have to come before the rules that expand them.
# The *{ini,[0-2]}.c files are created by splitup, run as part of convert.
# {mf,mp,tex}extra.c are created from lib/texmfmp.c, below.
mf_c = mfini.c mf0.c mf1.c mf2.c
mf_o = mfini.o mf0.o mf1.o mf2.o mfextra.o
mp_c = mpini.c mp0.c mp1.c mp2.c
mp_o = mpini.o mp0.o mp1.o mp2.o mpextra.o
tex_c = texini.c tex0.c tex1.c tex2.c
tex_o = texini.o tex0.o tex1.o tex2.o texextra.o

other_c = bibtex.c dvicopy.c dvitomp.c dvitype.c gftodvi.c gftopk.c gftype.c \
  mft.c patgen.c pktogf.c pktype.c pltotf.c pooltype.c tangle.c \
  tangleboot.c tftopl.c vftovp.c vptovf.c weave.c
all_c = $(other_c) $(mf_c) $(mp_c) $(tex_c)

# Prevent Make from deleting the intermediate forms.
.PRECIOUS: %.p %.c

programs = bibtex dvicopy dvitomp dvitype gftodvi gftopk gftype mf \
mft mpost patgen pktogf pktype pltotf pooltype tangle tex tftopl vftovp \
vptovf weave

mpware = mpware/dmp mpware/makempx mpware/mpto mpware/newer
mpware_sources = mpware/dmp.c mpware/makempx.in mpware/mpto.c mpware/newer.c

tie = tie/tie
tie_sources = tie/tie.c

#  
default all: programs formats doc/web2c.info
programs: $(programs) $(mpware) $(tie)

# Rules to link each program. I wish we could use a suffix rule for
# this, since it's so repetitive, but null suffixes don't work. And old
# makes don't support pattern rules. Doomed to forever cater to obsolesence.
bibtex: bibtex.o
	$(kpathsea_link) bibtex.o $(LOADLIBES)
dvicopy: dvicopy.o
	$(kpathsea_link) dvicopy.o $(LOADLIBES)
dvitomp: dvitomp.o
	$(kpathsea_link) dvitomp.o $(LOADLIBES)
dvitype: dvitype.o
	$(kpathsea_link) dvitype.o $(LOADLIBES)
gftodvi: gftodvi.o
	$(kpathsea_link) gftodvi.o $(LOADLIBES)
gftopk: gftopk.o
	$(kpathsea_link) gftopk.o $(LOADLIBES)
gftype: gftype.o
	$(kpathsea_link) gftype.o $(LOADLIBES)
mf: $(mf_o) $(windowlib)
	$(kpathsea_link) $(mf_o) $(windowlink) $(LOADLIBES)
mft: mft.o
	$(kpathsea_link) mft.o $(LOADLIBES)
mpost: $(mp_o)
	$(kpathsea_link) $(mp_o) $(LOADLIBES)
patgen: patgen.o
	$(kpathsea_link) patgen.o $(LOADLIBES)
pktogf: pktogf.o
	$(kpathsea_link) pktogf.o $(LOADLIBES)
pktype: pktype.o
	$(kpathsea_link) pktype.o $(LOADLIBES)
pltotf: pltotf.o
	$(kpathsea_link) pltotf.o $(LOADLIBES)
pooltype: pooltype.o
	$(kpathsea_link) pooltype.o $(LOADLIBES)
tex: $(tex_o)
	$(kpathsea_link) $(tex_o) $(socketlibs) $(LOADLIBES)
tftopl: tftopl.o
	$(kpathsea_link) tftopl.o $(LOADLIBES)
vftovp: vftovp.o
	$(kpathsea_link) vftovp.o $(LOADLIBES)
vptovf: vptovf.o
	$(kpathsea_link) vptovf.o $(LOADLIBES)
weave: weave.o
	$(kpathsea_link) weave.o $(LOADLIBES)

# We put some programs (written directly in C) in a subdirectory.
$(mpware): $(mpware_sources)
	cd mpware && $(MAKE) $(common_makeargs)

$(tie): $(tie_sources)
	cd tie && $(MAKE) $(common_makeargs)

# Additional dependencies for retangling.
bibtex.p dvicopy.p dvitomp.p dvitype.p gftopk.p gftodvi.p gftype.p \
  mf.p mft.p mp.p patgen.p \
  pktogf.p pktype.p pltotf.p pooltype.p \
  tex.p tftopl.p vftovp.p vptovf.p weave.p: tangle
bibtex.p: bibtex.web bibtex.ch
dvicopy.p: dvicopy.web dvicopy.ch
dvitomp.p: dvitomp.web dvitomp.ch
dvitype.p: dvitype.web dvitype.ch
gftodvi.p: gftodvi.web gftodvi.ch
gftopk.p: gftopk.web gftopk.ch
gftype.p: gftype.web gftype.ch
mf.p mf.pool: mf.web mf.ch
mp.p mp.pool: mp.web mp.ch
mft.p: mft.web mft.ch
patgen.p: patgen.web patgen.ch
pktogf.p: pktogf.web pktogf.ch
pktype.p: pktype.web pktype.ch
pltotf.p: pltotf.web pltotf.ch
pooltype.p: pooltype.web pooltype.ch
tftopl.p: tftopl.web tftopl.ch
vftovp.p: vftovp.web vftovp.ch
vptovf.p: vptovf.web vptovf.ch
weave.p: weave.web weave.ch

tex.p tex.pool: tex.web $(TEXCH)
	$(shared_env) ./tangle $(srcdir)/tex.web $(srcdir)/$(TEXCH)

# Additional dependencies for reconverting to C.
$(other_c): $(web2c_aux) $(web2c_programs)
bibtex.c: web2c/cvtbib.sed
c-sources: $(all_c)

# Metafont and TeX generate more than .c file.
web2c_texmf = $(web2c_aux) $(web2c_programs) web2c/texmf.defines
$(mf_c) mfcoerce.h mfd.h: mf.p $(web2c_texmf) web2c/cvtmf1.sed web2c/cvtmf2.sed
	$(web2c) mf
$(mp_c) mpcoerce.h mpd.h: mp.p $(web2c_texmf) web2c/cvtmf1.sed web2c/cvtmf2.sed
	$(web2c) mp
$(tex_c) texcoerce.h texd.h: tex.p $(web2c_texmf)
	$(web2c) tex

# We need to merge etex.ch and tex.ch with tie.
tex-merged.ch: $(tie) tex.web etex.ch tex.ch tex.ech
	$(tie) -c $@ tex.web etex.ch tex.ch tex.ech

# As long as we have to have separate rules to create these, might as well do
# a little work to avoid separate compilation rules, too.
mfextra.c: lib/texmfmp.c
	sed s/TEX-OR-MF-OR-MP/mf/ $(srcdir)/lib/texmfmp.c >$@
mpextra.c: lib/texmfmp.c
	sed s/TEX-OR-MF-OR-MP/mp/ $(srcdir)/lib/texmfmp.c >$@
texextra.c: lib/texmfmp.c
	sed s/TEX-OR-MF-OR-MP/tex/ $(srcdir)/lib/texmfmp.c >$@

# Additional dependencies for recompiling the C code are generated
# automatically, included at the end.

# Additional dependencies for relinking.
$(web2c_programs) $(programs) tangle tangleboot: $(kpathsea) $(proglib)

# 
# Bootstrapping tangle requires making it with itself.
tangle: tangle.o
	$(kpathsea_link) tangle.o $(LOADLIBES)
# tangle.p is a special case, since it is needed to compile itself.  We
# compile the (distributed) tangleboot.c to make a tangle which we use
# to make the other programs.
tangle.p: tangleboot tangle.web tangle.ch
	$(shared_env) ./tangleboot $(srcdir)/tangle.web $(srcdir)/tangle.ch
tangle.web:
	@echo "You seem to be missing tangle.web, perhaps because you" >&2
	@echo "didn't retrieve web.tar.gz, only web2c.tar.gz." >&2
	@echo "You need both." >&2
	@echo >&2
	@echo "web.tar.gz should be available from the" >&2
	@echo "same place that you got web2c.tar.gz." >&2
	@echo "In any case, you can get it from" >&2
	@echo "ftp://ftp.tug.org/tex/web.tar.gz." >&2
	false

tangleboot: tangleboot.o
	$(kpathsea_link) tangleboot.o $(LOADLIBES)
# tangleboot.[chp] are in the distribution, but keep them up-to-date.
tangleboot.c tangleboot.h: tangleboot.p $(web2c_programs) $(web2c_aux)
	$(web2c) tangleboot
# tangleboot.p is also a special case, because we must assume a
# working tangle is present in PATH.  This is not run unless tangle.ch
# is changed.
tangleboot.p: tangle.web tangle.ch
	tangle $(srcdir)/tangle.web $(srcdir)/tangle.ch
	mv tangle.p tangleboot.p

# Even web2c itself uses the library.
# It's annoying to have to give all the filenames here, 
# but texmfmp.c is an exception.
lib_sources = lib/alloca.c lib/basechsuffix.c lib/chartostring.c \
  lib/eofeoln.c lib/fprintreal.c lib/input2int.c lib/inputint.c lib/main.c \
  lib/openclose.c lib/printversion.c lib/uexit.c lib/usage.c lib/version.c \
  lib/zround.c 
$(proglib): $(lib_sources)
	cd lib && $(MAKE) $(common_makeargs)

# No exceptions in this library.
window_sources = $(srcdir)/window/*.c
$(windowlib): mfd.h $(window_sources)
	cd window && $(MAKE) $(window_makeargs)

# The web2c program consists of several executables.
web2c/fixwrites: web2c/fixwrites.c
	cd web2c && $(MAKE) $(common_makeargs) fixwrites
web2c/splitup: web2c/splitup.c
	cd web2c && $(MAKE) $(common_makeargs) splitup
web2c/web2c: web2c/main.c web2c/web2c.h web2c/web2c.l web2c/web2c.y
	cd web2c && $(MAKE) $(common_makeargs) web2c

ac_include ../make/tkpathsea.make

# 
# Making formats and bases.
all_fmts = tex.fmt $(fmts)
all_bases = mf.base $(bases)
all_mems = mpost.mem $(mems)

formats: fmts bases mems
fmts: $(all_fmts)
bases: $(all_bases)
mems: $(all_mems)

tex.fmt: tex
	$(MAKE) files="plain.tex cmr10.tfm" prereq-check
	./tex --ini \\input plain \\input SIPB.tex \\dump </dev/null
	rm -f tex.fmt; mv plain.fmt tex.fmt
	rm -f tex.log; mv plain.log tex.log

etex.fmt: tex
	$(MAKE) files="etex.src plain.tex cmr10.tfm" prereq-check
	./tex --ini \*\\input etex.src \\input SIPB.tex \\dump </dev/null
	rm -f etex.log; mv etex.src.log etex.log
	rm -f etex.fmt; mv etex.src.fmt etex.fmt

latex.fmt: $(LATEX).fmt
	rm -f latex.fmt; ln -s $(LATEX).fmt latex.fmt
	rm -f latex.log; ln -s $(LATEX).log latex.log

etex_latex.fmt: etex_$(LATEX).fmt
	rm -f etex_latex.fmt; ln -s etex_$(LATEX).fmt etex_latex.fmt
	rm -f etex_latex.log; ln -s etex_$(LATEX).log etex_latex.log

latex209.fmt: tex
	$(MAKE) files=lplain.tex prereq-check
	./tex --ini \\input lplain \\input SIPB.tex \\dump </dev/null
	rm -f latex209.fmt; mv lplain.fmt latex209.fmt
	rm -f latex209.log; mv lplain.log latex209.log

etex_latex209.fmt: tex
	$(MAKE) files=lplain.tex prereq-check
	./tex --ini \*\\input lplain \\input SIPB.tex \\dump </dev/null
	rm -f etex_latex209.fmt; mv lplain.fmt etex_latex209.fmt
	rm -f etex_latex209.log; mv lplain.log etex_latex209.log

latex2e.fmt: tex
	$(MAKE) files=latex.ltx prereq-check
	-mv latex.fmt latex.fmt.save
	-mv latex.log latex.log.save
# There doesn't appear to be a way to use SIPB.tex here.  Oh well.
	./tex --ini latex.ltx </dev/null
	mv latex.fmt latex2e.fmt
	mv latex.log latex2e.log
	-mv latex.fmt.save latex.fmt
	-mv latex.log.save latex.log

etex_latex2e.fmt: tex
	$(MAKE) files=latex.ltx prereq-check
	-mv latex.fmt latex.fmt.save
	-mv latex.log latex.log.save
# There doesn't appear to be a way to use SIPB.tex here.  Oh well.
	./tex --ini \*latex.ltx </dev/null
	mv latex.fmt etex_latex2e.fmt
	mv latex.log etex_latex2e.log
	-mv latex.fmt.save latex.fmt
	-mv latex.log.save latex.log

slitex.fmt: tex
	$(MAKE) files=splain.tex prereq-check
	./tex --ini \\input splain \\input SIPB.tex \\dump </dev/null
	mv splain.fmt slitex.fmt
	mv splain.log slitex.log

etex_slitex.fmt: tex
	$(MAKE) files=splain.tex prereq-check
	./tex --ini \*\\input splain \\input SIPB.tex \\dump </dev/null
	mv splain.fmt etex_slitex.fmt
	mv splain.log etex_slitex.log

mf.base: mf
	$(MAKE) files="plain.mf cmr10.mf $(localmodes).mf" prereq-check
	./mf --ini \\input plain input $(localmodes) dump </dev/null
	rm -f mf.base; mv plain.base mf.base
	rm -f mf.log; mv plain.log mf.log

cmmf.base: mf mf.base
	$(MAKE) files="cmbase.mf" prereq-check
	./mf --ini \&./mf cmbase dump </dev/null
	rm -f cmmf.base; mv cmbase.base cmmf.base
	rm -f cmmf.log; mv cmbase.log cmmf.log

mpost.mem: mpost
	$(MAKE) files=plain.mp prereq-check
	./mpost --ini \\input plain dump </dev/null
	rm -f mpost.mem; mv plain.mem mpost.mem
	rm -f mpost.log; mv plain.log mpost.log

# This is meant to be called recursively, with $(files) set.
prereq-check: $(kpathsea_dir)/kpsewhich
	$(kpathsea_dir)/kpsewhich $(files) >/dev/null || $(MAKE) prereq-lose >/dev/null

prereq-lose:
	@echo "You seem to be missing input files necessary to make the" >&2
	@echo "basic formats (some or all of: $(files))." >&2
	@echo "Perhaps you've defined the default paths incorrectly, or" >&2
	@echo "perhaps you have environment variables set pointing" >&2
	@echo "to an incorrect location.  See ../kpathsea/BUGS." >&2
	@echo >&2
	@echo "If you simply do not have the files, you can" >&2
	@echo "retrieve a minimal set of input files from" >&2
	@echo "ftp://ftp.tug.org/tex/lib.tar.gz, mirrored on" >&2
	@echo "CTAN hosts in systems/web2c." >&2
	false

$(kpathsea_dir)/kpsewhich: $(kpathsea)

amstex.fmt: tex tex.fmt
#	./tex -ini amstex.ini </dev/null
	./tex -ini \&./tex amstex \\input SIPB.tex \\dump

etex_amstex.fmt: tex etex.fmt
#	./tex -ini amstex.ini </dev/null
	-mv amstex.fmt amstex.fmt.save
	-mv amstex.log amstex.log.save
	./tex -ini \&./etex amstex \\input SIPB.tex \\dump
	mv amstex.fmt etex_amstex.fmt
	mv amstex.log etex_amstex.log
	-mv amstex.fmt.save amstex.fmt
	-mv amstex.log.save amstex.log

# AMSLaTeX requires that you
# 1) move Lamport's lfonts.tex out of TeX's way (I use the lfonts.tex I
# distribute with the sauter CM parameter files, and call it lfonts.sauter),
# 2) say `lfonts.new' when lplain.tex can't find lfonts.tex,
# 3) choose a ``fontdef'' file (I use fontdef.ori),
# 4) a ``preload'' file, (I use preload.ori),
# 5) and a ``basefont'' file.  (I use basefont).
# How automatic, huh?  I can hardly wait for LaTeX 3.

# Gross manual build procedures require gross hacks.
amslatex.fmt: tex
	$(MAKE) files=lfonts.new prereq-check
	rm -f lfonts.tex fontdef.tex preload.tex xxxlfont.sty
#	cp ../../texmf/tex/amslatex/fontsel/lfonts.new lfonts.tex
#	cp ../../texmf/tex/amslatex/inputs/fontdef.ams fontdef.tex
#	cp ../../texmf/tex/amslatex/fontsel/preload.ori preload.tex
#	cp ../../texmf/tex/amslatex/fontsel/basefont.tex xxxlfont.sty
	echo '\input lfonts.new' > lfonts.tex
	echo '\input fontdef.ams' > fontdef.tex
	echo '\input preload.ori' > preload.tex
	echo '\input basefont.tex' > xxxlfont.sty
	./tex -ini lplain \\input SIPB.tex \\dump
	rm -f lfonts.tex fontdef.tex preload.tex xxxlfont.sty amslatex.fmt
	rm -f amslatex.log
	mv lplain.fmt amslatex.fmt
	mv lplain.log amslatex.log

etex_amslatex.fmt: tex
	$(MAKE) files=lfonts.new prereq-check
	rm -f lfonts.tex fontdef.tex preload.tex xxxlfont.sty
#	cp ../../texmf/tex/amslatex/fontsel/lfonts.new lfonts.tex
#	cp ../../texmf/tex/amslatex/inputs/fontdef.ams fontdef.tex
#	cp ../../texmf/tex/amslatex/fontsel/preload.ori preload.tex
#	cp ../../texmf/tex/amslatex/fontsel/basefont.tex xxxlfont.sty
	echo '\input lfonts.new' > lfonts.tex
	echo '\input fontdef.ams' > fontdef.tex
	echo '\input preload.ori' > preload.tex
	echo '\input basefont.tex' > xxxlfont.sty
	./tex -ini \*lplain \\input SIPB.tex \\dump
	rm -f lfonts.tex fontdef.tex preload.tex xxxlfont.sty
	rm -f etex_amslatex.fmt etex_amslatex.log
	mv lplain.fmt etex_amslatex.fmt
	mv lplain.log etex_amslatex.log


# Texinfo changes the escape character from `\' to `@'.
texinfo.fmt: tex.fmt
	./tex -ini texinfo @input SIPB.texinfo @dump </dev/null

etex_texinfo.fmt: tex.fmt
	-mv texinfo.fmt texinfo.fmt.save
	-mv texinfo.log texinfo.log.save
	./tex -ini \*texinfo @input SIPB.texinfo @dump </dev/null
	mv texinfo.fmt etex_texinfo.fmt
	mv texinfo.log etex_texinfo.log
	-mv texinfo.fmt.save texinfo.fmt
	-mv texinfo.log.save texinfo.log

eplain.fmt: tex.fmt
	touch eplain.aux # Makes cross-reference warnings work right.
	./tex -ini \&./tex eplain \\input SIPB.tex \\dump </dev/null

etex_eplain.fmt: tex.fmt
	touch eplain.aux # Makes cross-reference warnings work right.
	-mv eplain.fmt eplain.fmt.save
	-mv eplain.log eplain.log.save
	./tex -ini \&./etex eplain \\input SIPB.tex \\dump </dev/null
	mv eplain.fmt etex_eplain.fmt
	mv eplain.log etex_eplain.log
	-mv eplain.fmt.save eplain.fmt
	-mv eplain.log.save eplain.log


# 
install: install-exec install-data
install-exec:: install-links
install-data:: install-formats

# The actual binary executables and pool files.
install-programs: $(programs)
	$(SHELL) $(top_srcdir)/../mkdirchain $(bindir) $(texpooldir) \
	  $(mfpooldir) $(mppooldir)
	cd mpware && $(MAKE) $(install_makeargs) install-exec
	cd tie && $(MAKE) $(install_makeargs) install
	for p in $(programs); do $(INSTALL_LIBTOOL_PROG) $(bindir) $$p; done

# The links to {mf,mp,tex} for each format and for {ini,vir}{mf,mp,tex}.
install-links: install-programs
	cd $(bindir) && for prog in mf mpost tex; do \
	  rm -f ini$$prog vir$$prog; \
	  $(LN) $$prog ini$$prog && $(LN) $$prog vir$$prog; done
	for f in $(fmts) mltex; do base=`basename $$f .fmt`; \
          (cd $(bindir) && (rm -f $$base; $(LN) tex $$base)); done
# The ugly "" avoids a syntax error in case the lists are empty.
	test -z "$(bases)" || for f in ""$(bases); do base=`basename $$f .base`;\
          (cd $(bindir) && (rm -f $$base; $(LN) mf $$base)); done
	test -z "$(mems)" || for f in ""$(mems); do base=`basename $$f .mem`; \
          (cd $(bindir) && (rm -f $$base; $(LN) mpost $$base)); done

# Always do plain.*, so examples from the TeXbook (etc.) will work.
install-formats: install-fmts install-bases install-mems
install-fmts: $(all_fmts)
	$(SHELL) $(top_srcdir)/../mkdirchain $(fmtdir)
	for f in $(all_fmts); do $(INSTALL_DATA) $$f $(fmtdir)/$$f; done
	cd $(fmtdir) && (rm -f plain.fmt; $(LN) tex.fmt plain.fmt)

install-bases: $(all_bases)
	$(SHELL) $(top_srcdir)/../mkdirchain $(basedir)
	for f in $(all_bases); do $(INSTALL_DATA) $$f $(basedir)/$$f; done
	cd $(basedir) && (rm -f plain.base; $(LN) mf.base plain.base)

install-mems: $(all_mems)
	$(SHELL) $(top_srcdir)/../mkdirchain $(memdir)
	for f in $(all_mems); do $(INSTALL_DATA) $$f $(memdir)/$$f; done
	cd $(memdir) && (rm -f plain.mem; $(LN) mpost.mem plain.mem)

# Auxiliary files.
install-data::
	$(SHELL) $(top_srcdir)/../mkdirchain $(texpooldir) $(mfpooldir) $(mppoldir) $(web2cdir) $(fontnamedir)
	$(INSTALL_DATA) tex.pool $(texpooldir)/tex.pool
	$(INSTALL_DATA) mf.pool $(mfpooldir)/mf.pool
	$(INSTALL_DATA) mp.pool $(mppooldir)/mp.pool
# tcx files are a bad idea
#	cd $(srcdir)/share && for f in *.tcx; do \
#	  $(INSTALL_DATA) $$f $(web2cdir)/$$f; done
	cd $(srcdir)/share && for f in *.map; do \
	  $(INSTALL_DATA) $$f $(fontnamedir)/$$f; done
	cd $(srcdir)/doc && $(MAKE) $(install_makeargs) install-data

# The distribution comes with up-to-date .info* files,
# so this should never be used unless something goes wrong
# with the unpacking, or you modify the manual.
doc/web2c.info:
	cd doc && $(MAKE) info
info dvi:
	cd doc && $(MAKE) $@

# 
# make dist won't work for anyone but me. Sorry.

##ifdef HOSTNAME
##distname = web2c
##program_files = PROJECTS *.ac *.ch tangleboot.p
##version_files = lib/version.c mpware/makempx.in mpware/mpto.c mpware/newer.c
##
##triptrapdiffs: triptrap/trip.diffs triptrap/mftrap.diffs triptrap/mptrap.diffs
##triptrap/trip.diffs: tex
##	$(MAKE) trip | tail +1 >triptrap/trip.diffs
##triptrap/mftrap.diffs: mf
##	$(MAKE) trap | tail +1 >triptrap/mftrap.diffs
##triptrap/mptrap.diffs: mpost
##	$(MAKE) mptrap | tail +1 >triptrap/mptrap.diffs
##
##tests/check.log: $(programs)
##	$(MAKE) check | tail +1 >tests/check.log
##
##dist_subdirs = doc lib mpware share tests web2c window
##pre-dist-$(distname): triptrapdiffs tests/check.log tangleboot.p
##	cd web2c && $(MAKE) lex.yy.c y.tab.c
##	cd doc && $(MAKE) doc dvi
##	for d in lib mpware web2c window; do \
##	  (cd $$d && $(MAKE) depend.make); done
##
##post-dist-$(distname): 
### Make the subdirectories.
##	for d in $(dist_subdirs); do \
##	  mkdir -p $(top_distdir)/$(distname)/$$d; done
### Link files in subdirectories.
##	for f in `find $(dist_subdirs)		\
##		       \(    -name README	\
##			  -o -name convert	\
##			  -o -name ChangeLog	\
##			  -o -name coerce.\*	\
##			  -o -name ref.aux	\
##			  -o -name ref.bbl	\
##			  -o -name ref.tex	\
##			  -o -name ref.txi	\
##			  -o -name texinfo.bst	\
##			  -o -name web2c.cps	\
##			  -o -name web2c.aux	\
##			  -o -name \*.asm	\
##			  -o -name '*.[chly]'	\
##			  -o -name \*.defines	\
##			  -o -name \*.in	\
##			  -o -name \*.info\*	\
##			  -o -name \*.sed	\
##			  -o -name \*.tcx	\
##			  -o -name \*.texi	\
##		       \) -print`; do		\
##	  ln $$f $(distdir)/`dirname $$f`; done
### Ungnuify the Makefile's in the subdirectories.
##	for d in doc lib mpware web2c window; do \
##          cp -p $$d/depend.make $(top_distdir)/$(distname)/$$d; \
##	  ungnumake $(top_distdir)/$(distname)/$$d/Makefile.in; \
##	  rm -f $(top_distdir)/$(distname)/$$d/depend.make; done
### Other subdirectories.
##	cd $(distdir); ln -s ../../triptrap .
##	cd $(distdir)/share; cp $(fontname)/*.map .
##	rm -f $(distdir)/window/x11.c
##	rm -f $(distdir)/tests/patgen.in
##	cd $(distdir)/tests && (rm just.texi; ln -s ../../../tests/* .; rm -f x*)
##	cd $(distdir)/tests && ln -s $klib/bibtex/bib/xampl.bib
##	cd $(distdir)/tests && rm -f missfont.log ptmr.mpx io.tex exampl.b??
### We supply the flex/bison output in case the user can't generate them.
##	cd $(distdir)/web2c; rename 's/$$/-dist/' lex.yy.c y.tab.[ch]
### Remove cruft.
##	cd $(distdir); rm -f $(addsuffix .c, $(programs) tangleboot)
##	cd $(distdir); rm -f $(addsuffix .h, $(programs) tangleboot)
##	cd $(distdir); bash -c "rm -f {tex,mf,mp}{coerce,d,0,1,2,extra,ini}.[ch]"
##	cd $(distdir); bash -c "rm -f tests/x* tests/allbib.{bbl,blg,dvi,log}"
##	touch $(distdir)/doc/*.info*
##
##web-dist:
##	rm -rf $(distdir)
##	mkdir -p $(distdir)
##	for f in *.web; do ln $$f $(distdir); done
##	GZIP=-9 tar czf web-$(version).tar.gz $(top_distdir)
##	rm -rf $(top_distdir)
##
##ac_include ../make/dist.make
##endif

ac_include ../make/config.make

# 
# Testing, including triptrap. The `x' filenames are for output.
check: bibtex-check dvicopy-check dvitomp-check dvitype-check \
       gftodvi-check gftopk-check gftype-check \
       mf-check mft-check mpost-check patgen-check pktogf-check \
       pktype-check pltotf-check pooltype-check tex-check tftopl-check \
       vftovp-check vptovf-check weave-check

triptrap: trip trap mptrap
testdir = $(srcdir)/triptrap
testenv = TEXMFCNF=$(testdir)
dvitype_args = -output-level=2 -dpi=72.27 -page-start='*.*.*.*.*.*.*.*.*.*'
trip: pltotf tftopl tex dvitype
	@echo ">>> See $(testdir)/trip.diffs for example of acceptable diffs." >&2
	./pltotf $(testdir)/trip.pl trip.tfm
	./tftopl ./trip.tfm trip.pl
	$(DIFF) $(DIFFFLAGS) $(testdir)/trip.pl trip.pl
	rm -f trip.tex; $(LN) $(testdir)/trip.tex . # get same filename in log
	-$(SHELL) -c '$(testenv) ./tex -ini <$(testdir)/trip1.in >tripin.fot'
	mv trip.log tripin.log
	-$(DIFF) $(DIFFFLAGS) $(testdir)/tripin.log tripin.log
# May as well test non-ini second time through.
	-$(SHELL) -c '$(testenv) ./tex <$(testdir)/trip2.in >trip.fot'
	-$(DIFF) $(DIFFFLAGS) $(testdir)/trip.fot trip.fot
# We use $(DIFF) instead of `diff' only for those files where there
# might actually be legitimate numerical differences.
	-$(DIFF) $(DIFFFLAGS) $(testdir)/trip.log trip.log
	$(SHELL) -c '$(testenv) ./dvitype $(dvitype_args) trip.dvi >trip.typ'
	-$(DIFF) $(DIFFFLAGS) $(testdir)/trip.typ trip.typ

# Can't run trap and mptrap in parallel, because both write trap.{log,tfm}.
trap: mf tftopl gftype
	@echo ">>> See $(testdir)/mftrap.diffs for example of acceptable diffs." >&2
	rm -f trap.mf; $(LN) $(testdir)/trap.mf . # get same filename in log
	-$(SHELL) -c '$(testenv) ./mf -ini <$(testdir)/mftrap1.in >mftrapin.fot'
	mv trap.log mftrapin.log
	-$(DIFF) $(DIFFFLAGS) $(testdir)/mftrapin.log mftrapin.log
	-$(SHELL) -c '$(testenv) ./mf <$(testdir)/mftrap2.in >mftrap.fot'
	mv trap.log mftrap.log
	mv trap.tfm mftrap.tfm
	-$(DIFF) $(DIFFFLAGS) $(testdir)/mftrap.fot mftrap.fot
	-$(DIFF) $(DIFFFLAGS) $(testdir)/mftrap.log mftrap.log
	./tftopl ./mftrap.tfm mftrap.pl
	$(DIFF) $(DIFFFLAGS) $(testdir)/mftrap.pl mftrap.pl
	$(SHELL) -c '$(testenv) ./gftype -m -i ./trap.72270gf >trap.typ'
	-$(DIFF) $(DIFFFLAGS) $(testdir)/trap.typ trap.typ

mptrap: pltotf mpost tftopl
	@echo ">>> See $(testdir)/mptrap.diffs for example of acceptable diffs." >&2
	rm -f mtrap.mp; $(LN) $(testdir)/mtrap.mp . # get same filename in log
	./pltotf $(testdir)/trapf.pl trapf.tfm
	-$(SHELL) -c '$(testenv) ./mpost -ini mtrap'
	-$(DIFF) $(DIFFFLAGS) $(testdir)/mtrap.log mtrap.log
	$(DIFF) $(DIFFFLAGS) $(testdir)/mtrap.0 mtrap.0
	$(DIFF) $(DIFFFLAGS) $(testdir)/mtrap.1 mtrap.1
	$(DIFF) $(DIFFFLAGS) $(testdir)/writeo writeo
	$(DIFF) $(DIFFFLAGS) $(testdir)/writeo.2 writeo.2
	rm -f trap.mp; $(LN) $(testdir)/trap.mp .
	rm -f trap.mpx; $(LN) $(testdir)/trap.mpx .
	-$(SHELL) -c '$(testenv) ./mpost -ini <$(testdir)/mptrap1.in >mptrapin.fot'
	mv trap.log mptrapin.log
	-$(DIFF) $(DIFFFLAGS) $(testdir)/mptrapin.log mptrapin.log
# Must run inimp or font_name[null_font] is not initialized, leading to diffs.
	-$(SHELL) -c '$(testenv) ./mpost -ini <$(testdir)/mptrap2.in >mptrap.fot'
	mv trap.log mptrap.log
	mv trap.tfm mptrap.tfm
	-$(DIFF) $(DIFFFLAGS) $(testdir)/mptrap.fot mptrap.fot
	-$(DIFF) $(DIFFFLAGS) $(testdir)/mptrap.log mptrap.log
	$(DIFF) $(DIFFFLAGS) $(testdir)/trap.5 trap.5
	$(DIFF) $(DIFFFLAGS) $(testdir)/trap.6 trap.6
	$(DIFF) $(DIFFFLAGS) $(testdir)/trap.148 trap.148
	$(DIFF) $(DIFFFLAGS) $(testdir)/trap.149 trap.149
	$(DIFF) $(DIFFFLAGS) $(testdir)/trap.150 trap.150
	$(DIFF) $(DIFFFLAGS) $(testdir)/trap.151 trap.151
	$(DIFF) $(DIFFFLAGS) $(testdir)/trap.197 trap.197
	$(DIFF) $(DIFFFLAGS) $(testdir)/trap.200 trap.200
	./tftopl ./mptrap.tfm mptrap.pl
	$(DIFF) $(DIFFFLAGS) $(testdir)/mptrap.pl mptrap.pl

# Ad hoc tests.
bibtex-check: bibtex
	cd tests && ../bibtex exampl

dvicopy-check: dvicopy
	./dvicopy $(srcdir)/tests/story tests/xstory.dvi
# Redirect stderr so the terminal output will end up in the log file.
	cd tests && (../dvicopy <pplr.dvi >xpplr.dvi) 2>&1

dvitomp-check: dvitomp
	./dvitomp $(srcdir)/tests/story.dvi tests/xstory.mpx
	cd tests && ../dvitomp ptmr && mv ptmr.mpx xptmr.mpx

dvitype-check: dvitype
	./dvitype -show-opcodes $(srcdir)/tests/story >tests/xstory.dvityp
	./dvitype --p=\*.\*.2 $(srcdir)/tests/pagenum.dvi >tests/xpagenum.typ

gftodvi-check: gftodvi
	cd tests && ../gftodvi -verbose ./cmr10.600gf; mv cmr10.dvi xcmr10.dvi

gftopk-check: gftopk
	./gftopk -verbose $(srcdir)/tests/cmr10.600gf tests/xcmr10.600pk
	./gftopk $(srcdir)/tests/cmr10.600gf && rm cmr10.600pk

gftype-check: gftype
	./gftype $(srcdir)/tests/cmr10.600gf >tests/xcmr10.gft1
	./gftype -m -i $(srcdir)/tests/cmr10.600gf >tests/xcmr10.gft2

mf-check: trap mf.base
	./mf '&./mf \tracingstats:=1; end.'
	./mf $(srcdir)/tests/online
	./mf $(srcdir)/tests/one.two
	./mf $(srcdir)/tests/uno.dos

mft-check: mft
	cd tests && ../mft $(srcdir)/../tests/io

mpost-check: mptrap mpost.mem
	./mpost '&./mpost \tracingstats:=1; end.'
	MPXCOMMAND=`pwd`/mpware/makempx ./mpost $(srcdir)/tests/mptest
	./mpost $(srcdir)/tests/one.two
	./mpost $(srcdir)/tests/uno.dos

patgen-check: patgen
	./patgen tests/dict tests/patterns tests/xout tests/translate <tests/patgen.in

pktogf-check: pktogf
	./pktogf -verbose $(srcdir)/tests/cmr10.600pk tests/xcmr10.600gf
	./pktogf $(srcdir)/tests/cmr10.600pk && rm cmr10.600gf

pktype-check: pktype
	./pktype $(srcdir)/tests/cmr10.600pk >tests/xcmr10.pktyp

pltotf-check: pltotf
	./pltotf -verbose $(srcdir)/tests/cmr10 tests/xcmr10

pooltype-check: pooltype
	./pooltype tex.pool >tests/xtexpool.typ

# No need for tangle-check, since we run it to make everything else.

tex-check: trip tex.fmt
# Test truncation (but don't bother showing the warning msg).
	./tex --output-comment="`cat PROJECTS`" tests/hello 2>/dev/null \
	  && ./dvitype hello.dvi | grep kb@mail.tug.org >/dev/null
# \openout should show up in \write's.
	./tex $(srcdir)/tests/openout && grep xfoo openout.log
# one.two.tex -> one.two.log
	./tex $(srcdir)/tests/one.two && ls -l one.two.log
# uno.dos -> uno.dos.log
	./tex $(srcdir)/tests/uno.dos && ls -l uno.dos.log
	./tex $(srcdir)/tests/just.texi && ls -l just.log
	-./tex $(srcdir)/tests/batch.tex
	./tex --shell $(srcdir)/tests/write18 | grep echo
# tcx files are a bad idea.
#	./tex --translate-file=$(srcdir)/share/isol1-t1.tcx tests/eight \
#	  && ./dvitype eight.dvi >eigh.typ
	./tex --mltex --ini $(srcdir)/tests/mltextst
	-./tex </dev/null
	-PATH=$(kpathsea_dir):$$PATH ./tex '\nonstopmode\font\foo=nonesuch\end'

tftopl-check: tftopl
	./tftopl -verbose $(srcdir)/tests/cmr10 tests/xcmr10

vftovp-check: vftovp
	TFMFONTS=$(srcdir)/tests ./vftovp -verbose $(srcdir)/tests/ptmr ptmr tests/xptmr

vptovf-check: vptovf
	./vptovf $(srcdir)/tests/ptmr $(srcdir)/tests/xptmr tests/xptmr

weave-check: weave
	./weave $(srcdir)/pooltype

installcheck:
	cd $(srcdir)/tests && bibtex allbib
	mf '\mode:=ljfour; input logo10' && tftopl logo10.tfm >/dev/null
	tex '\nonstopmode \tracingstats=1 \input story \bye'

# 
# Cleaning.
all_subdirs = doc lib mpware web2c window

# Having a multiple-target rule with the subdir loop fails because of
# the dependencies introduced by clean.make.  Yet, we want the
# dependencies here at the top level so that distclean will run the
# clean rules, etc.  So, sigh, put the subdir loop in each target and
# only run it if we have a Makefile.  Alternatively, we could do as
# Automake does.

mostlyclean::
	test ! -r lib/Makefile \
	  || for d in $(all_subdirs); do (cd $$d && $(MAKE) $@); done
	rm -f tangleboot
clean::
	test ! -r lib/Makefile \
	  || for d in $(all_subdirs); do (cd $$d && $(MAKE) $@); done
	mv triptrapdiff.pl triptrapdiff.pl.save
	rm -f *.aux *.c *.dvi *.fot *.log *.pl *.tfm *.typ 
	mv triptrapdiff.pl.save triptrapdiff.pl
	rm -f *.base *.fmt *.mem
# Have to list generated .h's explicitly since our real headers,
# e.g., help.h, are in this directory too.
	rm -f bibtex.h dvicopy.h dvitomp.h dvitype.h gftodvi.h gftopk.h
	rm -f gftype.h *coerce.h *d.h mft.h patgen.h pktogf.h pktype.h
	rm -f pltotf.h pooltype.h tangle.h tftopl.h vftovp.h vptovf.h weave.h
# Cleanup from triptrap.
	rm -f trip.tex trap.mf mtrap.mp trap.mp trap.mpx
	rm -f trip.* tripin.* tripos.tex 8terminal.tex
	rm -f trap.* mftrap.* mftrapin.* mptrap.* mptrapin.*
	rm -f trapf.* mtrap.* writeo* missfont.log
distclean::
	test ! -r lib/Makefile \
	  || for d in $(all_subdirs); do (cd $$d && $(MAKE) $@); done
	rm -f *.pool *extra.c *.fm
# Have to list .p's explicitly because we can't remove tangleboot.p.
	rm -f bibtex.p dvicopy.p dvitomp.p dvitype.p gftodvi.p gftopk.p
	rm -f gftype.p mf.p mft.p mp.p patgen.p pktogf.p pktype.p pltotf.p
	rm -f pooltype.p tangle.p tex.p tftopl.p vftovp.p vptovf.p weave.p
	rm -f tangleboot.c tangleboot.h
extraclean::
	test ! -r lib/Makefile \
	  || for d in $(all_subdirs); do (cd $$d && $(MAKE) $@); done
# Remove triptrap junk here too.
	rm -f trip.tex trap.mf mtrap.mp trap.mp trap.mpx
	rm -f trip.* tripin.* tripos.tex 8terminal.tex
	rm -f trap.* mftrap.* mftrapin.* mptrap.* mptrapin.*
	rm -f trapf.* mtrap.* writeo* missfont.log
maintainer-clean::
	test ! -r lib/Makefile \
	  || for d in $(all_subdirs); do (cd $$d && $(MAKE) $@); done

ac_include ../make/clean.make


ac_include ../make/rdepend.make
bibtex.o: bibtex.c \
 cpascal.h config.h ../kpathsea/config.h c-auto.h ../kpathsea/c-std.h \
 ../kpathsea/c-unistd.h ../kpathsea/systypes.h \
 ../kpathsea/c-memstr.h \
 ../kpathsea/c-errno.h \
 ../kpathsea/c-minmax.h \
 ../kpathsea/c-limits.h \
 ../kpathsea/c-proto.h ../kpathsea/debug.h ../kpathsea/types.h \
 ../kpathsea/lib.h ../kpathsea/progname.h ../kpathsea/c-fopen.h \
 ../kpathsea/getopt.h ../kpathsea/proginit.h ../kpathsea/tex-file.h \
 help.h bibtex.h
dvicopy.o: dvicopy.c cpascal.h config.h ../kpathsea/config.h c-auto.h \
 ../kpathsea/c-std.h \
 ../kpathsea/c-unistd.h ../kpathsea/systypes.h \
 ../kpathsea/c-memstr.h \
 ../kpathsea/c-errno.h \
 ../kpathsea/c-minmax.h \
 ../kpathsea/c-limits.h \
 ../kpathsea/c-proto.h ../kpathsea/debug.h ../kpathsea/types.h \
 ../kpathsea/lib.h ../kpathsea/progname.h ../kpathsea/c-fopen.h \
 ../kpathsea/getopt.h ../kpathsea/proginit.h ../kpathsea/tex-file.h \
 help.h dvicopy.h
dvitomp.o: dvitomp.c cpascal.h config.h ../kpathsea/config.h c-auto.h \
 ../kpathsea/c-std.h \
 ../kpathsea/c-unistd.h ../kpathsea/systypes.h \
 ../kpathsea/c-memstr.h \
 ../kpathsea/c-errno.h \
 ../kpathsea/c-minmax.h \
 ../kpathsea/c-limits.h \
 ../kpathsea/c-proto.h ../kpathsea/debug.h ../kpathsea/types.h \
 ../kpathsea/lib.h ../kpathsea/progname.h ../kpathsea/c-fopen.h \
 ../kpathsea/getopt.h ../kpathsea/proginit.h ../kpathsea/tex-file.h \
 help.h dvitomp.h
dvitype.o: dvitype.c cpascal.h config.h ../kpathsea/config.h c-auto.h \
 ../kpathsea/c-std.h \
 ../kpathsea/c-unistd.h ../kpathsea/systypes.h \
 ../kpathsea/c-memstr.h \
 ../kpathsea/c-errno.h \
 ../kpathsea/c-minmax.h \
 ../kpathsea/c-limits.h \
 ../kpathsea/c-proto.h ../kpathsea/debug.h ../kpathsea/types.h \
 ../kpathsea/lib.h ../kpathsea/progname.h ../kpathsea/c-fopen.h \
 ../kpathsea/getopt.h ../kpathsea/proginit.h ../kpathsea/tex-file.h \
 help.h dvitype.h
gftodvi.o: gftodvi.c cpascal.h config.h ../kpathsea/config.h c-auto.h \
 ../kpathsea/c-std.h \
 ../kpathsea/c-unistd.h ../kpathsea/systypes.h \
 ../kpathsea/c-memstr.h \
 ../kpathsea/c-errno.h \
 ../kpathsea/c-minmax.h \
 ../kpathsea/c-limits.h \
 ../kpathsea/c-proto.h ../kpathsea/debug.h ../kpathsea/types.h \
 ../kpathsea/lib.h ../kpathsea/progname.h ../kpathsea/c-fopen.h \
 ../kpathsea/getopt.h ../kpathsea/proginit.h ../kpathsea/tex-file.h \
 help.h gftodmem.h gftodvi.h
gftopk.o: gftopk.c cpascal.h config.h ../kpathsea/config.h c-auto.h \
 ../kpathsea/c-std.h \
 ../kpathsea/c-unistd.h ../kpathsea/systypes.h \
 ../kpathsea/c-memstr.h \
 ../kpathsea/c-errno.h \
 ../kpathsea/c-minmax.h \
 ../kpathsea/c-limits.h \
 ../kpathsea/c-proto.h ../kpathsea/debug.h ../kpathsea/types.h \
 ../kpathsea/lib.h ../kpathsea/progname.h ../kpathsea/c-fopen.h \
 ../kpathsea/getopt.h ../kpathsea/proginit.h ../kpathsea/tex-file.h \
 help.h gftopk.h
gftype.o: gftype.c cpascal.h config.h ../kpathsea/config.h c-auto.h \
 ../kpathsea/c-std.h \
 ../kpathsea/c-unistd.h ../kpathsea/systypes.h \
 ../kpathsea/c-memstr.h \
 ../kpathsea/c-errno.h \
 ../kpathsea/c-minmax.h \
 ../kpathsea/c-limits.h \
 ../kpathsea/c-proto.h ../kpathsea/debug.h ../kpathsea/types.h \
 ../kpathsea/lib.h ../kpathsea/progname.h ../kpathsea/c-fopen.h \
 ../kpathsea/getopt.h ../kpathsea/proginit.h ../kpathsea/tex-file.h \
 help.h gftype.h
mf0.o: mf0.c mfd.h texmfmp.h cpascal.h config.h ../kpathsea/config.h \
 c-auto.h ../kpathsea/c-std.h \
 ../kpathsea/c-unistd.h ../kpathsea/systypes.h \
 ../kpathsea/c-memstr.h \
 ../kpathsea/c-errno.h \
 ../kpathsea/c-minmax.h \
 ../kpathsea/c-limits.h \
 ../kpathsea/c-proto.h ../kpathsea/debug.h ../kpathsea/types.h \
 ../kpathsea/lib.h ../kpathsea/progname.h ../kpathsea/c-fopen.h \
 ../kpathsea/getopt.h ../kpathsea/proginit.h ../kpathsea/tex-file.h \
 help.h ../kpathsea/c-pathch.h ../kpathsea/c-ctype.h \
 ../kpathsea/tex-make.h texmfmem.h mfcoerce.h
mf1.o: mf1.c mfd.h texmfmp.h cpascal.h config.h ../kpathsea/config.h \
 c-auto.h ../kpathsea/c-std.h \
 ../kpathsea/c-unistd.h ../kpathsea/systypes.h \
 ../kpathsea/c-memstr.h \
 ../kpathsea/c-errno.h \
 ../kpathsea/c-minmax.h \
 ../kpathsea/c-limits.h \
 ../kpathsea/c-proto.h ../kpathsea/debug.h ../kpathsea/types.h \
 ../kpathsea/lib.h ../kpathsea/progname.h ../kpathsea/c-fopen.h \
 ../kpathsea/getopt.h ../kpathsea/proginit.h ../kpathsea/tex-file.h \
 help.h ../kpathsea/c-pathch.h ../kpathsea/c-ctype.h \
 ../kpathsea/tex-make.h texmfmem.h mfcoerce.h
mf2.o: mf2.c mfd.h texmfmp.h cpascal.h config.h ../kpathsea/config.h \
 c-auto.h ../kpathsea/c-std.h \
 ../kpathsea/c-unistd.h ../kpathsea/systypes.h \
 ../kpathsea/c-memstr.h \
 ../kpathsea/c-errno.h \
 ../kpathsea/c-minmax.h \
 ../kpathsea/c-limits.h \
 ../kpathsea/c-proto.h ../kpathsea/debug.h ../kpathsea/types.h \
 ../kpathsea/lib.h ../kpathsea/progname.h ../kpathsea/c-fopen.h \
 ../kpathsea/getopt.h ../kpathsea/proginit.h ../kpathsea/tex-file.h \
 help.h ../kpathsea/c-pathch.h ../kpathsea/c-ctype.h \
 ../kpathsea/tex-make.h texmfmem.h mfcoerce.h
mfextra.o: mfextra.c mfd.h texmfmp.h cpascal.h config.h \
 ../kpathsea/config.h c-auto.h ../kpathsea/c-std.h \
 ../kpathsea/c-unistd.h ../kpathsea/systypes.h \
 ../kpathsea/c-memstr.h \
 ../kpathsea/c-errno.h \
 ../kpathsea/c-minmax.h \
 ../kpathsea/c-limits.h \
 ../kpathsea/c-proto.h ../kpathsea/debug.h ../kpathsea/types.h \
 ../kpathsea/lib.h ../kpathsea/progname.h ../kpathsea/c-fopen.h \
 ../kpathsea/getopt.h ../kpathsea/proginit.h ../kpathsea/tex-file.h \
 help.h ../kpathsea/c-pathch.h ../kpathsea/c-ctype.h \
 ../kpathsea/tex-make.h texmfmem.h mfcoerce.h ../kpathsea/line.h \
 ../kpathsea/readable.h ../kpathsea/variable.h 
mfini.o: mfini.c mfd.h texmfmp.h cpascal.h config.h \
 ../kpathsea/config.h c-auto.h ../kpathsea/c-std.h \
 ../kpathsea/c-unistd.h ../kpathsea/systypes.h \
 ../kpathsea/c-memstr.h \
 ../kpathsea/c-errno.h \
 ../kpathsea/c-minmax.h \
 ../kpathsea/c-limits.h \
 ../kpathsea/c-proto.h ../kpathsea/debug.h ../kpathsea/types.h \
 ../kpathsea/lib.h ../kpathsea/progname.h ../kpathsea/c-fopen.h \
 ../kpathsea/getopt.h ../kpathsea/proginit.h ../kpathsea/tex-file.h \
 help.h ../kpathsea/c-pathch.h ../kpathsea/c-ctype.h \
 ../kpathsea/tex-make.h texmfmem.h mfcoerce.h
mft.o: mft.c cpascal.h config.h ../kpathsea/config.h c-auto.h \
 ../kpathsea/c-std.h \
 ../kpathsea/c-unistd.h ../kpathsea/systypes.h \
 ../kpathsea/c-memstr.h \
 ../kpathsea/c-errno.h \
 ../kpathsea/c-minmax.h \
 ../kpathsea/c-limits.h \
 ../kpathsea/c-proto.h ../kpathsea/debug.h ../kpathsea/types.h \
 ../kpathsea/lib.h ../kpathsea/progname.h ../kpathsea/c-fopen.h \
 ../kpathsea/getopt.h ../kpathsea/proginit.h ../kpathsea/tex-file.h \
 help.h mft.h
mp0.o: mp0.c mpd.h texmfmp.h cpascal.h config.h ../kpathsea/config.h \
 c-auto.h ../kpathsea/c-std.h \
 ../kpathsea/c-unistd.h ../kpathsea/systypes.h \
 ../kpathsea/c-memstr.h \
 ../kpathsea/c-errno.h \
 ../kpathsea/c-minmax.h \
 ../kpathsea/c-limits.h \
 ../kpathsea/c-proto.h ../kpathsea/debug.h ../kpathsea/types.h \
 ../kpathsea/lib.h ../kpathsea/progname.h ../kpathsea/c-fopen.h \
 ../kpathsea/getopt.h ../kpathsea/proginit.h ../kpathsea/tex-file.h \
 help.h ../kpathsea/c-pathch.h ../kpathsea/c-ctype.h \
 ../kpathsea/tex-make.h texmfmem.h mpcoerce.h
mp1.o: mp1.c mpd.h texmfmp.h cpascal.h config.h ../kpathsea/config.h \
 c-auto.h ../kpathsea/c-std.h \
 ../kpathsea/c-unistd.h ../kpathsea/systypes.h \
 ../kpathsea/c-memstr.h \
 ../kpathsea/c-errno.h \
 ../kpathsea/c-minmax.h \
 ../kpathsea/c-limits.h \
 ../kpathsea/c-proto.h ../kpathsea/debug.h ../kpathsea/types.h \
 ../kpathsea/lib.h ../kpathsea/progname.h ../kpathsea/c-fopen.h \
 ../kpathsea/getopt.h ../kpathsea/proginit.h ../kpathsea/tex-file.h \
 help.h ../kpathsea/c-pathch.h ../kpathsea/c-ctype.h \
 ../kpathsea/tex-make.h texmfmem.h mpcoerce.h
mp2.o: mp2.c mpd.h texmfmp.h cpascal.h config.h ../kpathsea/config.h \
 c-auto.h ../kpathsea/c-std.h \
 ../kpathsea/c-unistd.h ../kpathsea/systypes.h \
 ../kpathsea/c-memstr.h \
 ../kpathsea/c-errno.h \
 ../kpathsea/c-minmax.h \
 ../kpathsea/c-limits.h \
 ../kpathsea/c-proto.h ../kpathsea/debug.h ../kpathsea/types.h \
 ../kpathsea/lib.h ../kpathsea/progname.h ../kpathsea/c-fopen.h \
 ../kpathsea/getopt.h ../kpathsea/proginit.h ../kpathsea/tex-file.h \
 help.h ../kpathsea/c-pathch.h ../kpathsea/c-ctype.h \
 ../kpathsea/tex-make.h texmfmem.h mpcoerce.h
mpextra.o: mpextra.c mpd.h texmfmp.h cpascal.h config.h \
 ../kpathsea/config.h c-auto.h ../kpathsea/c-std.h \
 ../kpathsea/c-unistd.h ../kpathsea/systypes.h \
 ../kpathsea/c-memstr.h \
 ../kpathsea/c-errno.h \
 ../kpathsea/c-minmax.h \
 ../kpathsea/c-limits.h \
 ../kpathsea/c-proto.h ../kpathsea/debug.h ../kpathsea/types.h \
 ../kpathsea/lib.h ../kpathsea/progname.h ../kpathsea/c-fopen.h \
 ../kpathsea/getopt.h ../kpathsea/proginit.h ../kpathsea/tex-file.h \
 help.h ../kpathsea/c-pathch.h ../kpathsea/c-ctype.h \
 ../kpathsea/tex-make.h texmfmem.h mpcoerce.h ../kpathsea/line.h \
 ../kpathsea/readable.h ../kpathsea/variable.h \
 ../kpathsea/concatn.h ../kpathsea/c-vararg.h
mpini.o: mpini.c mpd.h texmfmp.h cpascal.h config.h \
 ../kpathsea/config.h c-auto.h ../kpathsea/c-std.h \
 ../kpathsea/c-unistd.h ../kpathsea/systypes.h \
 ../kpathsea/c-memstr.h \
 ../kpathsea/c-errno.h \
 ../kpathsea/c-minmax.h \
 ../kpathsea/c-limits.h \
 ../kpathsea/c-proto.h ../kpathsea/debug.h ../kpathsea/types.h \
 ../kpathsea/lib.h ../kpathsea/progname.h ../kpathsea/c-fopen.h \
 ../kpathsea/getopt.h ../kpathsea/proginit.h ../kpathsea/tex-file.h \
 help.h ../kpathsea/c-pathch.h ../kpathsea/c-ctype.h \
 ../kpathsea/tex-make.h texmfmem.h mpcoerce.h
patgen.o: patgen.c cpascal.h config.h ../kpathsea/config.h c-auto.h \
 ../kpathsea/c-std.h \
 ../kpathsea/c-unistd.h ../kpathsea/systypes.h \
 ../kpathsea/c-memstr.h \
 ../kpathsea/c-errno.h \
 ../kpathsea/c-minmax.h \
 ../kpathsea/c-limits.h \
 ../kpathsea/c-proto.h ../kpathsea/debug.h ../kpathsea/types.h \
 ../kpathsea/lib.h ../kpathsea/progname.h ../kpathsea/c-fopen.h \
 ../kpathsea/getopt.h ../kpathsea/proginit.h ../kpathsea/tex-file.h \
 help.h patgen.h
pktogf.o: pktogf.c cpascal.h config.h ../kpathsea/config.h c-auto.h \
 ../kpathsea/c-std.h \
 ../kpathsea/c-unistd.h ../kpathsea/systypes.h \
 ../kpathsea/c-memstr.h \
 ../kpathsea/c-errno.h \
 ../kpathsea/c-minmax.h \
 ../kpathsea/c-limits.h \
 ../kpathsea/c-proto.h ../kpathsea/debug.h ../kpathsea/types.h \
 ../kpathsea/lib.h ../kpathsea/progname.h ../kpathsea/c-fopen.h \
 ../kpathsea/getopt.h ../kpathsea/proginit.h ../kpathsea/tex-file.h \
 help.h pktogf.h
pktype.o: pktype.c cpascal.h config.h ../kpathsea/config.h c-auto.h \
 ../kpathsea/c-std.h \
 ../kpathsea/c-unistd.h ../kpathsea/systypes.h \
 ../kpathsea/c-memstr.h \
 ../kpathsea/c-errno.h \
 ../kpathsea/c-minmax.h \
 ../kpathsea/c-limits.h \
 ../kpathsea/c-proto.h ../kpathsea/debug.h ../kpathsea/types.h \
 ../kpathsea/lib.h ../kpathsea/progname.h ../kpathsea/c-fopen.h \
 ../kpathsea/getopt.h ../kpathsea/proginit.h ../kpathsea/tex-file.h \
 help.h pktype.h
pltotf.o: pltotf.c cpascal.h config.h ../kpathsea/config.h c-auto.h \
 ../kpathsea/c-std.h \
 ../kpathsea/c-unistd.h ../kpathsea/systypes.h \
 ../kpathsea/c-memstr.h \
 ../kpathsea/c-errno.h \
 ../kpathsea/c-minmax.h \
 ../kpathsea/c-limits.h \
 ../kpathsea/c-proto.h ../kpathsea/debug.h ../kpathsea/types.h \
 ../kpathsea/lib.h ../kpathsea/progname.h ../kpathsea/c-fopen.h \
 ../kpathsea/getopt.h ../kpathsea/proginit.h ../kpathsea/tex-file.h \
 help.h pltotf.h
pooltype.o: pooltype.c cpascal.h config.h ../kpathsea/config.h \
 c-auto.h ../kpathsea/c-std.h \
 ../kpathsea/c-unistd.h ../kpathsea/systypes.h \
 ../kpathsea/c-memstr.h \
 ../kpathsea/c-errno.h \
 ../kpathsea/c-minmax.h \
 ../kpathsea/c-limits.h \
 ../kpathsea/c-proto.h ../kpathsea/debug.h ../kpathsea/types.h \
 ../kpathsea/lib.h ../kpathsea/progname.h ../kpathsea/c-fopen.h \
 ../kpathsea/getopt.h ../kpathsea/proginit.h ../kpathsea/tex-file.h \
 help.h pooltype.h
tangle.o: tangle.c cpascal.h config.h ../kpathsea/config.h c-auto.h \
 ../kpathsea/c-std.h \
 ../kpathsea/c-unistd.h ../kpathsea/systypes.h \
 ../kpathsea/c-memstr.h \
 ../kpathsea/c-errno.h \
 ../kpathsea/c-minmax.h \
 ../kpathsea/c-limits.h \
 ../kpathsea/c-proto.h ../kpathsea/debug.h ../kpathsea/types.h \
 ../kpathsea/lib.h ../kpathsea/progname.h ../kpathsea/c-fopen.h \
 ../kpathsea/getopt.h ../kpathsea/proginit.h ../kpathsea/tex-file.h \
 help.h tangle.h
tangleboot.o: tangleboot.c cpascal.h config.h ../kpathsea/config.h \
 c-auto.h ../kpathsea/c-std.h \
 ../kpathsea/c-unistd.h ../kpathsea/systypes.h \
 ../kpathsea/c-memstr.h \
 ../kpathsea/c-errno.h \
 ../kpathsea/c-minmax.h \
 ../kpathsea/c-limits.h \
 ../kpathsea/c-proto.h ../kpathsea/debug.h ../kpathsea/types.h \
 ../kpathsea/lib.h ../kpathsea/progname.h ../kpathsea/c-fopen.h \
 ../kpathsea/getopt.h ../kpathsea/proginit.h ../kpathsea/tex-file.h \
 help.h tangleboot.h
tex0.o: tex0.c texd.h texmfmp.h cpascal.h config.h \
 ../kpathsea/config.h c-auto.h ../kpathsea/c-std.h \
 ../kpathsea/c-unistd.h ../kpathsea/systypes.h \
 ../kpathsea/c-memstr.h \
 ../kpathsea/c-errno.h \
 ../kpathsea/c-minmax.h \
 ../kpathsea/c-limits.h \
 ../kpathsea/c-proto.h ../kpathsea/debug.h ../kpathsea/types.h \
 ../kpathsea/lib.h ../kpathsea/progname.h ../kpathsea/c-fopen.h \
 ../kpathsea/getopt.h ../kpathsea/proginit.h ../kpathsea/tex-file.h \
 help.h ../kpathsea/c-pathch.h ../kpathsea/c-ctype.h \
 ../kpathsea/tex-make.h texmfmem.h texcoerce.h
tex1.o: tex1.c texd.h texmfmp.h cpascal.h config.h \
 ../kpathsea/config.h c-auto.h ../kpathsea/c-std.h \
 ../kpathsea/c-unistd.h ../kpathsea/systypes.h \
 ../kpathsea/c-memstr.h \
 ../kpathsea/c-errno.h \
 ../kpathsea/c-minmax.h \
 ../kpathsea/c-limits.h \
 ../kpathsea/c-proto.h ../kpathsea/debug.h ../kpathsea/types.h \
 ../kpathsea/lib.h ../kpathsea/progname.h ../kpathsea/c-fopen.h \
 ../kpathsea/getopt.h ../kpathsea/proginit.h ../kpathsea/tex-file.h \
 help.h ../kpathsea/c-pathch.h ../kpathsea/c-ctype.h \
 ../kpathsea/tex-make.h texmfmem.h texcoerce.h
tex2.o: tex2.c texd.h texmfmp.h cpascal.h config.h \
 ../kpathsea/config.h c-auto.h ../kpathsea/c-std.h \
 ../kpathsea/c-unistd.h ../kpathsea/systypes.h \
 ../kpathsea/c-memstr.h \
 ../kpathsea/c-errno.h \
 ../kpathsea/c-minmax.h \
 ../kpathsea/c-limits.h \
 ../kpathsea/c-proto.h ../kpathsea/debug.h ../kpathsea/types.h \
 ../kpathsea/lib.h ../kpathsea/progname.h ../kpathsea/c-fopen.h \
 ../kpathsea/getopt.h ../kpathsea/proginit.h ../kpathsea/tex-file.h \
 help.h ../kpathsea/c-pathch.h ../kpathsea/c-ctype.h \
 ../kpathsea/tex-make.h texmfmem.h texcoerce.h
texextra.o: texextra.c texd.h texmfmp.h cpascal.h config.h \
 ../kpathsea/config.h c-auto.h ../kpathsea/c-std.h \
 ../kpathsea/c-unistd.h ../kpathsea/systypes.h \
 ../kpathsea/c-memstr.h \
 ../kpathsea/c-errno.h \
 ../kpathsea/c-minmax.h \
 ../kpathsea/c-limits.h \
 ../kpathsea/c-proto.h ../kpathsea/debug.h ../kpathsea/types.h \
 ../kpathsea/lib.h ../kpathsea/progname.h ../kpathsea/c-fopen.h \
 ../kpathsea/getopt.h ../kpathsea/proginit.h ../kpathsea/tex-file.h \
 help.h ../kpathsea/c-pathch.h ../kpathsea/c-ctype.h \
 ../kpathsea/tex-make.h texmfmem.h texcoerce.h ../kpathsea/line.h \
 ../kpathsea/readable.h ../kpathsea/variable.h 
texini.o: texini.c texd.h texmfmp.h cpascal.h config.h \
 ../kpathsea/config.h c-auto.h ../kpathsea/c-std.h \
 ../kpathsea/c-unistd.h ../kpathsea/systypes.h \
 ../kpathsea/c-memstr.h \
 ../kpathsea/c-errno.h \
 ../kpathsea/c-minmax.h \
 ../kpathsea/c-limits.h \
 ../kpathsea/c-proto.h ../kpathsea/debug.h ../kpathsea/types.h \
 ../kpathsea/lib.h ../kpathsea/progname.h ../kpathsea/c-fopen.h \
 ../kpathsea/getopt.h ../kpathsea/proginit.h ../kpathsea/tex-file.h \
 help.h ../kpathsea/c-pathch.h ../kpathsea/c-ctype.h \
 ../kpathsea/tex-make.h texmfmem.h texcoerce.h
tftopl.o: tftopl.c cpascal.h config.h ../kpathsea/config.h c-auto.h \
 ../kpathsea/c-std.h \
 ../kpathsea/c-unistd.h ../kpathsea/systypes.h \
 ../kpathsea/c-memstr.h \
 ../kpathsea/c-errno.h \
 ../kpathsea/c-minmax.h \
 ../kpathsea/c-limits.h \
 ../kpathsea/c-proto.h ../kpathsea/debug.h ../kpathsea/types.h \
 ../kpathsea/lib.h ../kpathsea/progname.h ../kpathsea/c-fopen.h \
 ../kpathsea/getopt.h ../kpathsea/proginit.h ../kpathsea/tex-file.h \
 help.h tftopl.h
vftovp.o: vftovp.c cpascal.h config.h ../kpathsea/config.h c-auto.h \
 ../kpathsea/c-std.h \
 ../kpathsea/c-unistd.h ../kpathsea/systypes.h \
 ../kpathsea/c-memstr.h \
 ../kpathsea/c-errno.h \
 ../kpathsea/c-minmax.h \
 ../kpathsea/c-limits.h \
 ../kpathsea/c-proto.h ../kpathsea/debug.h ../kpathsea/types.h \
 ../kpathsea/lib.h ../kpathsea/progname.h ../kpathsea/c-fopen.h \
 ../kpathsea/getopt.h ../kpathsea/proginit.h ../kpathsea/tex-file.h \
 help.h vftovp.h
vptovf.o: vptovf.c cpascal.h config.h ../kpathsea/config.h c-auto.h \
 ../kpathsea/c-std.h \
 ../kpathsea/c-unistd.h ../kpathsea/systypes.h \
 ../kpathsea/c-memstr.h \
 ../kpathsea/c-errno.h \
 ../kpathsea/c-minmax.h \
 ../kpathsea/c-limits.h \
 ../kpathsea/c-proto.h ../kpathsea/debug.h ../kpathsea/types.h \
 ../kpathsea/lib.h ../kpathsea/progname.h ../kpathsea/c-fopen.h \
 ../kpathsea/getopt.h ../kpathsea/proginit.h ../kpathsea/tex-file.h \
 help.h vptovf.h
weave.o: weave.c cpascal.h config.h ../kpathsea/config.h c-auto.h \
 ../kpathsea/c-std.h \
 ../kpathsea/c-unistd.h ../kpathsea/systypes.h \
 ../kpathsea/c-memstr.h \
 ../kpathsea/c-errno.h \
 ../kpathsea/c-minmax.h \
 ../kpathsea/c-limits.h \
 ../kpathsea/c-proto.h ../kpathsea/debug.h ../kpathsea/types.h \
 ../kpathsea/lib.h ../kpathsea/progname.h ../kpathsea/c-fopen.h \
 ../kpathsea/getopt.h ../kpathsea/proginit.h ../kpathsea/tex-file.h \
 help.h weave.h

# 
# Local variables:
# page-delimiter: "^# \f"
# End:
