2010-09-20 16:08:53 -04:00
|
|
|
# src/pl/plpython/Makefile
|
2001-05-09 15:54:38 -04:00
|
|
|
|
2001-05-11 21:30:30 -04:00
|
|
|
subdir = src/pl/plpython
|
|
|
|
|
top_builddir = ../../..
|
|
|
|
|
include $(top_builddir)/src/Makefile.global
|
2001-05-09 15:54:38 -04:00
|
|
|
|
|
|
|
|
|
2015-05-03 08:17:04 -04:00
|
|
|
# On Windows we have to remove -lpython from the link since we are
|
|
|
|
|
# building our own
|
2004-10-06 05:20:41 -04:00
|
|
|
ifeq ($(PORTNAME), win32)
|
2007-02-09 10:56:00 -05:00
|
|
|
override python_libspec =
|
2004-10-06 05:20:41 -04:00
|
|
|
endif
|
|
|
|
|
|
2011-02-28 21:31:39 -05:00
|
|
|
override CPPFLAGS := -I. -I$(srcdir) $(python_includespec) $(CPPFLAGS)
|
2004-11-19 14:23:01 -05:00
|
|
|
|
|
|
|
|
rpathdir = $(python_libdir)
|
2001-05-25 11:48:33 -04:00
|
|
|
|
2014-07-14 14:07:52 -04:00
|
|
|
PGFILEDESC = "PL/Python - procedural language"
|
|
|
|
|
|
2009-12-15 17:59:55 -05:00
|
|
|
NAME = plpython$(python_majorversion)
|
2011-03-04 21:51:14 -05:00
|
|
|
|
2011-12-18 14:14:16 -05:00
|
|
|
OBJS = \
|
|
|
|
|
plpy_cursorobject.o \
|
|
|
|
|
plpy_elog.o \
|
|
|
|
|
plpy_exec.o \
|
|
|
|
|
plpy_main.o \
|
|
|
|
|
plpy_planobject.o \
|
|
|
|
|
plpy_plpymodule.o \
|
|
|
|
|
plpy_procedure.o \
|
|
|
|
|
plpy_resultobject.o \
|
|
|
|
|
plpy_spi.o \
|
|
|
|
|
plpy_subxactobject.o \
|
|
|
|
|
plpy_typeio.o \
|
2014-07-14 14:07:52 -04:00
|
|
|
plpy_util.o \
|
|
|
|
|
$(WIN32RES)
|
2001-05-09 15:54:38 -04:00
|
|
|
|
2011-11-09 14:43:04 -05:00
|
|
|
DATA = $(NAME)u.control $(NAME)u--1.0.sql $(NAME)u--unpackaged--1.0.sql
|
|
|
|
|
ifeq ($(python_majorversion),2)
|
|
|
|
|
DATA += plpythonu.control plpythonu--1.0.sql plpythonu--unpackaged--1.0.sql
|
|
|
|
|
endif
|
2011-03-04 21:51:14 -05:00
|
|
|
|
2004-10-06 05:20:41 -04:00
|
|
|
|
|
|
|
|
# Python on win32 ships with import libraries only for Microsoft Visual C++,
|
|
|
|
|
# which are not compatible with mingw gcc. Therefore we need to build a
|
|
|
|
|
# new import library to link with.
|
|
|
|
|
ifeq ($(PORTNAME), win32)
|
2014-02-14 11:31:35 -05:00
|
|
|
|
2004-10-06 05:20:41 -04:00
|
|
|
pytverstr=$(subst .,,${python_version})
|
2014-02-14 11:31:35 -05:00
|
|
|
PYTHONDLL=$(subst \,/,$(WINDIR))/system32/python${pytverstr}.dll
|
|
|
|
|
|
2004-10-06 05:20:41 -04:00
|
|
|
OBJS += libpython${pytverstr}.a
|
2014-02-14 11:31:35 -05:00
|
|
|
|
2004-10-06 05:20:41 -04:00
|
|
|
libpython${pytverstr}.a: python${pytverstr}.def
|
2014-02-14 11:31:35 -05:00
|
|
|
dlltool --dllname python${pytverstr}.dll --def python${pytverstr}.def --output-lib libpython${pytverstr}.a
|
|
|
|
|
|
2014-11-02 21:43:30 -05:00
|
|
|
python${pytverstr}.def:
|
|
|
|
|
pexports $(PYTHONDLL) > $@
|
2014-02-14 11:31:35 -05:00
|
|
|
|
|
|
|
|
endif # win32
|
2004-10-06 05:20:41 -04:00
|
|
|
|
|
|
|
|
|
2009-01-15 08:49:57 -05:00
|
|
|
SHLIB_LINK = $(python_libspec) $(python_additional_libs) $(filter -lintl,$(LIBS))
|
2001-05-12 13:49:32 -04:00
|
|
|
|
2009-12-15 17:59:55 -05:00
|
|
|
REGRESS_OPTS = --dbname=$(PL_TESTDB)
|
|
|
|
|
# Only load plpythonu with Python 2. The test files themselves load
|
|
|
|
|
# the versioned language plpython(2|3)u.
|
|
|
|
|
ifeq ($(python_majorversion),2)
|
2011-03-04 21:51:14 -05:00
|
|
|
REGRESS_OPTS += --load-extension=plpythonu
|
2009-12-15 17:59:55 -05:00
|
|
|
endif
|
2011-03-05 15:13:15 -05:00
|
|
|
|
2009-08-12 12:37:26 -04:00
|
|
|
REGRESS = \
|
|
|
|
|
plpython_schema \
|
|
|
|
|
plpython_populate \
|
|
|
|
|
plpython_test \
|
2010-01-22 10:45:15 -05:00
|
|
|
plpython_do \
|
2009-08-12 12:37:26 -04:00
|
|
|
plpython_global \
|
|
|
|
|
plpython_import \
|
|
|
|
|
plpython_spi \
|
|
|
|
|
plpython_newline \
|
|
|
|
|
plpython_void \
|
|
|
|
|
plpython_params \
|
|
|
|
|
plpython_setof \
|
|
|
|
|
plpython_record \
|
|
|
|
|
plpython_trigger \
|
2009-08-14 09:42:16 -04:00
|
|
|
plpython_types \
|
2009-08-12 12:37:26 -04:00
|
|
|
plpython_error \
|
2016-06-07 09:33:41 -04:00
|
|
|
plpython_ereport \
|
2009-08-12 12:37:26 -04:00
|
|
|
plpython_unicode \
|
2011-02-22 16:33:44 -05:00
|
|
|
plpython_quote \
|
2011-02-26 09:53:11 -05:00
|
|
|
plpython_composite \
|
2011-02-27 10:09:56 -05:00
|
|
|
plpython_subtransaction \
|
2009-08-12 12:37:26 -04:00
|
|
|
plpython_drop
|
2011-03-05 15:13:15 -05:00
|
|
|
|
PL/Python: Improve Python 3 regression test setup
Currently, we are making mangled copies of plpython/{expected,sql} to
plpython/python3/{expected,sql}, and run the tests in
plpython/python3. This has the disadvantage that the regression.diffs
file, if any, ends up in plpython/python3, which is not the normal
location. If we instead make the mangled copies in
plpython/{expected,sql}/python3/, we can run the tests from the normal
directory, regression.diffs ends up the normal place, and the
pg_regress invocation also becomes a lot simpler. It's also more
obvious at run time what's going on, because the tests end up being
named "python3/something" in the test output.
2012-09-16 22:26:33 -04:00
|
|
|
REGRESS_PLPYTHON3_MANGLE := $(REGRESS)
|
|
|
|
|
|
2001-05-11 21:30:30 -04:00
|
|
|
include $(top_srcdir)/src/Makefile.shlib
|
2001-05-09 15:54:38 -04:00
|
|
|
|
2016-07-01 15:08:55 -04:00
|
|
|
all: submake-generated-headers all-lib
|
2001-05-09 15:54:38 -04:00
|
|
|
|
2011-03-04 21:51:14 -05:00
|
|
|
|
2011-03-05 18:32:06 -05:00
|
|
|
install: all install-lib install-data
|
2001-05-09 15:54:38 -04:00
|
|
|
|
2008-04-07 10:15:58 -04:00
|
|
|
installdirs: installdirs-lib
|
2015-04-26 10:33:14 -04:00
|
|
|
$(MKDIR_P) '$(DESTDIR)$(datadir)/extension' '$(DESTDIR)$(includedir_server)'
|
2001-05-09 15:54:38 -04:00
|
|
|
|
2011-03-04 21:51:14 -05:00
|
|
|
uninstall: uninstall-lib uninstall-data
|
2001-05-09 15:54:38 -04:00
|
|
|
|
2011-03-05 18:32:06 -05:00
|
|
|
install-data: installdirs
|
2011-05-01 17:37:07 -04:00
|
|
|
$(INSTALL_DATA) $(addprefix $(srcdir)/, $(DATA)) '$(DESTDIR)$(datadir)/extension/'
|
2015-04-26 10:33:14 -04:00
|
|
|
$(INSTALL_DATA) $(srcdir)/plpython.h $(srcdir)/plpy_util.h '$(DESTDIR)$(includedir_server)'
|
2011-03-04 21:51:14 -05:00
|
|
|
|
|
|
|
|
uninstall-data:
|
|
|
|
|
rm -f $(addprefix '$(DESTDIR)$(datadir)/extension'/, $(notdir $(DATA)))
|
2015-04-26 10:33:14 -04:00
|
|
|
rm -f $(addprefix '$(DESTDIR)$(includedir_server)'/, plpython.h plpy_util.h)
|
2011-03-04 21:51:14 -05:00
|
|
|
|
|
|
|
|
.PHONY: install-data uninstall-data
|
|
|
|
|
|
|
|
|
|
|
2015-04-26 10:33:14 -04:00
|
|
|
include $(srcdir)/regress-python3-mangle.mk
|
2011-02-14 14:52:32 -05:00
|
|
|
|
2009-12-15 17:59:55 -05:00
|
|
|
|
2016-07-01 15:08:55 -04:00
|
|
|
check: submake-pg-regress
|
2011-02-14 14:52:32 -05:00
|
|
|
$(pg_regress_check) $(REGRESS_OPTS) $(REGRESS)
|
|
|
|
|
|
2016-07-01 15:08:55 -04:00
|
|
|
installcheck: submake-pg-regress
|
2011-02-14 14:52:32 -05:00
|
|
|
$(pg_regress_installcheck) $(REGRESS_OPTS) $(REGRESS)
|
PL/Python: Improve Python 3 regression test setup
Currently, we are making mangled copies of plpython/{expected,sql} to
plpython/python3/{expected,sql}, and run the tests in
plpython/python3. This has the disadvantage that the regression.diffs
file, if any, ends up in plpython/python3, which is not the normal
location. If we instead make the mangled copies in
plpython/{expected,sql}/python3/, we can run the tests from the normal
directory, regression.diffs ends up the normal place, and the
pg_regress invocation also becomes a lot simpler. It's also more
obvious at run time what's going on, because the tests end up being
named "python3/something" in the test output.
2012-09-16 22:26:33 -04:00
|
|
|
|
2005-05-14 13:55:22 -04:00
|
|
|
|
2016-07-01 15:08:55 -04:00
|
|
|
.PHONY: submake-pg-regress
|
|
|
|
|
submake-pg-regress:
|
2006-07-18 22:37:00 -04:00
|
|
|
$(MAKE) -C $(top_builddir)/src/test/regress pg_regress$(X)
|
2005-05-14 13:55:22 -04:00
|
|
|
|
2011-02-28 11:41:10 -05:00
|
|
|
clean distclean: clean-lib
|
2001-05-11 21:30:30 -04:00
|
|
|
rm -f $(OBJS)
|
2011-02-14 14:52:32 -05:00
|
|
|
rm -rf $(pg_regress_clean_files)
|
2004-10-06 05:20:41 -04:00
|
|
|
ifeq ($(PORTNAME), win32)
|
|
|
|
|
rm -f python${pytverstr}.def
|
|
|
|
|
endif
|
2001-05-09 15:54:38 -04:00
|
|
|
|
2011-07-03 13:55:02 -04:00
|
|
|
|
|
|
|
|
# Force this dependency to be known even without dependency info built:
|
2011-12-18 15:34:53 -05:00
|
|
|
plpy_plpymodule.o: spiexceptions.h
|
2011-07-03 13:55:02 -04:00
|
|
|
|
|
|
|
|
spiexceptions.h: $(top_srcdir)/src/backend/utils/errcodes.txt generate-spiexceptions.pl
|
|
|
|
|
$(PERL) $(srcdir)/generate-spiexceptions.pl $< > $@
|
|
|
|
|
|
|
|
|
|
distprep: spiexceptions.h
|
|
|
|
|
|
|
|
|
|
maintainer-clean: distclean
|
|
|
|
|
rm -f spiexceptions.h
|