DSPAM_CONFIG=/etc/dspam.conf
DSPAM_PREFIX=%DSPAM_PREFIX%
DSPAM_INCLUDE_DIR=$(DSPAM_PREFIX)/include/dspam
DSPAM_LIB_DIR=$(DSPAM_PREFIX)/lib
PYTHONPREFIX=%PYTHON_PREFIX%
PYTHONVER=%PYTHON_VER%
CFLAGS+=-I$(PYTHONPREFIX)/include/$(PYTHONVER)/ -DNDEBUG \
	-I$(DSPAM_INCLUDE_DIR) \
	-DCONFIG_DEFAULT=$(DSPAM_CONFIG)
LIBS=-ldspam

all:	pydspam.so

pydspam.c:	pydspam.pyx
	pyrexc pydspam.pyx

pydspam.o:	pydspam.c
	gcc -c $(CFLAGS) pydspam.c

pydspam.so:	pydspam.o
	gcc -shared -o pydspam.so pydspam.o $(LIBS) -L$(DSPAM_LIB_DIR)

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

mrproper:	clean
	rm -f pydspam.c

.PHONY:	clean
