#! /usr/bin/make -f

# $Id: Makefile,v 1.5 2002/12/17 11:45:19 patrick Exp $

FIGS = timechart_fifo.eps timechart_rr.eps timechart_other.eps switch.jpg processlife.eps

html: speech.mgp $(FIGS)
	mkdir -p html
	rm -rf html/*
	mgp -x vflib -D html speech.mgp

speech.ps: speech.mgp $(FIGS)
	mgp2ps -c -t $< > $@

clean:
	rm -f speech.ps speech.pdf core
	rm -f .gscache* *~ log
	rm -rf html
	rm -f *.eps
	rm -f scheduling.tar.gz

%.pdf: %.ps
	ps2pdf $^

%.eps: %.fig
	fig2dev -L eps -m 1.74 $< $@

.PHONY: all clean show test

tarball: clean
	tar czvf scheduling.tar.gz *

show: $(FIGS)
	mgp -q -t 30 -F 1,0,1 -x vflib speech.mgp

test: $(FIGS)
	mgp -q -t 30 -F 1,0,1 -o -x vflib speech.mgp

all: tarball html speech.pdf
