1 #-------------------------------------------------------------------------
3 # Makefile for the pl/tcl procedural language
7 #-------------------------------------------------------------------------
10 top_builddir = ../../..
11 include $(top_builddir)/src/Makefile.global
14 override CPPFLAGS := $(TCL_INCLUDE_SPEC) $(CPPFLAGS)
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.
23 ifndef TCL_SHARED_BUILD
24 ifneq (,$(findstring $(DLSUFFIX),$(TCL_LIB_FILE)))
32 SHLIB_LINK = $(TCL_LIB_SPEC)
33 ifneq ($(PORTNAME), win32)
34 SHLIB_LINK += $(TCL_LIBS) -lc
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
44 REGRESS_OPTS = --dbname=$(PL_TESTDB) --load-extension=pltcl
45 REGRESS = pltcl_setup pltcl_queries
46 # where to find psql for running the tests
49 include $(top_srcdir)/src/Makefile.shlib
51 ifeq ($(TCL_SHARED_BUILD), 1)
57 install: all install-lib install-data
60 installdirs: installdirs-lib
61 $(MKDIR_P) '$(DESTDIR)$(datadir)/extension'
64 uninstall: uninstall-lib uninstall-data
67 install-data: installdirs
68 $(INSTALL_DATA) $(addprefix $(srcdir)/, $(DATA)) '$(DESTDIR)$(datadir)/extension/'
71 rm -f $(addprefix '$(DESTDIR)$(datadir)/extension'/, $(notdir $(DATA)))
73 .PHONY: install-data uninstall-data
77 $(pg_regress_check) $(REGRESS_OPTS) $(REGRESS)
80 $(pg_regress_installcheck) $(REGRESS_OPTS) $(REGRESS)
84 $(MAKE) -C $(top_builddir)/src/test/regress pg_regress$(X)
86 else # TCL_SHARED_BUILD = 0
88 # Provide dummy targets for the case where we can't build the shared library.
91 echo "* Cannot build PL/Tcl because Tcl is not a shared library; skipping it."; \
94 endif # TCL_SHARED_BUILD = 0
96 clean distclean maintainer-clean: clean-lib
98 rm -rf $(pg_regress_clean_files)