Remove pg_regex_collation
[pgsql.git] / src / pl / plpython / Makefile
blobf959083a0bdec5bd4d79af4cf8b224f05b9bb1fb
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
9 # building our own
10 ifeq ($(PORTNAME), win32)
11 override python_libspec =
12 endif
14 override CPPFLAGS := -I. -I$(srcdir) $(python_includespec) $(CPPFLAGS)
16 rpathdir = $(python_libdir)
18 PGFILEDESC = "PL/Python - procedural language"
20 NAME = plpython$(python_majorversion)
22 OBJS = \
23 $(WIN32RES) \
24 plpy_cursorobject.o \
25 plpy_elog.o \
26 plpy_exec.o \
27 plpy_main.o \
28 plpy_planobject.o \
29 plpy_plpymodule.o \
30 plpy_procedure.o \
31 plpy_resultobject.o \
32 plpy_spi.o \
33 plpy_subxactobject.o \
34 plpy_typeio.o \
35 plpy_util.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.
41 INCS = plpython.h \
42 plpython_system.h \
43 plpy_cursorobject.h \
44 plpy_elog.h \
45 plpy_exec.h \
46 plpy_main.h \
47 plpy_planobject.h \
48 plpy_plpymodule.h \
49 plpy_procedure.h \
50 plpy_resultobject.h \
51 plpy_spi.h \
52 plpy_subxactobject.h \
53 plpy_typeio.h \
54 plpy_util.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) > $@
72 endif # win32
75 SHLIB_LINK = $(python_libspec) $(python_additional_libs) $(filter -lintl,$(LIBS))
77 REGRESS_OPTS = --dbname=$(PL_TESTDB)
79 REGRESS = \
80 plpython_schema \
81 plpython_populate \
82 plpython_test \
83 plpython_do \
84 plpython_global \
85 plpython_import \
86 plpython_spi \
87 plpython_newline \
88 plpython_void \
89 plpython_call \
90 plpython_params \
91 plpython_setof \
92 plpython_record \
93 plpython_trigger \
94 plpython_types \
95 plpython_error \
96 plpython_ereport \
97 plpython_unicode \
98 plpython_quote \
99 plpython_composite \
100 plpython_subtransaction \
101 plpython_transaction \
102 plpython_drop
104 include $(top_srcdir)/src/Makefile.shlib
106 all: all-lib
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)'
122 uninstall-data:
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
141 rm -f $(OBJS)
142 rm -rf $(pg_regress_clean_files)
143 ifeq ($(PORTNAME), win32)
144 rm -f python${pytverstr}.def
145 endif
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 $< > $@