diff options
| author | Peter Eisentraut | 2000-06-27 00:32:06 +0000 |
|---|---|---|
| committer | Peter Eisentraut | 2000-06-27 00:32:06 +0000 |
| commit | 5bb8b62983799c8bb5ef2e578629dbd2705bbd52 (patch) | |
| tree | 75199eec2bcf58ab455f7adab52285580d97e4be /src/pl/tcl | |
| parent | ecef326850ab087d78f217f8d97008d3974cbd76 (diff) | |
Makefile cleanup for bin and pl subtrees. They should now support
all the standard semantics. Also get rid of Makefile.in's on the
way and instead declare all variables in Makefile.global.
Diffstat (limited to 'src/pl/tcl')
| -rw-r--r-- | src/pl/tcl/Makefile | 121 |
1 files changed, 54 insertions, 67 deletions
diff --git a/src/pl/tcl/Makefile b/src/pl/tcl/Makefile index b58d4944b1a..44b7a390acd 100644 --- a/src/pl/tcl/Makefile +++ b/src/pl/tcl/Makefile @@ -1,34 +1,23 @@ #------------------------------------------------------------------------- # -# Makefile -# Makefile for the pltcl shared object +# Makefile for the pltcl shared object # -# IDENTIFICATION -# $Header: /cvsroot/pgsql/src/pl/tcl/Makefile,v 1.17 2000/06/17 00:10:25 petere Exp $ +# $Header: /cvsroot/pgsql/src/pl/tcl/Makefile,v 1.18 2000/06/27 00:32:06 petere Exp $ # #------------------------------------------------------------------------- -# -# Tell make where the postgresql sources live -# -SRCDIR= ../../../src -include $(SRCDIR)/Makefile.global +subdir = src/pl/tcl +top_builddir = ../../.. +include ../../Makefile.global -# -# Include definitions from the tclConfig.sh file -# NOTE: GNU make will make this file automatically if it doesn't exist, -# using the make rule that appears below. Cute, eh? -# include Makefile.tcldefs -# -# 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. -# +# 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. + ifndef TCL_SHARED_BUILD ifneq (,$(findstring $(DLSUFFIX),$(TCL_LIB_FILE))) TCL_SHARED_BUILD=1 @@ -38,14 +27,13 @@ endif endif -# Change following to how shared library that contains -# references to libtcl must get built on your system. -# Since these definitions come from the tclConfig.sh script, -# they should work if the shared build of tcl was successful -# on this system. However, tclConfig.sh lies to us a little bit -# (at least in versions 7.6 through 8.0.4) --- it doesn't mention -lc -# in TCL_LIBS, but you still need it on systems that want to hear about -# dependent libraries... +# Change following to how shared library that contains references to +# libtcl must get built on your system. Since these definitions come +# from the tclConfig.sh script, they should work if the shared build +# of tcl was successful on this system. However, tclConfig.sh lies to +# us a little bit (at least in versions 7.6 through 8.0.4) --- it +# doesn't mention -lc in TCL_LIBS, but you still need it on systems +# that want to hear about dependent libraries... ifneq ($(TCL_SHLIB_LD_LIBS),) # link command for a shared lib must mention shared libs it uses @@ -55,28 +43,30 @@ else SHLIB_EXTRA_LIBS= endif -%$(TCL_SHLIB_SUFFIX): %.o +%$(TCL_SHLIB_SUFFIX): %.o $(TCL_SHLIB_LD) -o $@ $< $(TCL_LIB_SPEC) $(SHLIB_EXTRA_LIBS) CC = $(TCL_CC) -# Since we are using Tcl's choice of C compiler, which might not be the -# same one selected for Postgres, do NOT use CFLAGS from Makefile.global. -# Instead use TCL's CFLAGS plus necessary -I directives. +# Since we are using Tcl's choice of C compiler, which might not be +# the same one selected for Postgres, do NOT use CFLAGS from +# Makefile.global. Instead use TCL's CFLAGS plus necessary -I +# directives. -# Can choose either TCL_CFLAGS_OPTIMIZE or TCL_CFLAGS_DEBUG here, as needed +# Can choose either TCL_CFLAGS_OPTIMIZE or TCL_CFLAGS_DEBUG here, as +# needed CFLAGS= $(TCL_CFLAGS_OPTIMIZE) CFLAGS+= $(TCL_SHLIB_CFLAGS) $(TCL_DEFS) -CFLAGS+= -I$(SRCDIR)/include $(INCLUDES) - -# -# Uncomment the following to enable the unknown command lookup -# on the first of all calls to the call handler. See the doc -# in the modules directory about details. -# +CFLAGS+= -I$(top_srcdir)/src/include $(INCLUDES) + + +# Uncomment the following to enable the unknown command lookup on the +# first of all calls to the call handler. See the doc in the modules +# directory about details. + #CFLAGS+= -DPLTCL_UNKNOWN_SUPPORT @@ -95,42 +85,39 @@ INFILES+= $(DLOBJS:.o=$(EXPSUFF)) endif -ifeq ($(TCL_SHARED_BUILD),1) +# Provide dummy targets for the case where we can't build the shared library. + +ifeq ($(TCL_SHARED_BUILD), 1) -# -# Build the shared lib -# all: $(INFILES) -install: all - $(INSTALL) $(INSTL_SHLIB_OPTS) $(DLOBJS) $(LIBDIR)/$(DLOBJS) +install: all installdirs + $(INSTALL_SHLIB) $(DLOBJS) $(libdir)/$(DLOBJS) -else +installdirs: + $(mkinstalldirs) $(libdir) -# -# Oops, can't build it -# -all: - @echo "Cannot build pltcl because Tcl is not a shared library; skipping it." +uninstall: + rm -f $(libdir)/$(DLOBJS) -install: - @echo "Cannot build pltcl because Tcl is not a shared library; skipping it." +else +all install: + @echo "*****"; \ + echo "* Cannot build pltcl because Tcl is not a shared library; skipping it."; \ + echo "*****" endif -# -# Make targets that are still valid when we can't build pltcl -# should be below here. -# Makefile.tcldefs: mkMakefile.tcldefs.sh - /bin/sh ./mkMakefile.tcldefs.sh + $(SHELL) $< + +mkMakefile.tcldefs.sh: mkMakefile.tcldefs.sh.in $(top_builddir)/config.status + cd $(top_builddir) && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status + -# -# Clean -# clean: - rm -f $(INFILES) *.o - rm -f Makefile.tcldefs + rm -f $(INFILES) *.o Makefile.tcldefs -dep depend: +distclean maintainer-clean: clean + rm -f mkMakefile.tcldefs.sh |
