1 #------------------------------------------------------------- -*- makefile -*-
\r
3 # Makefile for TBDC Postgres interface
\r
5 # Basic build, test and install
\r
6 # nmake /s /nologo /f makefile.vc INSTALLDIR=c:\path\to\installdir TCLDIR=c:\path\to\tcl\source
\r
7 # nmake /s /nologo /f makefile.vc INSTALLDIR=c:\path\to\installdir TCLDIR=c:\path\to\tcl\source test
\r
8 # nmake /s /nologo /f makefile.vc INSTALLDIR=c:\path\to\installdir TCLDIR=c:\path\to\tcl\source install
\r
10 # For other build options (debug, static etc.)
\r
11 # See TIP 477 (https://core.tcl-lang.org/tips/doc/trunk/tip/477.md) for
\r
12 # detailed documentation.
\r
14 # See the file "license.terms" for information on usage and redistribution
\r
15 # of this file, and for a DISCLAIMER OF ALL WARRANTIES.
\r
17 #------------------------------------------------------------------------------
\r
19 PROJECT = tdbcpostgres
\r
20 # Tcl 8.6 etc. compile with /DUNICODE. TDBC pre-nmake reform compiled
\r
21 # without -DUNICODE. Keep that behaviour.
\r
22 USE_WIDECHAR_API = 0
\r
24 !include "rules-ext.vc"
\r
26 # nmakehelp -V <file> <tag> will search the file for tag, skips until a
\r
27 # number and returns all character until a character not in [0-9.ab]
\r
29 !if [echo REM = This file is generated from Makefile.vc > versions.vc]
\r
31 !if [echo TCL_VERSION_REQ = \>> versions.vc] \
\r
32 && [nmakehlp -V ..\configure.ac TCL_VERSION_REQ >> versions.vc]
\r
34 !include "versions.vc"
\r
37 $(TMP_DIR)\tdbcpostgres.obj \
\r
38 $(TMP_DIR)\pqStubInit.obj
\r
40 # Uncomment the following line if you want to build and install stubs
\r
41 # PRJ_STUBOBJS = $(TMP_DIR)\pqStubInit.obj
\r
44 $(GENERICDIR)\fakepq.h \
\r
45 $(GENERICDIR)\pqStubs.h
\r
47 # Locate TDBC headers and libraries.
\r
48 # In principle, we don't need the TDBC source directory, and an installed
\r
49 # TDBC should suffice. But that needs additional machinery not implemented
\r
51 !if [echo TDBC_DIR = \> nmakehlp.out] \
\r
52 || [nmakehlp -L generic\tdbcInt.h >> nmakehlp.out]
\r
53 !error Could not locate TDBC source directory.
\r
55 !include nmakehlp.out
\r
57 # Get the TDBC version from its configure.ac
\r
58 !if [echo TDBC_DOTVERSION = \> versions.vc] \
\r
59 && [nmakehlp -V "$(TDBC_DIR)\configure.ac" tdbc >> versions.vc]
\r
60 !error Could not retrieve TDBC version.
\r
62 !include versions.vc
\r
64 TDBC_VERSION = $(TDBC_DOTVERSION:.=)
\r
65 TDBC_GENERIC_DIR = $(TDBC_DIR)\generic
\r
66 TDBCSTUBLIBNAME = tdbcstub$(TDBC_VERSION).lib
\r
67 TDBCSTUBLIB = $(TDBC_DIR)\win\$(BUILDDIRTOP)\$(TDBCSTUBLIBNAME)
\r
68 TDBC_LIB_FILE = tdbc$(TDBC_VERSION).dll
\r
69 TDBC_BIN_DIR = $(TDBC_DIR)/win/$(BUILDDIRTOP)
\r
71 PRJ_INCLUDES = -I"$(TDBC_GENERIC_DIR)"
\r
73 !if !$(STATIC_BUILD)
\r
74 PRJ_LIBS = $(TDBCSTUBLIB)
\r
77 # Disable standard test target because we have a custom one
\r
78 DISABLE_TARGET_test = 1
\r
79 !include "$(_RULESDIR)\targets.vc"
\r
81 # Additional default actions for install
\r
82 install: default-install-docs-n
\r
84 # The TIP 477 generation of pkgIndex.tcl from pkgIndex.tcl.in does not include
\r
85 # all replacements below so define our own target.
\r
86 pkgindex: $(OUT_DIR)\pkgIndex.tcl
\r
87 $(OUT_DIR)\pkgIndex.tcl: $(ROOT)\pkgIndex.tcl.in
\r
88 @nmakehlp -s << $** > $@
\r
89 @PACKAGE_NAME@ $(PROJECT)
\r
90 @PACKAGE_VERSION@ $(DOTVERSION)
\r
91 @TCL_VERSION_REQ@ $(TCL_VERSION_REQ)
\r
92 @PKG_LIB_FILE@ $(PRJLIBNAME)
\r
93 @PKG_LIB_FILE8@ $(PRJLIBNAME8)
\r
94 @PKG_LIB_FILE9@ $(PRJLIBNAME9)
\r
97 test: setup $(PROJECT)
\r
98 @set TCL_LIBRARY=$(TCL_LIBRARY:\=/)
\r
99 @set TCLLIBPATH=$(OUT_DIR:\=/)
\r
100 @set TDBC_LIBRARY=$(LIBDIR:\=/)
\r
101 @$(CPY) $(LIBDIR)\*.tcl $(OUT_DIR)
\r
103 @set PATH=$(_TCLDIR)\bin;$(PATH)
\r
104 $(DEBUGGER) $(TCLSH) "$(ROOT:\=/)/tests/all.tcl" $(TESTFLAGS)
\r
106 @set PATH=$(_TCLDIR)\win\$(BUILDDIRTOP);$(PATH)
\r
107 $(DEBUGGER) $(TCLSH) "$(ROOT:\=/)/tests/all.tcl" $(TESTFLAGS) \
\r
108 -load "package ifneeded tdbc::postgres $(DOTVERSION) \
\r
109 {source {$(LIBDIR:\=/)/tdbcpostgres.tcl};load {$(PRJLIB:\=/)} $(PROJECT)};\
\r
110 package ifneeded tdbc $(TDBC_DOTVERSION) \
\r
111 {source {$(TDBC_BIN_DIR:\=/)/tdbc.tcl};load {$(TDBC_BIN_DIR:\=/)/$(TDBC_LIB_FILE)} tdbc}"
\r