PYTHONVER=%PYTHON_VER%
PYTHONPREFIX=%PYTHON_PREFIX%
CFLAGS+=-I$(PYTHONPREFIX)/include/$(PYTHONVER)/ -DNDEBUG -fPIC
LIBS=-lclamav

all:	libclamav.so

libclamav.c:	libclamav.pyx
	which pyrexc >/dev/null 2>&1 && pyrexc libclamav.pyx || true

libclamav.o: libclamav.c
	gcc -c $(CFLAGS) $(INCLUDES) libclamav.c

libclamav.so:	libclamav.o
	gcc -shared -o libclamav.so libclamav.o $(LIBS)

clean:
	rm -f *.o *.so *.pyc

mrproper: clean
	rm -f libclamav.c
