summaryrefslogtreecommitdiff
path: root/databases/py-PyGreSQL/files/Makefile
blob: 3ebb172d0424263aa3c95feddf62d17966e7efba (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# grr, commit_prep wants the next line
# $FreeBSD$
.SUFFIXES:  .py .pyc

all: _pgmodule.so pg.pyc pgdb.pyc

install: 
	@${MKDIR} ${PYTHON_SITELIBDIR}
	${BSD_INSTALL_PROGRAM} _pgmodule.so ${PYTHON_SITELIBDIR}
	${BSD_INSTALL_DATA} pg.py pg.pyc pgdb.py pgdb.pyc \
	    ${PYTHON_SITELIBDIR}

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

_pgmodule.so: pgmodule.o
	${LD} -Bshareable -lc_r -L${PYTHON_LIBDIR}/config \
	    -l${PYTHON_VERSION} -L${PREFIX}/lib -lpq \
	    ${.ALLSRC} -o ${.TARGET}

pgmodule.o: pgmodule.c
	${CC} -c -I${PREFIX}/include/${PYTHON_VERSION} \
	    -I${PREFIX}/include/pgsql ${.ALLSRC}

.py.pyc:
	${SETENV} PYTHONPATH=${.CURDIR} ${PYTHON} -c 'import ${.IMPSRC:.py=}'