NAME = postscriptbarcode

PYTHON_MAKEFILE     = setup.py
PYTHON_OUT = _$(NAME).so

cleanlist += $(NAME).py $(NAME).pyc $(NAME)_wrap.c 

.PHONY: all swig-python install uninstall clean

all: swig-python

swig-python: $(PYTHON_OUT)

$(PYTHON_OUT): $(PYTHON_MAKEFILE)
	python $< build_ext --inplace

test: swig-python
	LD_LIBRARY_PATH=../../c:$(LD_LIBRARY_PATH) python $(PYTHON_MAKEFILE) test

install: $(PYTHON_MAKEFILE) $(PYTHON_OUT)
	python $< install

uninstall: $(PYTHON_MAKEFILE)
	python $< uninstall

clean:
	python $(PYTHON_MAKEFILE) clean --all
	$(RM) $(cleanlist) *.pyc
	$(RM) $(cleanlist) $(PYTHON_OUT)

