# -*- makefile -*- To handle basic tasks while developing.
help:
	@echo
	@echo " Welcome to the example python module:"
	@echo 
	@echo "  make docs         - Produce epydoc html documention"
	@echo 
	@echo "  make clean        - Clean up all the moose droppings"
	@echo "  make real-clean   - Get out the extra scrub brush"
	@echo
	@echo "  make test         - Get some exercise"
	@echo "  make lint         - run pychecker and pylint"
	@echo "  make check        - Look for trouble spots"

######################################################################
.PHONY: test
#test:
#	./template.py --unit-test
#	./template.py --doc-test
#TEST_VERBOSITY:=-v
.PHONY: test
test:
	@echo "FIX: this is not passing back failures"
	export PYTHONPATH=.. && for file in [a-z]*.py; do \
	                 ./$$file --doc-test ${TEST_VERBOSITY}; done
	@echo
	export PYTHONPATH=.. && for file in [a-z]*.py; do \
	                 ./$$file --unit-test ${TEST_VERBOSITY}; done
	@echo
	@echo "All tests passed. FIX: does this really fail correctly?"

######################################################################
.PHONY: doc html docs
doc: docs
html: docs

docs:
	epydoc -v *.py
	epydoc -v --check *.py

# Mac OSX only:
open-docs: docs
	open html/index.html

######################################################################
.PHONY: check
check:
	@grep -n -H FIX Makefile | grep -v grep
	@egrep -n 'FIX|\@bug|\@todo:' *.py 

######################################################################
.PHONY: lint
lint:
	pychecker --moduledoc --classdoc --funcdoc *.py
	pylint --max-line-length=200
	epydoc -v --check *.py

######################################################################
.PHONY: clean
clean:
	rm -f *.pyc

.PHONY: real-clean
real-clean: clean
	rm -rf html
