# This Makefile creates .tgz and .zip versions
# of the coroutine benchmark directory Cortn 

PUB = /homes/mr/public_html

# Public HTML directory if not mountable on this machine
# and the shared drive is called E: (/dose on Linux).
# Remember to call ssh-add before calling make sshpub.
SSHPUB = sandy.cl.cam.ac.uk:public_html

help:
	@echo
	@echo "make all      Construct the files: cobench.tgz and cobench.zip"
	@echo "make dosd     Put them in my D drive"
	@echo "make dose     Put them in my E drive"
	@echo "make pub      Put them also in my home page"
	@echo "make sshpubd  Put them in /dosd and my home page using scp"
	@echo "make sshpube  Put them in /dose and my home page using scp"
	@echo

all:	
	rm -f *~ */*~
	echo >TGZDATE
	echo -n "Distributed from machine: " >>TGZDATE
	hostname >>TGZDATE
	date >>TGZDATE
	rm -f FILES
	cp -p doc/README .
	(cd ..; tar cvzf cobench.tgz Cobench)
	(cd ..; rm -f cobench.zip)
	(cd ..;  zip -rv9 cobench.zip Cobench)
	cp TGZDATE FILES
	ls -l ../cobench.tgz ../cobench.zip>>FILES

pub:	dosd
	cp README FILES ../cobench.tgz ../cobench.zip $(PUB)/Cobench
	cat FILES

sshpubd:	dosd
	scp README FILES ../cobench.tgz ../cobench.zip $(SSHPUB)/Cobench
	cat FILES

sshpube:	dose
	scp README FILES ../cobench.tgz ../cobench.zip $(SSHPUB)/Cobench
	cat FILES

dosd:	all
	cp ../cobench.tgz ../cobench.zip /dosd

dose:	all
	cp ../cobench.tgz ../cobench.zip /dose

