Source

fastdev-django / Makefile

Full commit
# Just remember that you need to use real tabs, not spaces, in a Makefile

.PHONY: run
run: bin/django syncdb bin/sass compile_trans
	./bin/django runserver 0.0.0.0:8000

.PHONY: shell_plus
shell_plus: bin/django syncdb bin/sass
	./bin/django shell_plus

.PHONY: check_pyflakes
check_pyflakes: bin/pyflakes
	find . -name '*.py' -exec ./bin/pyflakes {} \;

bin/pyflakes: bin/buildout
	./bin/buildout install pyflakes

.PHONY: check_pep8
check_pep8: bin/pep8
	find . -name '*.py' -exec ./bin/pep8 {} \;

bin/pep8: bin/buildout
	./bin/buildout install pep8

bin/django: bin/buildout buildout.cfg
	./bin/buildout

bin/buildout:
	python bootstrap.py --distribute

syncdb: bin/django
	./bin/django syncdb
	# touch a timestamp file to avoid re-syncing
	touch syncdb

.PHONY: make_trans
make_trans: bin/django
	./bin/django makemessages -a -e 'py,html,haml'

bin/sass:
	gem install sass --bindir bin

# generates WSGI script for webfaction hosting
# prerequisites to the right of the pipe are executed strictly in the order they are listed
webfaction: | bin/django djangopaths.py
	./bin/buildout install webfaction

djangopaths.py buildout.cfg:

compile_trans:
	make locale/*/LC_MESSAGES/django.mo

locale/%/LC_MESSAGES/django.mo: locale/%/LC_MESSAGES/django.po
	./bin/django compilemessages -l $(word 2,$(subst /, ,$@))

locale/*/LC_MESSAGES/django.po:

run: bin/coffee
bin/coffee: bin/buildout
	bin/buildout install node