###
### Installer-related functions.  For the *.jtw to *.class converter,
### see install-stuff/Makefile.jtw
###

default: install

install:
	echo "Install does nothing.  Try ./configure instead"

etags:
	etags install-stuff/*.el

uninstall:
	emacs --batch --load install-stuff/jtw-install-and-uninstall.el --funcall do-uninstall

crimp:
	echo "(setq args \"$@\")"

clean:
	rm -fv TAGS

DATESTAMP = $$(date +"%Y%m%d-%H%M%S")
SHELL     = /bin/bash
VERSION   = 1.1.1

tar:
	rm -fr ~/java-training-wheels
	cd .. && cp -pru ~/dlisp/* gnu-java-training-wheels/dlisp
	cd ~/gnu-java-training-wheels/manual && make distclean
	cd ~/gnu-java-training-wheels/dlisp && rm -fr experimental old bugger
	cd .. && cp -pru gnu-java-training-wheels java-training-wheels-$(VERSION)
	cd .. && chmod 755 java-training-wheels-$(VERSION)/configure
	cd .. && chmod 755 java-training-wheels-$(VERSION)/install-stuff/copy-if-exists
	cd .. && tar -c --file=java-training-wheels-$(VERSION).tar java-training-wheels-$(VERSION)/*
	cd .. && gzip -fv java-training-wheels-$(VERSION).tar
ifdef IS_DAVINS_COMPUTER
	@cd .. && cp -puv java-training-wheels-$(VERSION).tar.gz ~/bak/java-training-wheels-$(VERSION)-$(DATESTAMP).tar.gz
	@cd .. && cp -puv java-training-wheels-$(VERSION).tar.gz ~/hairy-lemon/output/davinpearson-com/binaries/java-training-wheels-$(VERSION).tar.gz
	@cd .. && cp -puv java-training-wheels-$(VERSION).tar.gz ~/hairy-lemon/output/davinpearson-com/binaries/java-training-wheels-$(VERSION)-$(DATESTAMP).tar.gz
	-@cd .. && cp -puv java-training-wheels-$(VERSION).tar.gz /media/www/C1TB/home/bak/java-training-wheels-$(VERSION)-$(DATESTAMP).tar.gz
	-@cd .. && cp -puv java-training-wheels-$(VERSION).tar.gz /media/www/C1TB/davinpearson-com/binaries/java-training-wheels-$(VERSION).tar.gz
	-@cd .. && cp -puv java-training-wheels-$(VERSION).tar.gz /media/www/C1TB/davinpearson-com/binaries/java-training-wheels-$(VERSION)-$(DATESTAMP).tar.gz
	-@cd .. && cp -puv java-training-wheels-$(VERSION).tar.gz /media/www/WD2TB/home/bak/java-training-wheels-$(VERSION)-$(DATESTAMP).tar.gz
	-@cd .. && cp -puv java-training-wheels-$(VERSION).tar.gz /media/www/WD2TB/davinpearson-com/binaries/java-training-wheels-$(VERSION).tar.gz
	-@cd .. && cp -puv java-training-wheels-$(VERSION).tar.gz /media/www/WD2TB/davinpearson-com/binaries/java-training-wheels-$(VERSION)-$(DATESTAMP).tar.gz
	-@cd .. && cp -puv java-training-wheels-$(VERSION).tar.gz /media/www/WD2TB2/home/bak/java-training-wheels-$(VERSION)-$(DATESTAMP).tar.gz
	-@cd .. && cp -puv java-training-wheels-$(VERSION).tar.gz /media/www/WD2TB2/davinpearson-com/binaries/java-training-wheels-$(VERSION).tar.gz
	-@cd .. && cp -puv java-training-wheels-$(VERSION).tar.gz /media/www/WD2TB2/davinpearson-com/binaries/java-training-wheels-$(VERSION)-$(DATESTAMP).tar.gz
	cd .. && rm -fv java-training-wheels-$(VERSION).tar.gz
	cd .. && rm -fr java-training-wheels-$(VERSION)
endif

docs:
	cd manual && make html info m4
	tar cfv jtw-manual.tar manual/jtw-manual manual/jtw-manual.info manual/index.html
	gzip -fv jtw-manual.tar
ifdef IS_DAVINS_COMPUTER
	mv jtw-manual.tar.gz ~/hairy-lemon/output/davinpearson-com/binaries/jtw-manual-$(VERSION).tar.gz
	-@cp ~/hairy-lemon/output/davinpearson-com/binaries/jtw-manual-$(VERSION).tar.gz ~/bak/jtw-manual-$(VERSION)-$(DATESTAMP).tar.gz
	-@cp ~/hairy-lemon/output/davinpearson-com/binaries/jtw-manual-$(VERSION).tar.gz /media/www/C1TB/home/bak/jtw-manual-$(VERSION)-$(DATESTAMP).tar.gz
	-@cp ~/hairy-lemon/output/davinpearson-com/binaries/jtw-manual-$(VERSION).tar.gz /media/www/C1TB/davinpearson-com/binaries/jtw-manual-$(VERSION).tar.gz
	-@cp ~/hairy-lemon/output/davinpearson-com/binaries/jtw-manual-$(VERSION).tar.gz /media/www/WD2TB/davinpearson-com/binaries/jtw-manual-$(VERSION).tar.gz
	-@cp ~/hairy-lemon/output/davinpearson-com/binaries/jtw-manual-$(VERSION).tar.gz /media/www/WD2TB2/davinpearson-com/binaries/jtw-manual-$(VERSION).tar.gz
#	cd manual && make distclean
endif
