Makefile 1.9 KB
Newer Older
1 2
#-------------------------------------------------------------------------
#
3
# Makefile for the pltcl shared object
4
#
5
# $PostgreSQL: pgsql/src/pl/tcl/Makefile,v 1.44 2004/12/16 20:41:01 tgl Exp $
6 7 8
#
#-------------------------------------------------------------------------

9 10
subdir = src/pl/tcl
top_builddir = ../../..
11
include $(top_builddir)/src/Makefile.global
12 13


14
override CPPFLAGS := $(TCL_INCLUDE_SPEC) $(CPPFLAGS)
15 16


17 18 19 20 21 22
# Find out whether Tcl was built as a shared library --- if not, we
# can't link a shared library that depends on it, and have to forget
# about building pltcl. In Tcl 8, tclConfig.sh sets TCL_SHARED_BUILD
# for us, but in older Tcl releases it doesn't. In that case we guess
# based on the name of the Tcl library.

23 24 25 26 27 28 29 30 31
ifndef TCL_SHARED_BUILD
ifneq (,$(findstring $(DLSUFFIX),$(TCL_LIB_FILE)))
TCL_SHARED_BUILD=1
else
TCL_SHARED_BUILD=0
endif
endif


32
ifneq ($(PORTNAME), win32)
33
SHLIB_LINK = $(BE_DLLLIBS) $(TCL_LIB_SPEC) $(TCL_LIBS) -lc
34 35 36
else
SHLIB_LINK = $(TCL_LIB_SPEC) $(BE_DLLLIBS)
endif
37

38 39 40 41
NAME = pltcl
SO_MAJOR_VERSION = 2
SO_MINOR_VERSION = 0
OBJS = pltcl.o
42

43
include $(top_srcdir)/src/Makefile.shlib
44 45

ifeq ($(TCL_SHARED_BUILD), 1)
46

47
all: all-lib
48
	$(MAKE) -C modules $@
49

50
install: all installdirs
51
ifeq ($(enable_shared), yes)
52
	$(INSTALL_SHLIB) $(shlib) $(DESTDIR)$(pkglibdir)/$(NAME)$(DLSUFFIX)
53 54 55 56 57
else
	@echo "*****"; \
	 echo "* PL/Tcl was not installed due to lack of shared library support."; \
	 echo "*****"
endif
58
	$(MAKE) -C modules $@
59

60
installdirs:
61
	$(mkinstalldirs) $(DESTDIR)$(pkglibdir)
62
	$(MAKE) -C modules $@
63

64
uninstall:
65
	rm -f $(DESTDIR)$(pkglibdir)/$(NAME)$(DLSUFFIX)
66
	$(MAKE) -C modules $@
67

68
else # TCL_SHARED_BUILD = 0
69

70 71
# Provide dummy targets for the case where we can't build the shared library.
all:
72
	@echo "*****"; \
73
	 echo "* Cannot build PL/Tcl because Tcl is not a shared library; skipping it."; \
74
	 echo "*****"
75 76

endif # TCL_SHARED_BUILD = 0
77

78 79
clean distclean maintainer-clean: clean-lib
	rm -f $(OBJS)
80
	$(MAKE) -C modules $@