Makefile 1.6 KB
Newer Older
1
# $Header: /cvsroot/pgsql/src/pl/plpython/Makefile,v 1.10 2001/09/16 16:11:11 petere 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 15 16 17 18
# 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

# 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)))

19
override CPPFLAGS := -I$(srcdir) $(python_includespec) $(CPPFLAGS)
20
override DLLLIBS := $(BE_DLLLIBS) $(DLLLIBS)
21
rpath :=
22

23 24 25 26
NAME = plpython
SO_MAJOR_VERSION = 0
SO_MINOR_VERSION = 0
OBJS = plpython.o
Bruce Momjian's avatar
Bruce Momjian committed
27

28 29
SHLIB_LINK += $(python_libspec)

30
include $(top_srcdir)/src/Makefile.shlib
Bruce Momjian's avatar
Bruce Momjian committed
31 32


33
all: all-lib
Bruce Momjian's avatar
Bruce Momjian committed
34

35
install: all installdirs
36
	$(INSTALL_SHLIB) $(shlib) $(DESTDIR)$(pkglibdir)/plpython$(DLSUFFIX)
Bruce Momjian's avatar
Bruce Momjian committed
37

38
installdirs:
39
	$(mkinstalldirs) $(DESTDIR)$(pkglibdir)
Bruce Momjian's avatar
Bruce Momjian committed
40

41
uninstall:
42
	rm -f $(DESTDIR)$(pkglibdir)/plpython$(DLSUFFIX)
Bruce Momjian's avatar
Bruce Momjian committed
43

44 45 46
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
47

48 49
installcheck:
	PATH=$(bindir):$$PATH $(SHELL) $(srcdir)/test.sh
50 51 52 53 54 55 56 57 58 59 60

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