.PHONY: docs build test coverage pylint flake8 pep8 pyflakes templer sloccount

ifndef VTENV_OPTS
VTENV_OPTS = "--no-site-packages"
endif

docs: bin/sphinx-build
	SPHINXBUILD=../bin/sphinx-build \$(MAKE) -C docs html \$^

build:	
	virtualenv \$(VTENV_OPTS) .
	bin/python setup.py develop

test: bin/nosetests
	bin/nosetests -s $project

coverage: bin/coverage bin/nosetests
	bin/nosetests --with-coverage --cover-html --cover-html-dir=html --cover-package=$project
	bin/coverage html

pylint:	bin/pylint
	bin/pylint $namespace_package/$package

flake8:	bin/flake8
	bin/flake8 --max-complexity 12 $namespace_package/$package

pep8:	bin/pep8
	bin/pep8 tooth/paste

pyflakes:	bin/pyflakes
	bin/pyflakes tooth/paste

templer: bin/python
	# Hack to make believe templer that the current folder is the home folder
	# so that it reads the local .zopeskel file with the defaults
	export OLDHOME="\${HOME}"; export HOME="\${PWD}"; ./bin/templer tooth_basic_namespace $project; export HOME="\${OLDHOME}"; 
	# Show the difference between the current package and the regenerated one
	colordiff -c -r $project .|less -r

bin/sphinx-build: bin/python
	bin/pip install sphinx
	bin/pip install coverage

bin/nosetests: bin/python
	bin/pip install nose

bin/coverage: bin/python
	bin/pip install coverage

bin/pylint: bin/python
	bin/pip install pylint

bin/flake8: bin/python
	bin/pip install flake8

bin/pyflakes: bin/python
	bin/pip install pyflakes

bin/pep8: bin/python
	bin/pip install pep8

sloccount:	bin/python
	sloccount tooth/paste
