all: sdist doc clean-all

modules=$(shell cd src; find harold -name \*.py \
	            | sed 's|/|.|g' | sed 's/\.py$$//' | sed 's/\.__init__$$//' )

version=$(shell python -c 'import harold; print harold.VERSION')

sdist:
	python2.4 setup.py sdist
	mv dist/harold-${version}.tar.gz ..

doc:
	env PYTHONVER=2.4 PYTHONPATH=src \
	    epydoc -n "Harold API Documentation" -o ../api ${modules}

unittests:	
	python2.4 utest/ALL.py
	env HAROLD_LIGHTWEIGHT=1 python2.4 utest/ALL.py

clean-all:
	rm -Rf MANIFEST build dist

.PHONY: all sdist doc unittests clean-all
