# ==> Customize absolute path for perl
PERL = /usr/local/bin/perl

# ==> Customize TEXFONTS (where your TFM files can be found)
#				(NO recursion allowed)
TEXFONTS=/usr/local/tex-3.141/fonts/tfm

# ==> Customize AFMPATH (where your AFM files can be found)
#				(recursion allowed)
AFMPATH=/usr/local/tex-3.141/fonts/type1faces//

# ==> Customize FONTINSTDIR (where your fontinst sources are)
FONTINSTDIR=../fontinst

# ==> Customize ZMATHTIMEDIR (where your zmathtime sources are)
ZMATHTIMEDIR=../zmathtime

default: tools

lw35nfss: tools
	fontinst pag pcr pnc psy pzc pbk phv ppl ptm pzd
	addchecksums
	Install lw35nfss pag pcr pnc psy pzc pbk phv ppl ptm pzd

zmathtime: tools zmtt.req
	fontinst zmtt
	addchecksums
	Install zmtt zmtt

zmtt.req: mapfiles/zmtt.req
	cat mapfiles/zmtt.req | \
	    sed -e "s#@PERL@#$(PERL)#"\
                -e "s#@FONTINSTDIR@#$(FONTINSTDIR)#"\
                -e "s#@ZMATHTIMEDIR@#$(ZMATHTIMEDIR)#"\
        > zmtt.req
	chmod 755 zmtt.req

tools: cs fontinst addchecksums Install

cs: checksum/cs.c
	(cd checksum; make; mv cs ..)

Install: perl/Install Makefile
	cat perl/Install | \
	    sed -e "s#@PERL@#$(PERL)#"\
        > Install
	chmod 755 Install

fontinst: perl/fontinst Makefile
	cat perl/fontinst | \
	    sed -e "s#@PERL@#$(PERL)#"\
                -e "s#@AFMPATH@#$(AFMPATH)#"\
                -e "s#@FONTINSTDIR@#$(FONTINSTDIR)#"\
                -e "s#@ZMATHTIMEDIR@#$(ZMATHTIMEDIR)#"\
        > fontinst
	chmod 755 fontinst

addchecksums: perl/addchecksums Makefile
	cat perl/addchecksums | \
	    sed -e "s#@PERL@#$(PERL)#"\
                -e "s#@TEXFONTS@#$(TEXFONTS)#"\
                -e "s#@AFMPATH@#$(AFMPATH)#"\
        > addchecksums
	chmod 755 addchecksums

compareafm: perl/compareafm Makefile
	cat perl/compareafm | \
	    sed -e "s#@PERL@#$(PERL)#"\
                -e "s#@AFMPATH@#$(AFMPATH)#"\
        > compareafm
	chmod 755 compareafm

clean::
	-rm -f *.pl *.vpl *.afm *.mtx *.tfm *.vf *.fd *.log \
               *.tex *.dvi *.etx *.aux *.req *.sty

veryclean:: clean
	-rm -f addchecksums fontinst compareafm cs Install
	(cd checksum; make clean)
