VERSION=3.3

# CONFIGURATION AREA. If you want to use this Makefile to do automated
# configuration, you must edit this area to fit your system. If you are
# installing by hand, this is unnecessary. The following paths are given as
# examples only. They are correct on my machine, running the Web2C
# distribution. 
#
# The parameters MFDIR, TFMDIR, TEXINPUTS, MANDIR, BINDIR and TEXHASH MUST be
# defined. MFDIR is the path to the Metafont sources and TFMDIR is the path to
# the .tfm files. See INSTALL in the section SEARCH PATHS for more details.
# TEXINPUTS is the path to the TeX Input directory.  MANDIR is the manual
# directory, usually /usr/man/man1, and BINDIR is usually /usr/local/bin.
# TEXHASH is MakeTeXls-R for WEB2C Unix distribution, texhash for TETEX, blank
# for NTEX.

MFDIR=/usr/share/texmf/fonts/source/public/GOOE
TFMDIR=/usr/share/texmf/fonts/tfm/public/GOOE
TEXINPUTS=/usr/share/texmf/tex/GOOE
MANDIR=/usr/man/man1/
BINDIR=/usr/local/bin/
TEXHASH=texhash

# PKFONTS may be left undefined for the initial installation. If you are
# reinstalling fonts for which you have made modifications to the metafont
# sources, it is important to delete all .*pk files which have been cached on
# the system by MakeTeXPK. Thus you must determine where these files are and
# define PKFONTS as a list of paths to these files. Leave the following line
# commented out for initial installation. For subsequent installations, 
# you may use the UNIX command find to track down the cached files:
#
# $ find / -print 2>/dev/null|grep go|grep pk
#
# Example: on my machine, I would uncomment the following line for a
# reinstallation.
#
# PKFONTS=/usr/local/share/texmf/fonts/pk/cx/tmp/go*pk /usr/local/share/texmf/fonts/pk/ljfour/tmp/go*pk /usr/local/share/texmf/fonts/pk/cx/gnu/oldengli/go*pk /usr/local/share/texmf/fonts/pk/ljfour/gnu/oldengli/go*pk

# If you make certain types of modifications the .tfm files might change.
# If you are getting checksum errors, you should also delete any cached
# .tfm files. Most font modifications you are likely to make to the sgf2tex
# fonts are not likely to change the .tfm files.
#
# End of CONFIGURATION AREA. You probably do not need to edit below this line.

.SUFFIXES : .mf .tfm .300pk .360pk .432pk .600pk .720pk .864pk .300gf .360gf .432gf .600gf .720gf .864gf

sgfsplit: sgfsplit.c
	cc -g -o sgfsplit sgfsplit.c

manual.dvi: manual.tex
	tex manual

install: sgfsplit 
	rm -f $(PKFONTS)
	install -m 0644 *.mf $(MFDIR)
	install -m 0644 *.tfm $(TFMDIR)
	install -m 0755 sgf2tex sgfsplit $(BINDIR)
	install -m 0644 sgf2tex.1 sgfsplit.1 $(MANDIR)
	install -m 0644 gooemacs.tex gotcmacs.tex $(TEXINPUTS)
	$(TEXHASH)
	tex manual

# The preferred method of installation is just to copy the metafont
# sources and tfm files into appropriated directories in MakeTeXPK's
# search path. The required pk fonts will be then built automatically
# by the system. In an emergency, you can build the fonts by hand
# with `make fonts'. This might be appropriate if (for example) you 
# are working on a machine where you do not have superuser privileges, 
# or if you are working on a DOS port.

fonts: gooa.300gf gooa.360gf gooa.432gf gooa.600gf gooa.720gf gooa.864gf goea.300gf goea.360gf goea.432gf goea.600gf goea.720gf goea.864gf goob.300gf goob.360gf goob.432gf goob.600gf goob.720gf goob.864gf goeb.300gf goeb.360gf goeb.432gf goeb.600gf goeb.720gf goeb.864gf gooc.300gf gooc.360gf gooc.432gf gooc.600gf gooc.720gf gooc.864gf goec.300gf goec.360gf goec.432gf goec.600gf goec.720gf goec.864gf good.300gf good.360gf good.432gf good.600gf good.720gf good.864gf goed.300gf goed.360gf goed.432gf goed.600gf goed.720gf goed.864gf gooegb.300gf gooegb.360gf gooegb.432gf gooegb.600gf gooegb.720gf gooegb.864gf gooemt.300gf gooemt.360gf gooemt.432gf gooemt.600gf gooemt.720gf gooemt.864gf gooa.300pk gooa.360pk gooa.432pk gooa.600pk gooa.720pk gooa.864pk goea.300pk goea.360pk goea.432pk goea.600pk goea.720pk goea.864pk goob.300pk goob.360pk goob.432pk goob.600pk goob.720pk goob.864pk goeb.300pk goeb.360pk goeb.432pk goeb.600pk goeb.720pk goeb.864pk gooc.300pk gooc.360pk gooc.432pk gooc.600pk gooc.720pk gooc.864pk goec.300pk goec.360pk goec.432pk goec.600pk goec.720pk goec.864pk good.300pk good.360pk good.432pk good.600pk good.720pk good.864pk goed.300pk goed.360pk goed.432pk goed.600pk goed.720pk goed.864pk gooegb.300pk gooegb.360pk gooegb.432pk gooegb.600pk gooegb.720pk gooegb.864pk gooemt.300pk gooemt.360pk gooemt.432pk gooemt.600pk gooemt.720pk gooemt.864pk gobl.300gf gobl.360gf gobl.432gf gobl.600gf gobl.720gf gobl.864gf gowl.300gf gowl.360gf gowl.432gf gowl.600gf gowl.720gf gowl.864gf

.mf.300gf :
	mf "\\mode=cx; mag=1; input $*"

.mf.360gf :
	mf "\\mode=cx; mag=1.2; input $*"

.mf.432gf :
	mf "\\mode=cx; mag=1.44; input $*"

.mf.600gf :
	mf "\\mode=ljfour; mag=1; input $*"

.mf.720gf :
	mf "\\mode=ljfour; mag=1.2; input $*"

.mf.864gf :
	mf "\\mode=ljfour; mag=1.44; input $*"

.300gf.300pk :
	gftopk gooegb.300gf

.360gf.360pk :
	gftopk gooegb.360gf

.432gf.432pk :
	gftopk gooegb.432gf

.600gf.600pk :
	gftopk gooegb.600gf

.720gf.720pk :
	gftopk gooegb.720gf

.864gf.864pk :
	gftopk gooegb.864gf

.300pk.tfm :

clean : 
	rm -f *.dvi *pk *0gf *4gf *.log

tar : 
	rm -f sgf2tex-$(VERSION)/*
	cp bodd.mf wodd.mf paramsa.mf paramsb.mf paramsc.mf gooa.mf goea.mf goob.mf goeb.mf gooc.mf goec.mf good.mf goed.mf goxa.mf goxb.mf gooegb.mf gooemt.mf romandg.mf gobas.mf gobl.mf gowl.mf goxl.mf itallg.mf paramsbl.mf gooa.tfm goea.tfm goob.tfm goeb.tfm gooc.tfm goec.tfm good.tfm goed.tfm gooegb.tfm gooemt.tfm gowl.tfm gobl.tfm manual.tex gooemacs.tex gotcmacs.tex COPYING README INSTALL INSTALL.DOS UPGRADE Makefile sgf2tex sgfsplit.c genan-shuwa.sgf sgf2tex.1 sgfsplit.1 sgf2tex-$(VERSION)/
	tar czvf sgf2tex-$(VERSION).tar.gz sgf2tex-$(VERSION)/*
	mv sgf2tex-$(VERSION)/ SGF2TEX
	rm -f sgf2tex.zip
	zip sgf2tex.zip SGF2TEX/*
	mv SGF2TEX/ sgf2tex-$(VERSION)

untar :
	tar xzvf sgf2tex-$(VERSION).tar.gz
	cp sgf2tex-$(VERSION)/* .
