File: makefile.vc

package info (click to toggle)
tdbcpostgres 1.1.10-3
  • links: PTS
  • area: main
  • in suites: sid
  • size: 944 kB
  • sloc: ansic: 2,870; sh: 430; tcl: 227; makefile: 68
file content (131 lines) | stat: -rw-r--r-- 4,686 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
#------------------------------------------------------------- -*- makefile -*-
#
# Makefile for TBDC Postgres interface
#
# Basic build, test and install
#   nmake /f makefile.vc INSTALLDIR=c:\path\to\installdir TCLDIR=c:\path\to\tcl\source
#   nmake /f makefile.vc INSTALLDIR=c:\path\to\installdir TCLDIR=c:\path\to\tcl\source test
#   nmake /f makefile.vc INSTALLDIR=c:\path\to\installdir TCLDIR=c:\path\to\tcl\source install
#
# For other build options (debug, static etc.),
# See TIP 477 (https://core.tcl-lang.org/tips/doc/main/tip/477.md) for
# detailed documentation.
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
#------------------------------------------------------------------------------

PROJECT = tdbcpostgres
# Tcl 8.6 etc. compile with /DUNICODE. TDBC pre-nmake reform compiled
# without -DUNICODE. Keep that behaviour for now.
USE_WIDECHAR_API  = 0

PRJ_DEFINES = $(PRJ_DEFINES)
PRJ_DEFINES = $(PRJ_DEFINES) -I$(TMP_DIR)

!include "rules-ext.vc"

# nmakehelp -V <file> <tag> will search the file for tag, skips until a
#	number and returns all character until a character not in [0-9.ab]
#	is read.
!if [echo REM = This file is generated from Makefile.vc > versions.vc]
!endif
!if [echo TCL_VERSION_REQ = \>> versions.vc] \
   && [nmakehlp -V ..\configure.ac TCL_VERSION_REQ >> versions.vc]
!endif
!include "versions.vc"

PRJ_OBJS = \
	$(TMP_DIR)\tdbcpostgres.obj \
	$(TMP_DIR)\pqStubInit.obj

# Uncomment the following line if you want to build and install stubs
# PRJ_STUBOBJS = $(TMP_DIR)\pqStubInit.obj

PRJ_HEADERS = \
	$(GENERICDIR)\fakepq.h \
	$(GENERICDIR)\pqStubs.h

# Locate TDBC headers and libraries.
# In principle, we don't need the TDBC source directory, and an installed
# TDBC should suffice. But that needs additional machinery not implemented
# yet.
!if [echo TDBC_DIR = \> nmakehlp.out] \
   || [nmakehlp -L generic\tdbcInt.h >> nmakehlp.out]
!error Could not locate TDBC source directory.
!endif
!include nmakehlp.out

# Get the TDBC version from its configure.ac
!if [echo TDBC_DOTVERSION = \> versions.vc] \
   && [nmakehlp -V "$(TDBC_DIR)\configure.ac" tdbc >> versions.vc]
!error Could not retrieve TDBC version.
!endif
!include versions.vc

TDBC_VERSION     = $(TDBC_DOTVERSION:.=)
TDBC_GENERIC_DIR = $(TDBC_DIR)\generic
!if $(TCL_MAJOR_VERSION) == 8 || "$(TCL_BUILD_FOR)" == "8"
TDBCSTUBLIBNAME	 = tdbcstub$(TDBC_VERSION).lib
TDBC_LIB_FILE	 = tdbc$(TDBC_VERSION)$(SUFX).dll
!else
TDBCSTUBLIBNAME	 = tdbcstub.lib
TDBC_LIB_FILE	 = tcl9tdbc$(TDBC_VERSION).dll
!endif
TDBCSTUBLIB 	 = $(TDBC_DIR)\win\$(BUILDDIRTOP)\$(TDBCSTUBLIBNAME)
TDBC_BIN_DIR     = $(TDBC_DIR)/win/$(BUILDDIRTOP)

PRJ_INCLUDES	= -I"$(TDBC_GENERIC_DIR)"

!if !$(STATIC_BUILD)
PRJ_LIBS  = $(TDBCSTUBLIB)
!endif

# Disable standard test target because we have a custom one
DISABLE_TARGET_test = 1
!include "$(_RULESDIR)\targets.vc"

# Additional default actions for install
install: default-install-docs-n

# The TIP 477 generation of pkgIndex.tcl from pkgIndex.tcl.in does not include
# all replacements below so define our own target.
pkgindex:   $(OUT_DIR)\pkgIndex.tcl
$(OUT_DIR)\pkgIndex.tcl: $(ROOT)\pkgIndex.tcl.in
	@nmakehlp -s << $** > $@
@PACKAGE_NAME@        $(PROJECT)
@PACKAGE_VERSION@     $(DOTVERSION)
@TCL_VERSION_REQ@     $(TCL_VERSION_REQ)
@PKG_LIB_FILE@        $(PRJLIBNAME)
@PKG_LIB_FILE8@       $(PRJLIBNAME8)
@PKG_LIB_FILE9@       $(PRJLIBNAME9)
<<

$(ROOT)\manifest.uuid:
   copy $(WIN_DIR)\gitmanifest.in $(ROOT)\manifest.uuid
   git rev-parse HEAD >>$(ROOT)\manifest.uuid

$(TMP_DIR)\tdbcPostgresUuid.h:	$(ROOT)\manifest.uuid
	copy $(WIN_DIR)\tdbcPostgresUuid.h.in+$(ROOT)\manifest.uuid $(TMP_DIR)\tdbcPostgresUuid.h

test: setup $(PROJECT)
        @set TCL_LIBRARY=$(TCL_LIBRARY:\=/)
        @set TCLLIBPATH=$(OUT_DIR:\=/)
	@set TDBC_LIBRARY=$(LIBDIR:\=/)
	@$(CPY) $(LIBDIR)\*.tcl $(OUT_DIR)
!if $(TCLINSTALL)
        @set PATH=$(_TCLDIR)\bin;$(PATH)
	$(DEBUGGER) $(TCLSH) "$(ROOT:\=/)/tests/all.tcl" $(TESTFLAGS)
!else
        @set PATH=$(_TCLDIR)\win\$(BUILDDIRTOP);$(PATH)
	$(DEBUGGER) $(TCLSH) "$(ROOT:\=/)/tests/all.tcl" $(TESTFLAGS) \
		-load "package ifneeded tdbc::postgres $(DOTVERSION) \
			{source {$(LIBDIR:\=/)/tdbcpostgres.tcl};load {$(PRJLIB:\=/)} [string totitle $(PROJECT)]};\
		package ifneeded tdbc $(TDBC_DOTVERSION) \
			{source {$(TDBC_BIN_DIR:\=/)/tdbc.tcl};load {$(TDBC_BIN_DIR:\=/)/$(TDBC_LIB_FILE)} Tdbc}"
!endif


# Explicit dependency rules
$(GENERICDIR)\tdbcpostgres.c : $(TMP_DIR)\tdbcPostgresUuid.h