# The following file and directory specifications may need changing at
# your site:
#
# choose either PK or PXL format
PKorPXL=PK
# where are the bitmaps stored?
PXLAREA=/usr/staff/lib/tex/PK
#
# where are the tfm files stored?
FONTAREA=/usr/staff/lib/tex/fonts
#
# where is the header file to be found?
HDRFILE=/usr/staff/lib/tex/dvi.ps
#
# definitions for builtin Postscript fonts
FONTMAP=TeXPSfonts.map
PSHDRFILE=/usr/staff/lib/tex/BuiltIn.ps
#
# where is the software to be installed
BINAREA=/usr/staff/bin
# program name
PROGRAM=dvi2ps
#
# location of .sty files
TEXAREA=/usr/staff/lib/tex/macros
#
# an Apollo-specific spool file
SPOOLFILE=/usr/spool/laserwriter/apollo
#
# maximum amount of virtual memory in the printer in bytes. If not defined,
# an unlimited amount is assumed. Otherwise dvi2ps will try not to exceed
# this amount.
BUDGET=90000
# default paper size (choose a4, letter, legal, note)
PAPERSIZE=a4
# do you want Macintosh specific code in the header file (YES or NO)
MACINTOSH=NO
# do you want special code for Apple Laserwriter rounding problems
# (see dvi2ps.ps for details) (YES or NO)
ALWBUG=YES


CF = -O
CFLAGS = -DFONTAREA=\"$(FONTAREA)\" -DHDRFILE=\"$(HDRFILE)\" \
	 -DPSHDRFILE=\"$(PSHDRFILE)\" -DPAPERSIZE=\"@$(PAPERSIZE)\\n\" \
         -DSPOOLFILE=\"$(SPOOLFILE)\" $(BSD4.1) -DBUDGET=$(BUDGET) \
	 -DPXLAREA=\"$(PXLAREA)\" -DBUILTIN -DFONTMAP=\"$(FONTMAP)\" \
	 -D$(PKorPXL) $(CF)

all: $(PROGRAM) 

$(PROGRAM):	dvi2ps.o findfile.o pxlfile.o postscript.o
	cc $(CFLAGS) -o $(PROGRAM) dvi2ps.o findfile.o pxlfile.o postscript.o

dvi2ps.o: dvi2ps.c dvi2ps.h pxlfile.h postscript.h findfile.h commands.h

pxlfile.o: pxlfile.c dvi2ps.h pxlfile.h postscript.h

postscript.o: postscript.c dvi2ps.h pxlfile.h postscript.h commands.h

findfile.o: findfile.c findfile.h


install: all
	strip $(PROGRAM)
	cp $(PROGRAM) $(BINAREA)/$(PROGRAM)
	chmod 755  $(BINAREA)/$(PROGRAM)
	squeeze $(MACINTOSH) $(ALWBUG) dvi2ps.ps $(HDRFILE)
	squeeze $(MACINTOSH) $(ALWBUG) BuiltIn.ps $(PSHDRFILE)
	squeeze $(MACINTOSH) $(ALWBUG) SymbolEx.ps $(FONTAREA)/SymbolEx.ps
	squeeze $(MACINTOSH) $(ALWBUG) SmallCaps.ps $(FONTAREA)/SmallCaps.ps
	cp TeXPSfonts.map $(FONTAREA)/$(FONTMAP)
	cp *.tfm $(FONTAREA)
	cp *.sty $(TEXAREA)
	chmod 644 $(HDRFILE) $(PSHDRFILE) $(FONTAREA)/$(FONTMAP)
	chmod 644 $(FONTAREA)/*.ps $(FONTAREA)/*.tfm
	chmod 644 $(TEXAREA)/*.sty

#
# The following may be useful if you are trying to run this as a
# printcap filter
#

applef:	applef.c
	$(CC) -o applef $(CFLAGS) applef.c

dvipsf:	dvipsf.c
	$(CC) -o dvipsf $(CFLAGS) dvipsf.c
