Makefile 1.86 KB
Newer Older
1
# $PostgreSQL: pgsql/src/pl/plpython/Makefile,v 1.14 2004/09/24 20:08:42 tgl Exp $
Bruce Momjian's avatar
Bruce Momjian committed
2

3 4 5
subdir = src/pl/plpython
top_builddir = ../../..
include $(top_builddir)/src/Makefile.global
Bruce Momjian's avatar
Bruce Momjian committed
6 7


8 9 10 11 12 13 14
# On some platforms we can only build PL/Python if libpython is a
# shared library.  Since there is no official way to determine this,
# we see if there is a file that is named like a shared library.
ifneq (,$(wildcard $(python_configdir)/libpython*$(DLSUFFIX)*))
shared_libpython = yes
endif

15 16 17 18 19 20
# Darwin (OS X) has its own ideas about how to do this.
ifeq ($(PORTNAME), darwin)
shared_libpython = yes
override python_libspec := -framework Python
endif

21 22 23 24
# 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)))

25
override CPPFLAGS := -I$(srcdir) $(python_includespec) $(CPPFLAGS)
26
rpath :=
27

28 29 30 31
NAME = plpython
SO_MAJOR_VERSION = 0
SO_MINOR_VERSION = 0
OBJS = plpython.o
Bruce Momjian's avatar
Bruce Momjian committed
32

33
SHLIB_LINK = $(BE_DLLLIBS) $(python_libspec)
34

35
include $(top_srcdir)/src/Makefile.shlib
Bruce Momjian's avatar
Bruce Momjian committed
36 37


38
all: all-lib
Bruce Momjian's avatar
Bruce Momjian committed
39

40
install: all installdirs
41
ifeq ($(enable_shared), yes)
42
	$(INSTALL_SHLIB) $(shlib) $(DESTDIR)$(pkglibdir)/plpython$(DLSUFFIX)
43 44 45 46 47
else
	@echo "*****"; \
	 echo "* PL/Python was not installed due to lack of shared library support."; \
	 echo "*****"
endif
Bruce Momjian's avatar
Bruce Momjian committed
48

49
installdirs:
50
	$(mkinstalldirs) $(DESTDIR)$(pkglibdir)
Bruce Momjian's avatar
Bruce Momjian committed
51

52
uninstall:
53
	rm -f $(DESTDIR)$(pkglibdir)/plpython$(DLSUFFIX)
Bruce Momjian's avatar
Bruce Momjian committed
54

55 56 57
clean distclean maintainer-clean: clean-lib
	rm -f $(OBJS)
	@rm -f error.diff feature.diff error.output feature.output test.log
Bruce Momjian's avatar
Bruce Momjian committed
58

59 60
installcheck:
	PATH=$(bindir):$$PATH $(SHELL) $(srcdir)/test.sh
61 62 63 64 65 66 67 68 69 70 71

else # can't build

all:
	@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