#	$Source: /afs/sipb.mit.edu/project/sipbsrc/src/dvi2ps/RCS/Makefile,v $
#	$Header: /afs/sipb.mit.edu/project/sipbsrc/src/dvi2ps/RCS/Makefile,v 1.4 90/04/02 05:46:12 jik Exp $
# where is the software to be installed

DESTDIR=
BINDIR=		/usr/sipb/${MACHINE}bin
LIBDIR=		/usr/sipb/lib
MANDIR=		/usr/sipb/man
MANSECT=	1

# Local adaptions for BSD4.1
BSD4.1 =
# The following file and directory specifications may need changing at
# your site:
#
# where are the bitmaps stored?
PXLAREA=${LIBDIR}/tex/fonts
#
# where are the tfm files stored?
FONTAREA=${LIBDIR}/tex/fonts
#
# where is the header file to be found?
HDRFILE=${LIBDIR}/tex/ps/dvi.ps
#
#where are the tex->postscript font maps to be found?
#MUST BE RELATIVE to a FONT directory
FONTMAP=TeXPSfonts.map
#
# an Apollo-specific spool file
SPOOLFILE=/usr/spool/laserwriter/apollo
#
# the amount of virtual memory of the laserwriter
# Note: the Scout and the LPS40 have considerably more than this,
# so it's not defined in CFLAGS.
BUDGET=100000
#
# pxl or pk files?
PXL=PK

CF = -O
CFLAGS = -DFONTAREA=\"${FONTAREA}\" -DHDRFILE=\"${HDRFILE}\" \
         -DSPOOLFILE=\"${SPOOLFILE}\" ${BSD4.1} -D$(PXL) \
	 -DPXLAREA=\"${PXLAREA}\" -DBUILTIN -DFONTMAP=\"${FONTMAP}\" \
	${CF} -DNEEDVFPRINTF

all: dvi2ps tex.ps

dvi2ps:	dvi2ps.o findfile.o
	cc ${CFLAGS} -o dvi2ps dvi2ps.o findfile.o

dvi2ps.o: dvi2ps.c commands.h

findfile.o: findfile.c findfile.h

tex.ps:	tex.pro
	./squeeze

install: all
	install -c -s -m 755 dvi2ps ${DESTDIR}${BINDIR}/dvi2ps
	install -c dvi2ps.1 ${DESTDIR}${MANDIR}/man${MANSECT}/dvi2ps.${MANSECT}
	-mkdir ${DESTDIR}${LIBDIR}/tex
	-mkdir ${DESTDIR}${LIBDIR}/tex/ps
	cp tex.ps ${DESTDIR}${HDRFILE}
	cp LaserPrep.ps ${DESTDIR}${LIBDIR}/tex/ps/
	(cd tex; tar cf - .)|(cd ${DESTDIR}${LIBDIR}/tex; tar xpBfv -)

clean:
	rm -f findfile.o dvi2ps.o *~ core a.out dvi2ps tex.ps

#
# 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

depend:
	makedepend -v ${CFLAGS} *.c

# DO NOT DELETE THIS LINE -- make depend depends on it.

