.PHONY: clean install scat macro pic18 doc planet-test planet-local planet-clean planet-package staapl

all: planet-link

staapl: planet-version.txt
	make -C staapl

install:
	sh bin/install

clean: planet-clean
	rm -rf .*~ *~ */*~ compiled */compiled *.plt *.tar.gz *version.txt staapl/prj/version.ss
	make -C doc clean
	make -C staapl clean

doc: all
	make -C doc

snapshot:
	sh bin/release -d

release:
	@echo releasing.. really?
	@sleep 5
	scp `sh bin/release`.tar.gz giebrok:www/zwizwa.be/archive/
	@echo "REMEMBER: 1. tag the archive and 2. bump the version in bin/release."
test: planet-link
	make -C test

# planet

planet-version.txt: bin/version
	mzscheme -f bin/version

planet-clean: planet-version.txt
	planet remove zwizwa staapl.plt `cat planet-version.txt` || planet unlink zwizwa staapl.plt `cat planet-version.txt`

planet-link: planet-version.txt staapl
	make planet-clean
	planet link zwizwa staapl.plt `cat planet-version.txt` `pwd`/staapl

planet-package: planet-version.txt
	planet create staapl 

planet-local: planet-package planet-version.txt
	make planet-clean
	planet fileinject zwizwa staapl.plt `cat planet-version.txt`

planet-test: 
	make staapl
	make planet-local
	mzscheme -p zwizwa/staapl/staapl
	@echo Now, figure out how to upload to planet automatically.
