| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 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 |
|
| 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 |
|
| 36 |
|
| 37 |
|
| 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 |
| 52 |
|
| 53 |
|
| 54 |
include $(top_srcdir)/src/Makefile.shlib |
| 55 |
|
| 56 |
|
| 57 |
all: all-lib |
| 58 |
|
| 59 |
|
| 60 |
pltcl.o: pltclerrcodes.h |
| 61 |
|
| 62 |
|
| 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 |