
# Definitions #

HOME = /u3/usystem
# SHELL variable needed only on sysV to ensure usage of sh by make
SHELL = /bin/sh
TeXLIB = /usr/lib/tex/macros

# Directives #

all : uSystem.home uSystem.dvi

clean :
	rm -f *.aux *.dvi *.idx *.ilg *.ind *.log *.toc *.blg

# File Dependencies #

# sysV echo requires escaping backslash, so this kluge works on BSD and sysV
uSystem.home : Makefile
	echo "@newcommand{@uHome}{${HOME}}" | sed -e 's/@newcommand/\\newcommand/' -e 's/@uHome/\\uHome/' > uSystem.home

uSystem.dvi : Makefile uSystem.home Coroutine.tex PV.tex MessagePassing.tex File.tex SocketClient.tex SocketServer.tex \
		uSystem.idx uSystem.bbl uSystem.tex
	TEXINPUTS=.:${HOME}/TeX:${TeXLIB} && export TEXINPUTS && latex uSystem.tex
	makeindex uSystem.idx
	TEXINPUTS=.:${HOME}/TeX:${TeXLIB} && export TEXINPUTS && latex uSystem.tex

uSystem.bbl :
	TEXINPUTS=.:${HOME}/TeX:${TeXLIB} && export TEXINPUTS && latex uSystem.tex
	bibtex uSystem

uSystem.idx :
	cp /dev/null uSystem.ind
	TEXINPUTS=.:${HOME}/TeX:${TeXLIB} && export TEXINPUTS && latex uSystem.tex

Coroutine.tex : ../../../examples/Coroutine/ProdCons2.c
	tgrind -i -n $? > $@

PV.tex : ../../../examples/PV/ProdCons.c
	tgrind -i -n $? > $@

MessagePassing.tex : ../../../examples/MessagePassing/ProdCons.c
	tgrind -i -n $? > $@

File.tex : ../../../examples/IO/File.c
	tgrind -i -n $? > $@

SocketClient.tex : ../../../examples/IO/SocketClient.c
	tgrind -i -n $? > $@

SocketServer.tex : ../../../examples/IO/SocketServer.c
	tgrind -i -n $? > $@

# Local Variables: #
# compile-command: "make -k" #
# End: #
