]> granicus.if.org Git - postgresql/blob - src/pl/tcl/Makefile
Update pg_regress calls in PL checks to handle vpath builds.
[postgresql] / src / pl / tcl / Makefile
1 #-------------------------------------------------------------------------
2 #
3 # Makefile for the pltcl shared object
4 #
5 # $PostgreSQL: pgsql/src/pl/tcl/Makefile,v 1.53 2008/10/02 08:11:11 petere Exp $
6 #
7 #-------------------------------------------------------------------------
8
9 subdir = src/pl/tcl
10 top_builddir = ../../..
11 include $(top_builddir)/src/Makefile.global
12
13
14 override CPPFLAGS := $(TCL_INCLUDE_SPEC) $(CPPFLAGS)
15
16
17 # Find out whether Tcl was built as a shared library --- if not, we
18 # can't link a shared library that depends on it, and have to forget
19 # about building pltcl. In Tcl 8, tclConfig.sh sets TCL_SHARED_BUILD
20 # for us, but in older Tcl releases it doesn't. In that case we guess
21 # based on the name of the Tcl library.
22
23 ifndef TCL_SHARED_BUILD
24 ifneq (,$(findstring $(DLSUFFIX),$(TCL_LIB_FILE)))
25 TCL_SHARED_BUILD=1
26 else
27 TCL_SHARED_BUILD=0
28 endif
29 endif
30
31
32 SHLIB_LINK = $(TCL_LIB_SPEC)
33 ifneq ($(PORTNAME), win32)
34 SHLIB_LINK += $(TCL_LIBS) -lc
35 endif
36
37 NAME = pltcl
38 OBJS = pltcl.o
39
40 REGRESS_OPTS = --dbname=$(PL_TESTDB) --load-language=pltcl
41 REGRESS = pltcl_setup pltcl_queries
42 # where to find psql for running the tests
43 PSQLDIR = $(bindir)
44
45 include $(top_srcdir)/src/Makefile.shlib
46
47 ifeq ($(TCL_SHARED_BUILD), 1)
48
49 all: all-lib
50         $(MAKE) -C modules $@
51
52 install: all installdirs install-lib
53         $(MAKE) -C modules $@
54
55 installdirs: installdirs-lib
56         $(MAKE) -C modules $@
57
58 uninstall: uninstall-lib
59         $(MAKE) -C modules $@
60
61 installcheck: submake
62         $(top_builddir)/src/test/regress/pg_regress --inputdir=$(srcdir) --psqldir=$(PSQLDIR) $(REGRESS_OPTS) $(REGRESS)
63
64 .PHONY: submake
65 submake:
66         $(MAKE) -C $(top_builddir)/src/test/regress pg_regress$(X)
67
68 else # TCL_SHARED_BUILD = 0
69
70 # Provide dummy targets for the case where we can't build the shared library.
71 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 clean distclean maintainer-clean: clean-lib
79         rm -f $(OBJS)
80         rm -rf results
81         rm -f regression.diffs regression.out
82         $(MAKE) -C modules $@