1 # src/pl/plpython/Makefile
3 subdir
= src
/pl
/plpython
4 top_builddir
= ..
/..
/..
5 include $(top_builddir
)/src
/Makefile.global
8 # On Windows we have to remove -lpython from the link since we are
10 ifeq ($(PORTNAME
), win32
)
11 override python_libspec
=
14 override CPPFLAGS
:= -I.
-I
$(srcdir) $(python_includespec
) $(CPPFLAGS
)
16 rpathdir
= $(python_libdir
)
18 PGFILEDESC
= "PL/Python - procedural language"
20 NAME
= plpython
$(python_majorversion
)
33 plpy_subxactobject.o \
37 DATA
= $(NAME
)u.control
$(NAME
)u--1.0.sql
39 # header files to install - it's not clear which of these might be needed
40 # so install them all.
52 plpy_subxactobject.h \
56 # Python on win32 ships with import libraries only for Microsoft Visual C++,
57 # which are not compatible with mingw gcc. Therefore we need to build a
58 # new import library to link with.
59 ifeq ($(PORTNAME
), win32
)
61 pytverstr
=$(subst .
,,${python_version})
62 PYTHONDLL
=$(subst \
,/,$(WINDIR
))/system32
/python
${pytverstr}.dll
64 OBJS
+= libpython
${pytverstr}.a
66 libpython
${pytverstr}.a
: python
${pytverstr}.def
67 dlltool
--dllname python
${pytverstr}.dll
--def python
${pytverstr}.def
--output-lib libpython
${pytverstr}.a
69 python
${pytverstr}.def
:
70 gendef
- $(PYTHONDLL
) > $@
75 SHLIB_LINK
= $(python_libspec
) $(python_additional_libs
) $(filter -lintl
,$(LIBS
))
77 REGRESS_OPTS
= --dbname
=$(PL_TESTDB
)
100 plpython_subtransaction \
101 plpython_transaction \
104 include $(top_srcdir
)/src
/Makefile.shlib
108 # Ensure parallel safety if a build is started in this directory
109 $(OBJS
): | submake-generated-headers
111 install: all install-lib install-data
113 installdirs: installdirs-lib
114 $(MKDIR_P
) '$(DESTDIR)$(datadir)/extension' '$(DESTDIR)$(includedir_server)'
116 uninstall: uninstall-lib uninstall-data
118 install-data
: installdirs
119 $(INSTALL_DATA
) $(addprefix $(srcdir)/, $(DATA
)) '$(DESTDIR)$(datadir)/extension/'
120 $(INSTALL_DATA
) $(addprefix $(srcdir)/, $(INCS
)) '$(DESTDIR)$(includedir_server)'
123 rm -f
$(addprefix '$(DESTDIR)$(datadir)/extension'/, $(notdir $(DATA
)))
124 rm -f
$(addprefix '$(DESTDIR)$(includedir_server)'/, $(INCS
))
126 .PHONY
: install-data uninstall-data
129 check: submake-pg-regress
130 $(pg_regress_check
) $(REGRESS_OPTS
) $(REGRESS
)
132 installcheck: submake-pg-regress
133 $(pg_regress_installcheck
) $(REGRESS_OPTS
) $(REGRESS
)
136 .PHONY
: submake-pg-regress
137 submake-pg-regress
: | submake-generated-headers
138 $(MAKE
) -C
$(top_builddir
)/src
/test/regress pg_regress
$(X
)
140 clean distclean: clean-lib
142 rm -rf
$(pg_regress_clean_files
)
143 ifeq ($(PORTNAME
), win32
)
144 rm -f python
${pytverstr}.def
146 rm -f spiexceptions.h
149 # Force this dependency to be known even without dependency info built:
150 plpy_plpymodule.o
: spiexceptions.h
152 spiexceptions.h
: $(top_srcdir
)/src
/backend
/utils
/errcodes.txt generate-spiexceptions.pl
153 $(PERL
) $(srcdir)/generate-spiexceptions.pl
$< > $@