# This makefile is used to create .tgz and .zip versions
# of the GP2X distribution.
# This makefile is used to create gp2x.tgz and gp2x.zip

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 = ramsey.cl.cam.ac.uk:public_html

help:
	@echo
	@echo "make all      Construct the files: gp2x.tgz and gp2x.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  gp2x/README .
	cp  gp2x/joyterm/jt_readme .
	(cd ..; tar cvzf gp2x.tgz GP2X)
	rm -f ../gp2x.zip
	(cd ..; zip -rv9 gp2x.zip GP2X)
	cp TGZDATE FILES
	ls -l ../gp2x.tgz ../gp2x.zip>>FILES

pub:	dosd
	cp  README FILES ../gp2x.tgz ../gp2x.zip $(PUB)/GP2X
	cat FILES

sshpubd:	dosd
	scp README FILES ../gp2x.tgz ../gp2x.zip $(SSHPUB)/GP2X
	cat FILES

sshpube:	dose
	scp README FILES ../gp2x.tgz ../gp2x.zip $(SSHPUB)/GP2X
	cat FILES

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

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


