# Makefile for Webify 			- Steve Ward, Ward@mit.edu
# See README in this directory for (slightly) more info.

# CHANGE the following to the name of your Ghostscript command.
# gs version 3.33 (current as of this writing) is known to work;
# others may.

VERSION = \"2.11 1/27/96\"
GS = gs333 		# Ghostscript command to use (3.51 works poorly!)
HACKPPM = ./hackppm	# use local copy, in case another is installed somewhere.

all:		webify hackppm webifydoc webify.help

tar:		webify.tar.Z

webify:		webify.o
		gcc -o webify webify.o

webify.o:	webify.c Makefile
		gcc -c -DVERSION="$(VERSION)" webify.c

hackppm:	hackppm.c Makefile
		gcc -o hackppm -DVERSION="$(VERSION)" hackppm.c

webifydoc:	Makefile webify hackppm webify.template webifydoc.ps
		./webify -H $(HACKPPM) -G $(GS) -r 1 -t "Webify" \
			webify.template webifydoc
		- cd webifydoc; ln -s ../Pix
		- cd webifydoc; ln -s ../notes.html
		- cd webifydoc; ln -s ../webify.template
		- cd webifydoc; ln -s ../webify.help

webify.help:	webify
		./webify >webify.help

webify.tar.Z:	Makefile webify.template webify.c hackppm.c \
		 webifydoc.ps notes.html webify.man Pix webify.help
		tar crf webify.tar $>
		compress webify.tar

clean:
	- rm -fr webifydoc
	- rm gs.out *.o *~

### This stuff is only for my debugging...

test:		webify test.ps
		./webify -G $(GS) -d -t "Test" test.template test

debug:		Makefile webify hackppm webify.template webifydoc.ps
		./webify -d -H $(HACKPPM) -G $(GS) -r 1 -t "Webify" \
			webify.template webifydoc
		- cd webifydoc; ln -s ../Pix
		- cd webifydoc; ln -s ../notes.html
		- cd webifydoc; ln -s ../webify.template
		- cd webifydoc; ln -s ../webify.help


# This is a version of our test case which uses the -F flag, thus
# avoiding UNIX fifos (at the cost of much scratch disk space).  Try it
# if "make webifydoc" seems not to generate slides properly, but gives
# thumbnails OK.

nofifo:		Makefile webify hackppm webify.template webifydoc.ps
		./webify -d -F -H $(HACKPPM) -G $(GS) -r 1 -t "Webify" \
			webify.template webifydoc
		- cd webifydoc; ln -s ../Pix
		- cd webifydoc; ln -s ../notes.html
		- cd webifydoc; ln -s ../webify.template
		- cd webifydoc; ln -s ../webify.help

hiq:		Makefile webify hackppm webify.template webifydoc.ps
		./webify -Q -d -F -H $(HACKPPM) -G $(GS) -r 1 -t "Webify" \
			webify.template webifydoc
		- cd webifydoc; ln -s ../Pix
		- cd webifydoc; ln -s ../notes.html
		- cd webifydoc; ln -s ../webify.template
		- cd webifydoc; ln -s ../webify.help

# This is a test version which doesn't rotate the presentation:
webifyrot:	webify hackppm webify.template webifyrot
		./webify -G $(GS) -t "WebifyRot" webify.template webifyrot
		- cd webifyrot; ln -s ../Pix
		- cd webifyrot; ln -s ../notes.html
		- cd webifyrot; ln -s ../webify.template
		- cd webifyrot; ln -s ../webify.help

