summaryrefslogtreecommitdiffstats
path: root/win/makefile.vc
diff options
context:
space:
mode:
Diffstat (limited to 'win/makefile.vc')
-rw-r--r--win/makefile.vc113
1 files changed, 49 insertions, 64 deletions
diff --git a/win/makefile.vc b/win/makefile.vc
index e413fd5..adfcc13 100644
--- a/win/makefile.vc
+++ b/win/makefile.vc
@@ -12,7 +12,7 @@
# Copyright (c) 2001-2004 David Gravereaux.
#
#------------------------------------------------------------------------------
-# RCS: @(#) $Id: makefile.vc,v 1.107 2007/09/18 16:12:19 dgp Exp $
+# RCS: @(#) $Id: makefile.vc,v 1.108 2007/10/12 14:14:54 patthoyts Exp $
#------------------------------------------------------------------------------
# Check to see we are configured to build with MSVC (MSDEVDIR or MSVCDIR)
@@ -184,19 +184,26 @@ PROJECT = tk
!message *** Tcl sources.
!endif
-STUBPREFIX = $(PROJECT)stub
-!if [nmakehlp -g ../generic/tk.h TK_VERSION] == 85
-DOTVERSION = 8.5
-!elseif [nmakehlp -g ../generic/tk.h TK_VERSION] == 86
-DOTVERSION = 8.6
-!elseif [nmakehlp -g ../generic/tk.h TK_VERSION] == 90
-DOTVERSION = 9.0
-!elseif [nmakehlp -g ../generic/tk.h TK_VERSION] == 0
-MSG =^
-Cannot get version string from ../generic/tk.h
-!error $(MSG)
+# Extra makefile options processing...
+!if "$(OPTS)" == "" || [nmakehlp -f "$(OPTS)" "none"]
+HAVE_UXTHEME = 1
+TTK_SQUARE_WIDGET = 0
+!else
+!if [nmakehlp -f $(OPTS) "noxp"]
+!message *** Exclude support for XP theme
+HAVE_UXTHEME_H = 0
+!else
+HAVE_UXTHEME_H = 1
!endif
-VERSION = $(DOTVERSION:.=)
+!if [nmakehlp -f "$(OPTS)" "square"]
+!message *** Include ttk square demo widget
+TTK_SQUARE_WIDGET = 1
+!else
+TTK_SQUARE_WIDGET = 0
+!endif
+!endif
+
+STUBPREFIX = $(PROJECT)stub
WISHNAMEPREFIX = wish
BINROOT = .
@@ -204,15 +211,15 @@ ROOT = ..
TK_LIBRARY = $(ROOT)\library
-TKIMPLIB = "$(OUT_DIR)\$(PROJECT)$(VERSION)$(SUFX).lib"
-TKLIBNAME = $(PROJECT)$(VERSION)$(SUFX).$(EXT)
+TKIMPLIB = "$(OUT_DIR)\$(PROJECT)$(TK_VERSION)$(SUFX).lib"
+TKLIBNAME = $(PROJECT)$(TK_VERSION)$(SUFX).$(EXT)
TKLIB = "$(OUT_DIR)\$(TKLIBNAME)"
-TKSTUBLIBNAME = $(STUBPREFIX)$(VERSION).lib
+TKSTUBLIBNAME = $(STUBPREFIX)$(TK_VERSION).lib
TKSTUBLIB = "$(OUT_DIR)\$(TKSTUBLIBNAME)"
-WISH = "$(OUT_DIR)\$(WISHNAMEPREFIX)$(VERSION)$(SUFX).exe"
-WISHC = "$(OUT_DIR)\$(WISHNAMEPREFIX)c$(VERSION)$(SUFX).exe"
+WISH = "$(OUT_DIR)\$(WISHNAMEPREFIX)$(TK_VERSION)$(SUFX).exe"
+WISHC = "$(OUT_DIR)\$(WISHNAMEPREFIX)c$(TK_VERSION)$(SUFX).exe"
TKTEST = "$(OUT_DIR)\$(PROJECT)test.exe"
CAT32 = "$(OUT_DIR)\cat32.exe"
@@ -220,7 +227,7 @@ CAT32 = "$(OUT_DIR)\cat32.exe"
LIB_INSTALL_DIR = $(_INSTALLDIR)\lib
BIN_INSTALL_DIR = $(_INSTALLDIR)\bin
DOC_INSTALL_DIR = $(_INSTALLDIR)\doc
-SCRIPT_INSTALL_DIR = $(_INSTALLDIR)\lib\$(PROJECT)$(DOTVERSION)
+SCRIPT_INSTALL_DIR = $(_INSTALLDIR)\lib\$(PROJECT)$(TK_DOTVERSION)
INCLUDE_INSTALL_DIR = $(_INSTALLDIR)\include
WISHOBJS = \
@@ -416,13 +423,12 @@ CONFIG_DEFS =-DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 \
!if $(HAVE_UXTHEME_H)
-DHAVE_UXTHEME_H=1 \
!endif
-!if [nmakehlp -f "$(OPTS)" "square"]
+!if $(TTK_SQUARE_WIDGET)
-DTTK_SQUARE_WIDGET=1 \
!endif
TK_DEFINES =-DBUILD_ttk $(OPTDEFINES) $(CONFIG_DEFS)
-
#---------------------------------------------------------------------
# Compile flags
#---------------------------------------------------------------------
@@ -435,23 +441,17 @@ cdebug = $(OPTIMIZATIONS)
!else
cdebug =
!endif
-!else if "$(MACHINE)" == "IA64"
+!else if "$(MACHINE)" == "IA64" || "$(MACHINE)" == "AMD64"
### Warnings are too many, can't support warnings into errors.
-cdebug = -Z7 -Od $(DEBUGFLAGS)
+cdebug = -Zi -Od $(DEBUGFLAGS)
!else
-cdebug = -Z7 -WX $(DEBUGFLAGS)
+cdebug = -Zi -WX $(DEBUGFLAGS)
!endif
### Declarations common to all compiler options
-cwarn = -D _CRT_SECURE_NO_DEPRECATE -D _CRT_NONSTDC_NO_DEPRECATE
+cwarn = $(WARNINGS) -D _CRT_SECURE_NO_DEPRECATE -D _CRT_NONSTDC_NO_DEPRECATE
cflags = -nologo -c $(COMPILERFLAGS) $(cwarn) -Fp$(TMP_DIR)^\
-!if $(FULLWARNINGS)
-cflags = $(cflags) -W4
-!else
-cflags = $(cflags) -W3
-!endif
-
!if $(MSVCRT)
!if $(DEBUG) && !$(UNCHECKED)
crt = -MDd
@@ -486,10 +486,6 @@ ldebug = -release -opt:ref -opt:icf,3
### Declarations common to all linker options
lflags = -nologo -machine:$(MACHINE) $(LINKERFLAGS) $(ldebug)
-!if $(FULLWARNINGS)
-lflags = $(lflags) -warn:3
-!endif
-
!if $(PROFILE)
lflags = $(lflags) -profile
!endif
@@ -680,7 +676,7 @@ $(TKOBJS)
# Regenerate the windows help files.
#---------------------------------------------------------------------
-HLPBASE = $(PROJECT)$(VERSION)
+HLPBASE = $(PROJECT)$(TK_VERSION)
HELPFILE = $(OUT_DIR)\$(HLPBASE).hlp
HELPCNT = $(OUT_DIR)\$(HLPBASE).cnt
DOCTMP_DIR = $(OUT_DIR)\$(PROJECT)_docs
@@ -737,7 +733,7 @@ $(MAN2TCL): $(TCLTOOLSDIR)\$$(@B).c
$(_VC_MANIFEST_EMBED_EXE)
$(HELPRTF): $(MAN2TCL) $(MAN2HELP) $(MAN2HELP2) $(INDEX)
- $(TCLSH) $(MAN2HELP) -bitmap $(BMP_NOPATH) $(PROJECT) $(VERSION) $(DOCDIR:\=/)
+ $(TCLSH) $(MAN2HELP) -bitmap $(BMP_NOPATH) $(PROJECT) $(TK_VERSION) $(DOCDIR:\=/)
install-docs:
!if exist($(HELPFILE))
@@ -745,25 +741,25 @@ install-docs:
$(CPY) "$(HELPCNT)" "$(DOC_INSTALL_DIR)\"
$(TCLSH) <<
puts "Installing $(PROJECT)'s helpfile contents into Tcl's ..."
-set f [open "$(DOC_INSTALL_DIR:\=/)/tcl$(VERSION).cnt" r]
+set f [open "$(DOC_INSTALL_DIR:\=/)/tcl$(TK_VERSION).cnt" r]
while {![eof $$f]} {
if {[regexp {:Include $(PROJECT)([0-9]{2}).cnt} [gets $$f] dummy ver]} {
- if {$$ver == $(VERSION)} {
+ if {$$ver == $(TK_VERSION)} {
puts "Already installed."
exit
} else {
# do something here logical to remove (or replace) it.
- puts "$$ver != $(VERSION), unfinished code path, die, die!"
+ puts "$$ver != $(TK_VERSION), unfinished code path, die, die!"
exit 1
}
}
}
close $$f
-set f [open "$(DOC_INSTALL_DIR:\=/)/tcl$(VERSION).cnt" a]
+set f [open "$(DOC_INSTALL_DIR:\=/)/tcl$(TK_VERSION).cnt" a]
puts $$f {:Include $(HLPBASE).cnt}
close $$f
<<
- start /wait winhlp32 -g $(DOC_INSTALL_DIR)\tcl$(VERSION).hlp
+ start /wait winhlp32 -g $(DOC_INSTALL_DIR)\tcl$(TK_VERSION).hlp
!endif
#---------------------------------------------------------------------
@@ -805,27 +801,10 @@ $(TMP_DIR)\tkStubLib.obj : $(GENERICDIR)\tkStubLib.c
#---------------------------------------------------------------------
$(TMP_DIR)\wish.exe.manifest: $(WINDIR)\wish.exe.manifest.in
-!if ![sed "1d" < NUL > NUL]
- sed -f << $** > $@
-s/@MACHINE@/$(MACHINE:IX86=X86)/
-s/@TK_WIN_VERSION@/$(DOTVERSION).0.0/
+ @nmakehlp -s << $** >$@
+@MACHINE@ $(MACHINE:IX86=X86)
+@TK_WIN_VERSION@ $(TK_MAJOR_VERSION).$(TK_MINOR_VERSION).0.0
<<
-!else
- $(TCLSH) <<
-set f [open {$(WINDIR:\=/)/wish.exe.manifest.in} r]
-set data [read $$f]
-close $$f
-set mach {$(MACHINE)}
-if {[regexp -nocase {$(IX86)$$} $mach ]} {set mach X86}
-set winver "$(DOTVERSION).0.0"
-set data [string map [list @MACHINE@ $$mach @TK_WIN_VERSION@ $$winver] $$data]
-puts {Creating $(TMP_DIR:\=/)/wish.exe.manifest}
-set f [open {$(TMP_DIR:\=/)/wish.exe.manifest} w]
-puts -nonewline $$f $$data
-close $$f
-exit
-<<
-!endif
$(TMP_DIR)\tk.res: \
$(RCDIR)\buttons.bmp \
@@ -963,8 +942,8 @@ install-binaries:
!if !$(STATIC_BUILD)
@echo creating package index
@type << > $(OUT_DIR)\pkgIndex.tcl
-if {[catch {package present Tcl $(TCL_DOTVERSION)$(TCL_PATCHLEVEL)}]} { return }
-package ifneeded Tk $(DOTVERSION)$(TCL_PATCHLEVEL) [list load [file join $$dir .. .. bin $(TKLIBNAME)] Tk]
+if {[package vcompare [package provide Tcl] $(TCL_PATCH_LEVEL)] != 0} { return }
+package ifneeded Tk $(TK_PATCH_LEVEL) [list load [file join $$dir .. .. bin $(TKLIBNAME)] Tk]
<<
@$(CPY) $(OUT_DIR)\pkgIndex.tcl "$(SCRIPT_INSTALL_DIR)\"
!endif
@@ -1019,6 +998,12 @@ clean:
@if exist $(WINDIR)\nmakehlp.exe del $(WINDIR)\nmakehlp.exe
@echo Cleaning $(WINDIR)\_junk.pch ...
@if exist $(WINDIR)\_junk.pch del $(WINDIR)\_junk.pch
+ @echo Cleaning $(WINDIR)\vercl.x ...
+ @if exist $(WINDIR)\vercl.x del $(WINDIR)\vercl.x
+ @echo Cleaning $(WINDIR)\vercl.i ...
+ @if exist $(WINDIR)\vercl.i del $(WINDIR)\vercl.i
+ @echo Cleaning $(WINDIR)\versions.vc ...
+ @if exist $(WINDIR)\versions.vc del $(WINDIR)\versions.vc
hose:
@echo Hosing $(OUT_DIR)\* ...