# Makefile for mfpic - 03:17 GMT Thu 26 Nov 1992 - Geoffrey Tobin.
# For mfpic version  0.2  of Wed 9 Sep 92.
#
# Email to  ecsgrt@luxor.latrobe.edu.au  (Geoffrey Tobin)
#
# The targets are:  dvi, ps, clean, manifest, zip, unzip, cat, shar,
#                   sh and unshar.

SRCS =  Makefile README.UNIX \
  graphbase.mf lamfpic.tex lapictures.tex \
  mfpic.tex mfpicdoc.tex objects.tex pictures.tex setups.tex

SRC1 =  MANIFEST $(SRCS)

OUTPUT =  *.dvi  *log  *.aux  *.tfm  *.*gf  *.*pk  *.ps \
          pics.mf lapics.mf objs.mf

# DVI -> PostScript converter.
# This is my favorite, Tom Rokicki's dvips.
# Available at labrea.stanford.edu, in directory ./pub.
# Also at many other sites.  Ask archie.  Archie is a database that
# lists much archived software worldwide.

DVIPS=dvips -Z

# ZIP and UNZIP programs.
# These are the portable versions.  Widely available.  Ask archie.

ZIP=zip
UNZIP=unzip

default:  dvi  pk

# DVI files.
# Make DVI files by default, because they are useful for all output
# drivers.

dvi:  setups.dvi mfpicdoc.dvi pictures lapictures objects

# Instructions for Setting up for Installation.

setups.dvi:  setups.tex
	tex setups

# User Documentation.

mfpicdoc.dvi:  mfpicdoc.tex
	tex mfpicdoc

# TeX test of mfpic.

pictures:  pictures.tex mfpic.tex graphbase.mf
	tex pictures
	mf '\mode=localfont; mag=magstep(1); input ./pics'
	tex pictures

# LaTeX test of mfpic.

lapictures:  lapictures.tex lamfpic.tex mfpic.tex graphbase.mf
	latex lapictures
	mf '\mode=localfont; mag=magstep(0); input ./lapics'
	latex lapictures

# TeX test of a variety of mfpic objects.

objects:  objects.tex mfpic.tex graphbase.mf
	tex objects
	mf '\mode=localfont; mag=magstep(0); input ./objs'
	tex objects

# PK (packed) font format.
# Used by dvips and many other output drivers.

pk:   pics.360gf  lapics.300gf  objs.360gf
	gftopk pics.360gf
	gftopk lapics.300gf
	gftopk objs.360gf

# PostScript files.
# PostScript previewers and printers are common, though not universal.

ps:  setups.ps  mfpicdoc.ps  pictures.ps  lapictures.ps  objects.ps

setups.ps:  setups.dvi
	$(DVIPS) setups -o setups.ps

mfpicdoc.ps:  mfpicdoc.dvi
	$(DVIPS) mfpicdoc -o mfpicdoc.ps

pictures.ps:  pictures.dvi pics.360pk
	$(DVIPS) pictures -o pictures.ps

lapictures.ps:  lapictures.dvi pics.300pk
	$(DVIPS) lapictures -o lapictures.ps

objects.ps:  objects.dvi objs.360pk
	$(DVIPS) objects -o objects.ps

clean:
	rm $(OUTPUT)

# The rest of this Makefile is intended for making a distribution,
# and for unpacking it.

manifest:  $(SRCS)
	ls -l $(SRCS) > MANIFEST

# Zip file.
# Portable zip and unzip are free; Valeria in California is one site
# that has them.  See the comp.misc "archives" posting for sites.

zip:  $(SRC1)
	$(ZIP) mfpic.zip $(SRC1)

unzip:  mfpic.zip
	$(UNZIP) mfpic

# shar is available for both unix and DOS.

shar:  $(SRC1)
	shar $(SRC1) > mfpic.shar

# Unshar using Bourne shell, of which there are versions for DOS!

sh:  mfpic.shar
	sh mfpic.shar

# Or use "unshar", which is also available for DOS from Simtel-20.

unshar:  mfpic.shar
	unshar mfpic.shar
