NAME=Chmox
TARGET=bin/chmox
SVN=https://chmox.svn.sourceforge.net/svnroot/chmox
DIR=chmox
FILE=chmox-latest.tar.gz
PREFIX=$(HOME)/usr/local


all:: $(TARGET)


clean:
	rm -rf $(DIR)
	# rm -rf .cache


$(TARGET): .cache/$(FILE) $(DEPENDS)
	@echo Does everything needed to build and install $(NAME)
	tar zxf .cache/$(FILE)
	cd $(DIR)/trunk ; xcodebuild
	cd $(DIR)/trunk ; xcodebuild install
	@echo Done!


.cache/$(FILE): $(PREFIX)/bin/svn
	svn co $(SVN) $(DIR)
	tar czf .cache/$(FILE) $(DIR)
	rm -rf $(DIR)

