Debian Codegraph @

src/pl/tcl/Makefile

raw symbols SCIP
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 := -I. -I$(srcdir) $(CPPFLAGS) $(TCL_INCLUDE_SPEC)
15
16 # On Windows, we don't link directly with the Tcl library; see below
17 ifneq ($(PORTNAME), win32)
18 SHLIB_LINK = $(TCL_LIB_SPEC) $(TCL_LIBS)
19 endif
20
21 PGFILEDESC = "PL/Tcl - procedural language"
22
23 NAME = pltcl
24
25 OBJS = \
26 $(WIN32RES) \
27 pltcl.o
28
29 DATA = pltcl.control pltcl--1.0.sql \
30 pltclu.control pltclu--1.0.sql
31
32 REGRESS_OPTS = --dbname=$(PL_TESTDB) --load-extension=pltcl
33 REGRESS = pltcl_setup pltcl_queries pltcl_trigger pltcl_call pltcl_start_proc pltcl_subxact pltcl_unicode pltcl_transaction
34
35 # Tcl on win32 ships with import libraries only for Microsoft Visual C++,
36 # which are not compatible with mingw gcc. Therefore we need to build a
37 # new import library to link with.
38 ifeq ($(PORTNAME), win32)
39
40 tclwithver = $(subst -l,,$(filter -l%, $(TCL_LIB_SPEC)))
41 TCLDLL = $(dir $(TCLSH))/$(tclwithver).dll
42
43 OBJS += lib$(tclwithver).a
44
45 lib$(tclwithver).a: $(tclwithver).def
46 dlltool --dllname $(tclwithver).dll --def $(tclwithver).def --output-lib lib$(tclwithver).a
47
48 $(tclwithver).def: $(TCLDLL)
49 gendef - $^ > $@
50
51 endif # win32
52
53
54 include $(top_srcdir)/src/Makefile.shlib
55
56
57 all: all-lib
58
59 # Force this dependency to be known even without dependency info built:
60 pltcl.o: pltclerrcodes.h
61
62 # generate pltclerrcodes.h from src/backend/utils/errcodes.txt
63 pltclerrcodes.h: $(top_srcdir)/src/backend/utils/errcodes.txt generate-pltclerrcodes.pl
64 $(PERL) $(srcdir)/generate-pltclerrcodes.pl $< > $@
65
66 install: all install-lib install-data
67
68 installdirs: installdirs-lib
69 $(MKDIR_P) '$(DESTDIR)$(datadir)/extension'
70
71 uninstall: uninstall-lib uninstall-data
72
73 install-data: installdirs
74 $(INSTALL_DATA) $(addprefix $(srcdir)/, $(DATA)) '$(DESTDIR)$(datadir)/extension/'
75
76 uninstall-data:
77 rm -f $(addprefix '$(DESTDIR)$(datadir)/extension'/, $(notdir $(DATA)))
78
79 .PHONY: install-data uninstall-data
80
81
82 check: submake
83 $(pg_regress_check) $(REGRESS_OPTS) $(REGRESS)
84
85 installcheck: submake
86 $(pg_regress_installcheck) $(REGRESS_OPTS) $(REGRESS)
87
88 .PHONY: submake
89 submake:
90 $(MAKE) -C $(top_builddir)/src/test/regress pg_regress$(X)
91
92 clean distclean: clean-lib
93 rm -f $(OBJS)
94 rm -rf $(pg_regress_clean_files)
95 ifeq ($(PORTNAME), win32)
96 rm -f $(tclwithver).def
97 endif
98 rm -f pltclerrcodes.h