Makefile 2.2 KB
Newer Older
1 2
#-------------------------------------------------------------------------
#
3
# Makefile for the pltcl shared object
4
#
5
# $Header: /cvsroot/pgsql/src/pl/tcl/Makefile,v 1.39 2002/12/30 17:19:54 tgl Exp $
6 7 8
#
#-------------------------------------------------------------------------

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


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


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 33 34
# The following attempts to figure out what libraries need to be
# linked with pltcl.  The information comes from the tclConfig.sh
# file, but it's mostly bogus.  This just might work.
35 36 37

ifneq ($(TCL_SHLIB_LD_LIBS),)
# link command for a shared lib must mention shared libs it uses
38
SHLIB_LINK = $(TCL_LIB_SPEC) $(TCL_LIBS) -lc
39
else
40 41 42
ifeq ($(PORTNAME), hpux)
# link command for a shared lib must mention shared libs it uses,
# even though Tcl doesn't think so...
43
SHLIB_LINK = $(TCL_LIB_SPEC) $(TCL_LIBS) -lc
44
else
45
# link command for a shared lib must NOT mention shared libs it uses
46
SHLIB_LINK = $(TCL_LIB_SPEC)
47
endif
48
endif
49

50

51 52 53 54
NAME = pltcl
SO_MAJOR_VERSION = 2
SO_MINOR_VERSION = 0
OBJS = pltcl.o
55

56
include $(top_srcdir)/src/Makefile.shlib
57 58

ifeq ($(TCL_SHARED_BUILD), 1)
59

60
all: all-lib
61
	$(MAKE) -C modules $@
62

63
install: all installdirs
64
	$(INSTALL_SHLIB) $(shlib) $(DESTDIR)$(pkglibdir)/$(NAME)$(DLSUFFIX)
65
	$(MAKE) -C modules $@
66

67
installdirs:
68
	$(mkinstalldirs) $(DESTDIR)$(pkglibdir)
69
	$(MAKE) -C modules $@
70

71
uninstall:
72
	rm -f $(DESTDIR)$(pkglibdir)/$(NAME)$(DLSUFFIX)
73
	$(MAKE) -C modules $@
74

75
else # TCL_SHARED_BUILD = 0
76

77 78
# Provide dummy targets for the case where we can't build the shared library.
all:
79 80 81
	@echo "*****"; \
	 echo "* Cannot build pltcl because Tcl is not a shared library; skipping it."; \
	 echo "*****"
82 83

endif # TCL_SHARED_BUILD = 0
84

85 86
clean distclean maintainer-clean: clean-lib
	rm -f $(OBJS)
87
	$(MAKE) -C modules $@