#
#   SimChip2 - Makefile
#

VERSION = 1.1
TITLE := SimChip
RELEASE := $(TITLE)-$(VERSION)

all:
	echo "Targets: backup release app exe version"

backup:
	(cd ..; $(MAKE) backup)

release: version
	(cd ..; \
	rm -f $(RELEASE); \
	ln -s Source $(RELEASE); \
	rm -f $(RELEASE).zip; \
	zip -r $(RELEASE).zip $(RELEASE) \
		-x '*/build/*' -x '*/dist/*' -x '*/Saves/*' -x '*.terminal' \
		-x '*/run' -x '*.DS_Store' -x '*.pyc' -x '*.bat' -x '*.intaglio'; \
	)

app: prebuild
	rm -rf build/bdist-macosx-* dist/SimChip.app
	python Game/Code/setup_app.py py2app

exe: prebuild
	rm -rf build/bdist.win32 dist/win32
	/c/python25/python Game/Code/setup_exe.py py2exe

prebuild: version

version:
	echo "version = '$(VERSION)'" > Game/Code/version.py
