subdir = src/interfaces/python
top_builddir = ../../..
include $(top_builddir)/src/Makefile.global

NAME = pgmodule
SO_MAJOR_VERSION = 0
SO_MINOR_VERSION = 0
OBJS = pgmodule.o
rpath :=

include $(top_srcdir)/src/Makefile.shlib

override CFLAGS += $(CFLAGS_SL)
# (Python also has a config.h file.  Be sure to use ours.)
override CPPFLAGS := -I$(libpq_srcdir) $(CPPFLAGS) -I$(python_includedir)
SHLIB_LINK = $(libpq)

all: all-lib

install: all installdirs
	$(INSTALL_SHLIB) $(shlib) $(DESTDIR)$(python_moduledir)/site-packages/_pgmodule$(DLSUFFIX)
	$(INSTALL_DATA) $(srcdir)/pg.py $(DESTDIR)$(python_moduledir)/site-packages
	$(INSTALL_DATA) $(srcdir)/pgdb.py $(DESTDIR)$(python_moduledir)/site-packages

uninstall:
	rm -f $(addprefix $(DESTDIR)$(python_moduledir)/site-packages/, _pgmodule$(DLSUFFIX) pg.py pgdb.py)

clean distclean maintainer-clean: clean-lib
	rm -f $(OBJS)
