📄 makefile
字号:
# $PostgreSQL: pgsql/src/pl/plpython/Makefile,v 1.23 2005/08/12 21:44:51 momjian Exp $subdir = src/pl/plpythontop_builddir = ../../..include $(top_builddir)/src/Makefile.global# On some platforms we can only build PL/Python if libpython is a# shared library. Since there is no official way to determine this# (at least not in pre-2.3 Python), we see if there is a file that is# named like a shared library.ifneq (,$(wildcard $(python_libdir)/libpython*$(DLSUFFIX)*))shared_libpython = yesendif# Windows needs to convert backslashed paths to normal slashes,# and we have to remove -lpython from the link since we are building our ownifeq ($(PORTNAME), win32)shared_libpython = yespython_includespec := $(subst \,/,$(python_includespec))override python_libspec :=endif# Darwin (OS X) has its own ideas about how to do this.ifeq ($(PORTNAME), darwin)shared_libpython = yesoverride python_libspec := -framework Pythonoverride python_additional_libs :=endif# If we don't have a shared library and the platform doesn't allow it# to work without, we have to skip it.ifneq (,$(findstring yes, $(shared_libpython)$(allow_nonpic_in_shlib)))override CPPFLAGS := -I$(srcdir) $(python_includespec) $(CPPFLAGS)rpathdir = $(python_libdir)NAME = plpythonSO_MAJOR_VERSION = 0SO_MINOR_VERSION = 0OBJS = plpython.o# 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)pytverstr=$(subst .,,${python_version})OBJS += libpython${pytverstr}.alibpython${pytverstr}.a: python${pytverstr}.def dlltool --dllname python${pytverstr}.dll --def python${pytverstr}.def --output-lib libpython${pytverstr}.aWD=$(subst \,/,$(WINDIR))python${pytverstr}.def: $(WD)/system32/python${pytverstr}.dll pexports $(WD)/system32/python${pytverstr}.dll > python${pytverstr}.defendifSHLIB_LINK = $(BE_DLLLIBS) $(python_libspec) $(python_additional_libs)REGRESS_OPTS = --dbname=$(PL_TESTDB) --load-language=plpythonuREGRESS = plpython_schema plpython_populate plpython_function plpython_test plpython_error plpython_dropinclude $(top_srcdir)/src/Makefile.shliball: all-lib# When doing a VPATH build, copy over the .sql and .out files so that the# test script can find them. See comments in src/test/regress/GNUmakefile.ifdef VPATHifneq ($(PORTNAME),win32)abs_srcdir := $(shell cd $(srcdir) && pwd)abs_builddir := $(shell pwd)elseabs_srcdir := $(shell cd $(srcdir) && pwd -W)abs_builddir := $(shell pwd -W)endiftest_files_src := $(wildcard $(srcdir)/sql/*.sql) $(wildcard $(srcdir)/expected/*.out)test_files_build := $(patsubst $(srcdir)/%, $(abs_builddir)/%, $(test_files_src))all: $(test_files_build)$(test_files_build): $(abs_builddir)/%: $(srcdir)/% ln -s $< $@endifinstall: all installdirsifeq ($(enable_shared), yes) $(INSTALL_SHLIB) $(shlib) $(DESTDIR)$(pkglibdir)/plpython$(DLSUFFIX)else @echo "*****"; \ echo "* PL/Python was not installed due to lack of shared library support."; \ echo "*****"endifinstalldirs: $(mkinstalldirs) $(DESTDIR)$(pkglibdir)uninstall: rm -f $(DESTDIR)$(pkglibdir)/plpython$(DLSUFFIX)installcheck: submake $(SHELL) $(top_builddir)/src/test/regress/pg_regress $(REGRESS_OPTS) $(REGRESS).PHONY: submakesubmake: $(MAKE) -C $(top_builddir)/src/test/regress pg_regressclean distclean maintainer-clean: clean-lib rm -f $(OBJS) rm -rf results rm -f regression.diffs regression.outifeq ($(PORTNAME), win32) rm -f python${pytverstr}.defendifelse # can't buildall: @echo ""; \ echo "*** Cannot build PL/Python because libpython is not a shared library." ; \ echo "*** You might have to rebuild your Python installation. Refer to"; \ echo "*** the documentation for details."; \ echo ""endif # can't build
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -