
VERSION=$(shell grep '^version:' city_planner/app.yaml | sed 's/.*version:[\s]*\([^\s]*\).*/\1/')
SWF=$(shell grep '^version:' city_planner/app.yaml | sed 's/.*version: \([0-9a-zA-Z-]\+\).*/city_planner-\1.swf/')

all: prep
	echo "Usage: make run"

prep:
	@echo $(VERSION)
	#sed "s/url: \/city_planner.*.swf/url: \/$(SWF)/"  -i city_planner/app.yaml 
	sed "s/city_planner.*.swf/$(SWF)/"  -i city_planner/static/index.html

run: prep
	python2 dev_appserver.py --port=6080 city_planner/

push: 
	make -C ../city_optimizer opt
	python2 appcfg.py update city_planner/

dump: 
	python2 appcfg.py download_data --application=s~louoptimizer --url=http://1-7-xx.louoptimizer.appspot.com/remote_api --filename=dump.bin --batch_size=500 --num_threads=50 --bandwidth_limit=500000 --rps_limit=1000 --result_db_filename=result_db.db -v


.PHONY: all prep run push dump
