# GNU -*- makefile -*-

#VERSION := ${shell python -c "import CeroCoinClient;print CeroCoinClient.__version__"}
VERSION := ${shell python -c "import os; os.chdir('CeroCoinClient'); import CeroCoinClient;print CeroCoinClient.__version__"}

default:
	@echo
	@echo "  *** Welcome to CeroCoinClient ${VERSION} ***"
	@echo
	@echo "  docs   -  Build documentation (html)"
	@echo "  help   -  Open the documentation"
	@echo
	@echo "  clean  -  Remove temporary files"
	@echo "  test   -  Run the unittests"
	@echo "  check  -  Look for rough spots"
	@echo "  sdist  -  Build a source distribution tar ball"

docs:
#	pydoc -w CeroCoinClient
	pydoc -w CeroCoinClient/CeroCoinClient.py

help:
	open CeroCoinClient-${VERSION}.html

clean:
	rm -f *.pyc *~

real-clean: clean
	rm -f MANIFEST  *.html CeroCoinClient-py.info
	rm -rf build dist

# Run the unittest
test:
	@echo
	@echo Testing...
	@echo
	./TestCeroCoinClient/Test.py 

sdist: test
	@echo
	@echo Building a source distribution...
	@echo
	./setup.py sdist --formats=gztar,bztar

# Look for rough spots
check:
	@grep -n FIX *.py *.in PKG-INFO Makefile | grep -v grep
	@echo
	pychecker CeroCoinClient

