]> granicus.if.org Git - postgresql/blob - src/pl/tcl/Makefile
Change the way we mark tuples as frozen.
[postgresql] / src / pl / tcl / Makefile
1 #-------------------------------------------------------------------------
2 #
3 # Makefile for the pl/tcl procedural language
4 #
5 # src/pl/tcl/Makefile
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
39 OBJS = pltcl.o
40
41 DATA = pltcl.control pltcl--1.0.sql pltcl--unpackaged--1.0.sql \
42        pltclu.control pltclu--1.0.sql pltclu--unpackaged--1.0.sql
43
44 REGRESS_OPTS = --dbname=$(PL_TESTDB) --load-extension=pltcl
45 REGRESS = pltcl_setup pltcl_queries
46 # where to find psql for running the tests
47 PSQLDIR = $(bindir)
48
49 include $(top_srcdir)/src/Makefile.shlib
50
51 ifeq ($(TCL_SHARED_BUILD), 1)
52
53 all: all-lib
54         $(MAKE) -C modules $@
55
56
57 install: all install-lib install-data
58         $(MAKE) -C modules $@
59
60 installdirs: installdirs-lib
61         $(MKDIR_P) '$(DESTDIR)$(datadir)/extension'
62         $(MAKE) -C modules $@
63
64 uninstall: uninstall-lib uninstall-data
65         $(MAKE) -C modules $@
66
67 install-data: installdirs
68         $(INSTALL_DATA) $(addprefix $(srcdir)/, $(DATA)) '$(DESTDIR)$(datadir)/extension/'
69
70 uninstall-data:
71         rm -f $(addprefix '$(DESTDIR)$(datadir)/extension'/, $(notdir $(DATA)))
72
73 .PHONY: install-data uninstall-data
74
75
76 check: all submake
77         $(pg_regress_check) $(REGRESS_OPTS) $(REGRESS)
78
79 installcheck: submake
80         $(pg_regress_installcheck) $(REGRESS_OPTS) $(REGRESS)
81
82 .PHONY: submake
83 submake:
84         $(MAKE) -C $(top_builddir)/src/test/regress pg_regress$(X)
85
86 else # TCL_SHARED_BUILD = 0
87
88 # Provide dummy targets for the case where we can't build the shared library.
89 all:
90         @echo "*****"; \
91          echo "* Cannot build PL/Tcl because Tcl is not a shared library; skipping it."; \
92          echo "*****"
93
94 endif # TCL_SHARED_BUILD = 0
95
96 clean distclean maintainer-clean: clean-lib
97         rm -f $(OBJS)
98         rm -rf $(pg_regress_clean_files)
99         $(MAKE) -C modules $@