PROJECT   := icedb
EXPORTDIR := /tmp/$(PROJECT)-export
VERSION   := 0.1

all: manual.html

manual.html: manual.txt
	pandoc -s -S --tab-stop=2 --toc -c main.css -o manual.html manual.txt

publish: manual.html
	rm -rf $(EXPORTDIR)/
	mkdir -p $(EXPORTDIR)/
	svn export ../ $(EXPORTDIR)/$(PROJECT)
	tar czf $(EXPORTDIR)/$(PROJECT)-$(VERSION).tgz -C $(EXPORTDIR)/ $(PROJECT)/
	rm -r $(EXPORTDIR)/$(PROJECT)/
	cp manual.html $(EXPORTDIR)/index.html
	cp main.css $(EXPORTDIR)/
	scp $(EXPORTDIR)/* cartel.csail.mit.edu:/data/cartel/cartel_web/www/$(PROJECT)/

clean:
	rm -f manual.html

.PHONY: clean publish
