# Generated automatically from Makefile.in by configure.
#
# Makefile for ptex -- ken-na@ascii.co.jp, Public domain.
version = 2012

default : programs #formats

programs=uptftopl.exe uppltotf.exe updvitype.exe upbibtex.exe \
ptftopl.exe ppltotf.exe pdvitype.exe pbibtex.exe
formats=

# paths.mk -- installation directories.
#
# The compile-time paths are defined in kpathsea/paths.h, which is built
# from kpathsea/texmf.in and these definitions.  See kpathsea/INSTALL
# for how the various path-related files are used and created.

# Do not change prefix and exec_prefix in Makefile.in!
# configure doesn't propagate the change to the other Makefiles.
# Instead, give the -prefix/-exec-prefix options to configure.
# (See kpathsea/INSTALL for more details.) This is arguably
# a bug, but it's not likely to change soon.
prefix = c:/usr/local
exec_prefix = ${prefix}

# Architecture-dependent executables.
bindir = ${exec_prefix}/bin/

# Architecture-independent executables.
scriptdir = $(bindir)

# Architecture-dependent files, such as lib*.a files.
libdir = ${exec_prefix}/lib

# Architecture-independent files.
datadir = ${prefix}/share

# Header files.
includedir = ${prefix}/include

# GNU .info* files.
infodir = ${prefix}/info

# Unix man pages.
manext = 1
mandir = ${prefix}/man/man$(manext)

# TeX system-specific directories. Not all of the following are relevant
# for all programs, but it seems cleaner to collect everything in one place.

# The default paths are now in kpathsea/texmf.in. Passing all the
# paths to sub-makes can make the arg list too long on system V.
# Note that if you make changes below, you will have to make the
# corresponding changes to texmf.in or texmf.cnf yourself.

# The root of the main tree.
texmf = c:/usr/local/share/texmf

# The directory used by varfonts.
vartexfonts = c:/var/tex/fonts

# Regular input files.
texinputdir = $(texmf)/tex
mfinputdir = $(texmf)/metafont
mpinputdir = $(texmf)/metapost
mftinputdir = $(texmf)/mft

# dvips's epsf.tex, rotate.tex, etc. get installed here;
# ditto for dvilj's fonts support.
dvips_plain_macrodir = $(texinputdir)/plain/dvips
dvilj_latex2e_macrodir = $(texinputdir)/latex/dvilj

# mktex.cnf, texmf.cnf, etc.
web2cdir = $(texmf)/web2c

# The top-level font directory.
fontdir = $(texmf)/fonts

# Memory dumps (.fmt/.base/.mem).
fmtdir = $(web2cdir)
basedir = $(fmtdir)
memdir = $(fmtdir)

# Pool files.
texpooldir = $(web2cdir)
mfpooldir = $(texpooldir)
mppooldir = $(texpooldir)

# Where the .map files from fontname are installed.
fontnamedir = $(texmf)/fontname

# For dvips configuration files, psfonts.map, etc.
dvipsdir = $(texmf)/dvips

# For dvips .pro files, gsftopk's render.ps, etc.
psheaderdir = $(dvipsdir)

# If a font can't be found close enough to its stated size, we look for
# each of these sizes in the order given.  This colon-separated list is
# overridden by the envvar TEXSIZES, and by a program-specific variable
# (e.g., XDVISIZES), and perhaps by a config file (e.g., in dvips).
# This list must be sorted in ascending order.
default_texsizes = 300:600

# End of paths.mk.

# Used for triptrap.
DIFF = diff
DIFFFLAGS =

.SUFFIXES: # get rid of .p.obj
# common.mk -- used by all Makefiles.
SHELL = sh
MAKE=make
top_srcdir = .
srcdir = .

WD = setargv.obj
#
#
XDEFS = -DWIN32=1 -DPTEX=1
CC = cl
#
# for Debug
#CFLAGS = -nologo -Od -Zi -MD -DDBW32=1 $(XCFLAGS)
#DBSTR = /DEBUG:FULL
#
# for release
CFLAGS = -nologo -O2 -MD -W3 -favor:blend $(XCFLAGS)
DBSTR =

CPPFLAGS =  $(XCPPFLAGS)

YDEFS = -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_SECURE_NO_DEPRECATE \
-D_CRT_OBSOLETE_NO_DEPRECATE -D_SECURE_SCL=0 \
-D_CRT_SECURE_NO_WARNINGS=1 -wd4267

DEFS = -DHAVE_CONFIG_H $(XDEFS) $(YDEFS)

# Kpathsea needs this for compiling, programs need it for linking.
LIBTOOL = $(kpathsea_srcdir_parent)/klibtool

# You can change [X]CPPFLAGS, [X]CFLAGS, or [X]DEFS, but
# please don't change ALL_CPPFLAGS or ALL_CFLAGS.
# prog_cflags is set by subdirectories of web2c.
ALL_CPPFLAGS = $(DEFS) -I. -I$(srcdir) -I../synctexdir \
  -I$(kpathsea_parent) -I$(kpathsea_srcdir_parent) \
  $(prog_cflags) $(CPPFLAGS) -I../../ptexenc -I$(ZLIBDIR)
ALL_CFLAGS = $(ALL_CPPFLAGS) $(CFLAGS) -c
compile = $(CC) $(ALL_CFLAGS)

.SUFFIXES:
.SUFFIXES: .c .obj # in case the suffix list has been cleared, e.g., by web2c
.c.obj:
	$(compile) $<

# Installation.
INSTALL = cp
INSTALL_PROGRAM = ${INSTALL}
INSTALL_SCRIPT = $(INSTALL_PROGRAM)
INSTALL_DATA = ${INSTALL}
INSTALL_LIBTOOL_LIBS =
INSTALL_LIBTOOL_PROG =

# Creating (symbolic) links.
LN = ln

# We use these for many things.
kpathsea_parent = ..
kpathsea_dir = $(kpathsea_parent)/kpathsea
kpathsea_srcdir_parent = $(top_srcdir)/..
kpathsea_srcdir = $(kpathsea_srcdir_parent)/kpathsea
kpathsea = $(kpathsea_dir)/kpathsealibw64.lib

#M#ifeq ($(CC), gcc)
#M#XDEFS = -Wpointer-arith $(warn_more)
#M#CFLAGS = -pipe -g $(XCFLAGS)
#M#endif
# End of common.mk.
# programs.mk -- used by Makefiles for executables only.

# Don't include $(CFLAGS), since ld -g under Linux forces
# static libraries, e.g., libc.a and libX*.a.
XLDFLAGS = -link /SUBSYSTEM:CONSOLE /OPT:NOREF /STACK:0x300000
LDFLAGS =  $(XLDFLAGS)

# proglib is for web2c; 
# XLOADLIBES is for the installer.
SYSLIBS = user32.lib advapi32.lib wsock32.lib shell32.lib
LIBS = ../../ptexenc/libptexenc.lib
LOADLIBES = $(proglib) $(kpathsea) $(LIBS) $(SYSLIBS) $(XLOADLIBES)

# May as well separate linking from compiling, just in case.
CCLD = $(CC)
link_command = $(CCLD) -Fe$@

# When we link with Kpathsea, have to take account that it might be a
# shared library, etc.
kpathsea_link = $(link_command)
# End of programs.mk.
#M#ifeq ($(CC), gcc)
#M#XDEFS = -Wimplicit -Wreturn-type -Wcomment -Wformat -D__USE_FIXED_PROTOTYPES__
#M#endif

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

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

proglib = ../lib/ptexlib.lib

# The sh script that does the conversion:
web2c = srcdir=$(thisdir) $(shared_env) $(SHELL) $(thisdir)/w2cconvert
# Additional dependencies:
web2c_aux = $(thisdir)/w2cconvert $(cwebdir)/common.defines \
	$(thisdir)/uptex.defines
web2c_programs = $(cwebdir)/fixwrites.exe $(cwebdir)/splitup.exe \
                 $(cwebdir)/web2c.exe
web2c_texmf = $(web2c_aux) $(web2c_programs)

# 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 ptex, also generates .pool
	$(shared_env) ../tangle $(thisdir)/$*.web $<

synctex-uptex-o = synctex-up.obj

ptex_c = uptexini.c uptex0.c
ptex_o = uptexini.obj uptex0.obj uptexextra.obj \
         $(synctex-uptex-o) uptex-pool.obj
dllptex_o = uptexini.obj uptex0.obj uptexextra.obj \
         $(synctex-uptex-o) uptex-pool.obj
plib_o = kanji.obj
kdmp_o = kanji_dump.obj

ZLIBDIR = ../../../libs/zlib
LDZLIB = $(ZLIBDIR)/libz.lib
#
# synctex
#
synctex_dir = ../synctexdir
synctex_common_texd = \
		echo "Enabling SyncTeX Support."

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

#  
# Rules for pTeX, Uptftopl, Uppltotf.
# fix dir
thisdir = .
srcdir = ..
top_srcdir= ../..
cwebdir = ../web2c

kpathsea_parent = $(top_srcdir)
kpathsea_srcdir_parent = $(kpathsea_parent)

programs: $(programs)

### pTeX
uptex.dll: $(dllptex_o) $(plib_o) $(kdmp_o) $(kpathsea) $(proglib)
	cl -LD -Fe$@ $(dllptex_o) $(plib_o) $(kdmp_o) \
           $(socketlibs) $(LDZLIB) $(LOADLIBES) $(LDFLAGS)

$(ptex_o): $(ptex_c) uptexcoerce.h uptexd.h kanji.h 

$(ptex_c) uptexcoerce.h uptexd.h: uptex.p $(web2c_texmf)
	$(web2c) uptex
	$(uptexdh-with_synctex)

MAKECPOOL = ../../../texk/web2c/web2c/makecpool.exe

uptex-pool.c: uptex.pool uptexd.h $(MAKECPOOL)
	$(MAKECPOOL) uptex >uptex-pool.c

uptex.p: uptex.web uptex.ch

uptex-web-srcs = \
 ../tex.web \
 ../tex.ch \
 ../tracingstacklevels.ch \
 ../partoken.ch \
 ../locnull-optimize.ch \
 ../zlib-fmt.ch

uptex_ch_synctex = \
../synctexdir/synctex-def.ch0 \
../synctexdir/synctex-p-mem.ch0 \
../synctexdir/synctex-mem.ch0 \
../synctexdir/synctex-p-mem.ch1 \
../synctexdir/synctex-p-rec.ch0 \
../synctexdir/synctex-rec.ch0 \
../synctexdir/synctex-rec.ch1 \
../synctexdir/synctex-rec.ch2 \
../synctexdir/synctex-p-rec.ch1

uptex-ch-srcs = uptex.web \
 ptex-base.ch \
 ../unbalanced-braces.ch \
 uptex-m.ch \
 $(uptex_ch_synctex) \
 ../tex-binpool.ch

synctex.h: $(synctex_dir)/synctex.h
	cp $(synctex_dir)/synctex.h $@
synctex-uptex.h: $(synctex_dir)/synctex-uptex.h
	cp $(synctex_dir)/synctex-uptex.h $@
$(synctex-uptex-o): synctex-up.c
	$(compile) -DSYNCTEX_ENGINE_H='<synctex-uptex.h>' $<

synctex-up.c: uptexd.h $(synctex_dir)/synctex.c synctex.h synctex-uptex.h
	cp $(synctex_dir)/synctex.c $@

uptexdh-with_synctex = if test -z "`grep __SyncTeX__ uptexd.h`";\
	then\
		$(synctex_common_texd);\
		sed -f ./synctex_sed_command.sed uptexd.h > synctex_texd.h;\
		mv synctex_texd.h uptexd.h;\
		if test -z "`grep __SyncTeX__ uptexd.h`";\
		then\
			echo "warning: SyncTeX activation FAILED";\
			exit 1;\
		fi;\
		echo "SyncTeX is enabled";\
	fi

uptex.web: $(uptex-web-srcs) ../tie.exe
	../tie -m $@ $(uptex-web-srcs)

uptex.ch: $(uptex-ch-srcs) ../tie.exe
	../tie -c $@ $(uptex-ch-srcs)

###
### Uptftopl
uptftopl.exe: uptftopl.obj $(plib_o) $(kpathsea) $(proglib)
	$(kpathsea_link) uptftopl.obj \
           $(plib_o) $(WD) $(LOADLIBES) $(LDFLAGS) $(DBSTR)
uptftopl.obj: uptftopl.c kanji.h
uptftopl.c: uptftopl.p $(web2c_aux)
uptftopl.p: uptftopl.web uptftopl.ch
uptftopl.web: ../tftopl.web ../tftopl.ch
	rm -f uptftopl.web && ../tie -m uptftopl.web ../tftopl.web ../tftopl.ch

ptftopl.exe: uptftopl.exe
	cp $< $@
### Uppltotf
uppltotf.exe: uppltotf.obj $(plib_o) $(kpathsea) $(proglib)
	$(kpathsea_link) uppltotf.obj \
           $(plib_o) $(WD) $(LOADLIBES) $(LDFLAGS) $(DBSTR)
uppltotf.obj: uppltotf.c kanji.h
	$(compile) -DPRESERVE_PUTC -c uppltotf.c
uppltotf.c: uppltotf.p $(web2c_aux)
uppltotf.p: uppltotf.web uppltotf.ch
uppltotf.web: ../pltotf.web ../pltotf.ch
	rm -f uppltotf.web && ../tie -m uppltotf.web ../pltotf.web ../pltotf.ch

ppltotf.exe: uppltotf.exe
	cp $< $@
### updvitype
updvitype.exe: updvitype.obj $(plib_o) $(kpathsea) $(proglib)
	$(kpathsea_link) updvitype.obj $(plib_o) $(WD) $(LOADLIBES) \
           $(LDFLAGS) $(DBSTR)
updvitype.obj: updvitype.c kanji.h 
	$(compile) -DDVITYPE -DHEX_CHAR_CODE updvitype.c
updvitype.c: updvitype.p $(web2c_aux)
updvitype.p: updvitype.web updvitype.ch
updvitype.web: ../dvitype.web ../dvitype.ch
	../tie -m $@ ../dvitype.web ../dvitype.ch

pdvitype.exe: updvitype.exe
	cp $< $@
### upbibtex
upbibtex.exe: upbibtex.obj $(plib_o) $(kpathsea) $(proglib)
	$(kpathsea_link) upbibtex.obj $(plib_o) $(WD) $(LOADLIBES) $(LDFLAGS) $(DBSTR)

upbibtex.obj: upbibtex.c upbibtex.h kanji.h
	$(compile) upbibtex.c
upbibtex.c upbibtex.h: upbibtex.p $(web2c_aux)
#
# upbibtex
#
upbibchsrc=upbibtex.ch
upbibtex.p: upbibtex.web $(upbibchsrc)
	../tangle upbibtex.web $(upbibchsrc)

upbibtex.web: ../bibtex.web ../bibtex.ch
	../tie -m $@ ../bibtex.web ../bibtex.ch

pbibtex.exe: upbibtex.exe
	cp $< $@
# Additional dependencies for recompiling the C code are generated
# automatically, included at the end.
kanji.obj: kanji.c kanji.h
kanji_dump.obj: kanji_dump.c kanji.h

uptexini.obj: uptexini.c uptexcoerce.h uptexd.h kanji.h ../texmfmp.h
uptex0.obj: uptex0.c uptexcoerce.h uptexd.h kanji.h ../texmfmp.h
uptexextra.obj: uptexextra.c ../lib/texmfmp.c uptexextra.h \
uptex_version.h uptexcoerce.h uptexd.h kanji.h ../texmfmp.h

# Additional dependencies for relinking.
../tangleboot.exe:
	cd .. && $(MAKE) tangleboot.exe
../tangle.exe:
	cd .. && $(MAKE) tangle.exe
$(cwebdir)/fixwrites.exe:
	cd $(cwebdir) && $(MAKE) fixwrites.exe
$(cwebdir)/splitup.exe:
	cd $(cwebdir) && $(MAKE) splitup.exe
$(cwebdir)/web2c.exe:
	cd $(cwebdir) && $(MAKE) web2c.exe
$(proglib):
	cd ../lib && $(MAKE) lib.lib
$(kpathsea):
	cd $(kpathsea_dir) && $(MAKE) kpathsealibw64.lib

# 
# Making formats and bases.
formats: $(formats)
all_fmts=$(formats)

texmf.cnf: ../../kpathsea/texmf.cnf
	cp ../../kpathsea/texmf.cnf texmf.cnf
	$(SHELL) $(thisdir)/mkconf $(thisdir)

dumpenv = TEXMFCNF=$(thisdir) TEXMF=$(texmf) 

ptex.fmt: ptex.exe
	$(dumpenv) $(MAKE) $(makeargs) files="ptex.tex min10.tfm" prereq-check
	$(dumpenv) ./ptex -ini \\input ptex \\dump </dev/null

platex.fmt: ptex.exe
	$(dumpenv) $(MAKE) $(makeargs) files=platex.ltx prereq-check
	$(dumpenv) ./ptex -ini \\input platex.ltx </dev/null

# This is meant to be called recursively, with $(files) set.
prereq-check: $(kpathsea_dir)/kpsewhich
	$(dumpenv) $(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)

# 
BINS=updvitype.exe upbibtex.exe uppltotf.exe uptftopl.exe
BINSP=pdvitype.exe pbibtex.exe ppltotf.exe ptftopl.exe

ZZ=c:/usr/local/txdir/w32tex/bin64/
install: $(BINS)
	cp -p $(BINS) c:/usr/work/edrive/wk/w64dist/UPTEX/bin64/
	cp -p $(BINS) $(ZZ)
	cp -p $(BINSP) c:/usr/work/edrive/wk/w64dist/PTEX/bin64/
	cp -p $(BINSP) $(ZZ)

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

# The actual binary executables and pool files.
install-programs: $(programs)
	$(SHELL) $(top_srcdir)/mkinstalldirs $(bindir) $(texpooldir)
	for p in $(programs); do $(INSTALL_LIBTOOL_PROG) $(bindir) $$p; done

# The links to ptex for each format and for {ini,vir}ptex.
install-links: install-programs
	cd $(bindir) && rm -f iniptex virptex; \
	$(LN) ptex iniptex; \
	$(LN) ptex virptex

# Always do plain.*, so examples from the TeXbook (etc.) will work.
install-formats: install-fmts
install-fmts: $(all_fmts)
	$(SHELL) $(top_srcdir)/mkinstalldirs $(fmtdir)
	for f in $(all_fmts); do $(INSTALL_DATA) $$f $(fmtdir)/$$f; done

# Auxiliary files.
install-data::
	$(SHELL) $(top_srcdir)/mkinstalldirs \
		$(texpooldir) $(web2cdir) $(fontnamedir)
	$(INSTALL_DATA) ptex.pool $(texpooldir)/ptex.pool
	$(INSTALL_DATA) texmf.cnf $(web2cdir)/texmf.cnf
# tcx files are a bad idea
#	cd $(srcdir)/share && for f in *.tcx; do \
#	  $(INSTALL_DATA) $$f $(web2cdir)/$$f; done
# map files are not provided with pTeX
#	cd $(srcdir)/share && for f in *.map; do \
#	  $(INSTALL_DATA) $$f $(fontnamedir)/$$f; done
#	cd $(srcdir)/doc && $(MAKE) $(install_makeargs) install-data

# 
# Testing, including triptrap. The `x' filenames are for output.
check: uppltotf-check uptftopl-check pooltype-check ptex-check 

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

# Ad hoc tests.
uppltotf-check: uppltotf
	./uppltotf -verbose $(testdir)/cmr10 $(testdir)/xcmr10
	./uppltotf -verbose $(testdir)/min10 $(testdir)/xmin10

uptftopl-check: uptftopl
	./uptftopl -verbose $(testdir)/cmr10 $(testdir)/xcmr10
	./uptftopl -verbose $(testdir)/min10 $(testdir)/xmin10

pooltype-check: ../pooltype
	../pooltype ptex.pool > $(testdir)/xtexpool.typ

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

installcheck:
	cd $(testdir) && ptex '\nonstopmode \tracingstats=1 \input story \bye'

# 
# Cleaning.
mostryclean::
	rm -f *.obj *~

clean:: mostryclean
	rm -f texcoerce.h texd.h upbibtex.h
	rm -f $(ptex_c) $(ptex_o) $(plib_o) $(programs)
	rm -f uptftopl.h uptftopl.c uptftopl.obj
	rm -f uppltotf.h uppltotf.c uppltotf.obj
	rm -f updvitype.h updvitype.c updvitype.obj
	rm -f upbibtex.c upbibtex.obj
distclean:: clean
	rm -fr failure
	rm -f ptex.web ptex.ch ptex.p ptex.pool
	rm -f uptftopl.web uptftopl.ch uptftopl.p
	rm -f uppltotf.web uppltotf.ch uppltotf.p
	rm -f updvitype.web updvitype.p
	rm -f upbibtex.web upbibtex.p
	rm -f Makefile kanji.h
extraclean:: distclean
	rm -f ptex.fmt platex.fmt
	rm -f *.aux *.bak *.bbl *.blg *.dvi *.log *.pl *.tfm *.vf *.vpl
	rm -f *.*pk *.*gf *.mpx *.i *.s *~ *.orig *.rej *\#*
	rm -f CONTENTS.tex a.out core mfput.* texput.* mpout.*
	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
