summaryrefslogtreecommitdiffstats
path: root/win/makefile.vc
diff options
context:
space:
mode:
Diffstat (limited to 'win/makefile.vc')
-rw-r--r--win/makefile.vc147
1 files changed, 123 insertions, 24 deletions
diff --git a/win/makefile.vc b/win/makefile.vc
index 3858102..6356ad9 100644
--- a/win/makefile.vc
+++ b/win/makefile.vc
@@ -20,8 +20,9 @@
# For MACRODEF, see TIP 477 (https://core.tcl-lang.org/tips/doc/main/tip/477.md)
# or examine Sections 7-9 in rules.vc. This makefile has the following
# values for the OPTS macro in addition to the ones described there.
-# noxp = If you do not have the uxtheme.h header then you
-# cannot include support for XP themeing.
+# noembed = Embeds Tcl scripts into the wish executable. Currently only
+# applicable for static builds. Non-static builds currently
+# never embed.
# square = Include the demo square widget.
#
# Possible values for TARGET are:
@@ -88,6 +89,12 @@ RCFILE = tk.rc
# the build configuration, macros, output directories etc.
!include "rules-ext.vc"
+!if ($(TCL_MAJOR_VERSION) > 8) || ($(TCL_MAJOR_VERSION) == 8 && $(TCL_MINOR_VERSION) > 6)
+USING_PRE87_TCL = 0
+!else
+USING_PRE87_TCL = 1
+!endif
+
# TCLINSTALL is set to 1 by rules.vc to indicate we are building against
# an installed Tcl and 0 if building against Tcl source. Tk needs the latter.
!if $(TCLINSTALL)
@@ -98,21 +105,33 @@ RCFILE = tk.rc
# Extra makefile options processing for non-standard OPTS values ...
!if "$(OPTS)" == "" || [nmakehlp -f "$(OPTS)" "none"]
-HAVE_UXTHEME_H = 1
TTK_SQUARE_WIDGET = 0
+TK_EMBED_SCRIPTS = 1
!else
-!if [nmakehlp -f $(OPTS) "noxp"]
-!message *** Exclude support for XP theme
-HAVE_UXTHEME_H = 0
-!else
-HAVE_UXTHEME_H = 1
-!endif
!if [nmakehlp -f "$(OPTS)" "square"]
!message *** Include ttk square demo widget
TTK_SQUARE_WIDGET = 1
!else
TTK_SQUARE_WIDGET = 0
!endif
+!if [nmakehlp -f $(OPTS) "noembed"]
+!message *** Option noembed specified. Tk script library will not be appended to the binary.
+TK_EMBED_SCRIPTS = 0
+!else
+!message *** Tk script library will be appended to the binary.
+TK_EMBED_SCRIPTS = 1
+!endif
+!endif
+
+!if $(USING_PRE87_TCL)
+TK_EMBED_SCRIPTS = 0
+!endif
+
+TK_NO_DEPRECATED = 0
+!if "$(CHECKS)" != "" && ![nmakehlp -f "$(CHECKS)" "none"]
+!if [nmakehlp -f $(CHECKS) "nodep"]
+TK_NO_DEPRECATED = 1
+!endif
!endif
WISHC = "$(OUT_DIR)\$(WISHNAMEPREFIX)c$(VERSION)$(SUFX).exe"
@@ -122,7 +141,7 @@ CAT32 = "$(OUT_DIR)\cat32.exe"
WISHOBJS = \
$(TMP_DIR)\winMain.obj \
-!if $(TCL_USE_STATIC_PACKAGES)
+!if $(STATIC_BUILD) && !$(STATIC_BUILD)
$(TCLDDELIB) \
$(TCLREGLIB) \
!endif
@@ -159,6 +178,8 @@ TKOBJS = \
$(TMP_DIR)\tkWinDraw.obj \
$(TMP_DIR)\tkWinEmbed.obj \
$(TMP_DIR)\tkWinFont.obj \
+ $(TMP_DIR)\tkWinGDI.obj \
+ $(TMP_DIR)\tkWinIco.obj \
$(TMP_DIR)\tkWinImage.obj \
$(TMP_DIR)\tkWinInit.obj \
$(TMP_DIR)\tkWinKey.obj \
@@ -169,6 +190,7 @@ TKOBJS = \
$(TMP_DIR)\tkWinScrlbr.obj \
$(TMP_DIR)\tkWinSend.obj \
$(TMP_DIR)\tkWinSendCom.obj \
+ $(TMP_DIR)\tkWinSysTray.obj \
$(TMP_DIR)\tkWinWindow.obj \
$(TMP_DIR)\tkWinWm.obj \
$(TMP_DIR)\tkWinX.obj \
@@ -207,11 +229,14 @@ TKOBJS = \
$(TMP_DIR)\tkGet.obj \
$(TMP_DIR)\tkGrab.obj \
$(TMP_DIR)\tkGrid.obj \
+ $(TMP_DIR)\tkIcu.obj \
$(TMP_DIR)\tkImage.obj \
$(TMP_DIR)\tkImgBmap.obj \
+ $(TMP_DIR)\tkImgListFormat.obj \
$(TMP_DIR)\tkImgGIF.obj \
$(TMP_DIR)\tkImgPNG.obj \
$(TMP_DIR)\tkImgPPM.obj \
+ $(TMP_DIR)\tkImgSVGnano.obj \
$(TMP_DIR)\tkImgPhoto.obj \
$(TMP_DIR)\tkImgPhInstance.obj \
$(TMP_DIR)\tkImgUtil.obj \
@@ -228,6 +253,7 @@ TKOBJS = \
$(TMP_DIR)\tkOldConfig.obj \
$(TMP_DIR)\tkOption.obj \
$(TMP_DIR)\tkPack.obj \
+ $(TMP_DIR)\tkPkgConfig.obj \
$(TMP_DIR)\tkPlace.obj \
$(TMP_DIR)\tkPointer.obj \
$(TMP_DIR)\tkRectOval.obj \
@@ -299,25 +325,30 @@ XLIBDIR = $(ROOT)\xlib
TTKDIR = $(ROOT)\generic\ttk
BITMAPDIR = $(ROOT)\bitmaps
+# Directories where to build TIP430 ZIP files
+# One for Tk - always built, contains Tk scripts
+# One for Wish - for static builds, contains Tcl+Tk scripts
+LIBTKVFS = $(OUT_DIR)\libtk.vfs
+WISHSCRIPTZIP = $(OUT_DIR)\wish.zip
+
# Additional include and C macro definitions for the implicit rules
# defined in rules.vc
PRJ_INCLUDES = -I"$(BITMAPDIR)" -I"$(XLIBDIR)"
-CONFIG_DEFS =/DSTDC_HEADERS=1 /DHAVE_SYS_TYPES_H=1 /DHAVE_SYS_STAT_H=1 \
- /DHAVE_STDLIB_H=1 /DHAVE_STRING_H=1 /DHAVE_MEMORY_H=1 \
- /DHAVE_STRINGS_H=1 \
-!if $(HAVE_UXTHEME_H)
- /DHAVE_UXTHEME_H=1 \
-!endif
+CONFIG_DEFS =/DHAVE_SYS_TYPES_H=1 /DHAVE_SYS_STAT_H=1 \
+ /DHAVE_STRING_H=1 /DHAVE_MEMORY_H=1 \
+ /DHAVE_STRINGS_H=1 /DTCL_UTF_MAX=3 \
!if $(TTK_SQUARE_WIDGET)
/DTTK_SQUARE_WIDGET=1 \
!endif
+!if $(TK_NO_DEPRECATED)
+ /DTK_NO_DEPRECATED=1
+!endif
PRJ_DEFINES = /DBUILD_ttk $(CONFIG_DEFS) /Dinline=__inline /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE
# Additional Link libraries needed beyond those in rules.vc
-PRJ_LIBS = netapi32.lib gdi32.lib user32.lib userenv.lib
-
+PRJ_LIBS = netapi32.lib gdi32.lib user32.lib userenv.lib winspool.lib shell32.lib ole32.lib uuid.lib
#---------------------------------------------------------------------
# TkTest flags
@@ -332,9 +363,26 @@ TESTFLAGS = $(TESTFLAGS) -file $(TESTPAT)
#---------------------------------------------------------------------
release: setup $(TKSTUBLIB) $(WISH)
+!if !$(USING_PRE87_TCL)
+release: libtkzip embed
+!endif
all: release $(CAT32)
core: setup $(TKSTUBLIB) $(TKLIB)
cwish: $(WISHC)
+libtkzip: setup $(TKSCRIPTZIP)
+!if $(TK_EMBED_SCRIPTS)
+!if $(STATIC_BUILD)
+embed: setup $(WISH) $(WISHSCRIPTZIP)
+ @copy /y /b "$(WISH)"+"$(WISHSCRIPTZIP)" "$(WISH)"
+!else
+embed: setup $(TKLIB) $(TKSCRIPTZIP)
+ @copy /y /b "$(TKLIB)"+"$(TKSCRIPTZIP)" "$(TKLIB)"
+!endif
+!else
+# ! TK_EMBED_SCRIPTS - still need to build the zip even if not embedded
+embed: $(TKSCRIPTZIP)
+!endif
+
install: install-binaries install-libraries install-docs
!if $(SYMBOLS)
install: install-pdbs
@@ -451,6 +499,32 @@ $(TKTEST): $(TKTESTOBJS) $(TKSTUBLIB) $(TKIMPLIB)
$(GUIEXECMD) -stack:2300000 $**
$(_VC_MANIFEST_EMBED_EXE)
+TKSCRIPTZIPTOP = tk_library
+#TKSCRIPTZIPTOP = "tk$(DOTVERSION)"
+$(TKSCRIPTZIP): .PHONY
+ @echo Building Tk library zip file
+ @if not exist "$(LIBTKVFS)" $(MKDIR) "$(LIBTKVFS)"
+ @if exist "$(LIBTKVFS)\$(TKSCRIPTZIPTOP)" $(RMDIR) "$(LIBTKVFS)\$(TKSCRIPTZIPTOP)"
+ @$(CPYDIR) $(LIBDIR) "$(LIBTKVFS)\$(TKSCRIPTZIPTOP)"
+ @$(TCLSH) <<
+cd {$(OUT_DIR)}
+file delete -force {$@}
+zipfs mkzip {$@} {$(LIBTKVFS)} {$(LIBTKVFS)}
+<<
+
+!if $(STATIC_BUILD)
+$(WISHSCRIPTZIP): $(TKSCRIPTZIP)
+ @echo Building Wish Tcl+Tk library zip file
+ @if exist "$(LIBTKVFS)\tcl_library" $(RMDIR) "$(LIBTKVFS)\tcl_library"
+ @$(TCLSH) <<
+cd {$(OUT_DIR)}
+file delete -force {$@}
+zipfs mount "$(TCLSCRIPTZIP:\=/)" mnt
+file copy [file join [zipfs root] mnt tcl_library] "$(LIBTKVFS:\=/)"
+zipfs mkzip {$@} {$(LIBTKVFS)} {$(LIBTKVFS)}
+<<
+!endif
+
$(CAT32): $(_TCLDIR)\win\cat.c
$(cc32) $(cflags) $(crt) /D_CRT_NONSTDC_NO_DEPRECATE /DCONSOLE /DUNICODE /D_UNICODE -Fo$(TMP_DIR)\ $?
@@ -529,9 +603,10 @@ install-pdbs:
# Special case object file targets
#---------------------------------------------------------------------
+# Note: Static builds now always mandate statically linking Tcl registry etc.
$(TMP_DIR)\testMain.obj: $(WIN_DIR)\winMain.c
$(cc32) $(appcflags_nostubs) /DTK_TEST /DUNICODE /D_UNICODE \
- /DTCL_USE_STATIC_PACKAGES=$(TCL_USE_STATIC_PACKAGES) \
+ /DTCL_USE_STATIC_PACKAGES=$(STATIC_BUILD) \
-Fo$@ $?
$(ROOT)\manifest.uuid:
@@ -553,14 +628,20 @@ $(TMP_DIR)\tkWinTest.obj: $(WIN_DIR)\tkWinTest.c
$(TMP_DIR)\tkSquare.obj: $(GENERICDIR)\tkSquare.c
$(cc32) $(appcflags_nostubs) -Fo$@ $?
+# Note: Static builds now always mandate statically linking Tcl registry etc.
$(TMP_DIR)\winMain.obj: $(WIN_DIR)\winMain.c
$(cc32) $(appcflags_nostubs) /DUNICODE /D_UNICODE \
- /DTCL_USE_STATIC_PACKAGES=$(TCL_USE_STATIC_PACKAGES) \
+ /DTCL_USE_STATIC_PACKAGES=$(STATIC_BUILD) \
-Fo$@ $?
$(TMP_DIR)\tkMain2.obj: $(GENERICDIR)\tkMain.c
$(cc32) $(pkgcflags) /DUNICODE /D_UNICODE -Fo$@ $?
+$(TMP_DIR)\tkPkgConfig.obj: $(GENERICDIR)\tkPkgConfig.c
+ $(cc32) $(pkgcflags) \
+ -DCFG_RUNTIME_DLLFILE="\"$(TKLIBNAME)\"" \
+ -Fo$@ $?
+
$(TMP_DIR)\tkWindow.obj: $(GENERICDIR)\tkWindow.c $(TMP_DIR)\tkUuid.h
$(cc32) $(pkgcflags) -I$(TMP_DIR) -Fo$@ $?
@@ -606,7 +687,6 @@ $(TKOBJS)
#---------------------------------------------------------------------
$(TMP_DIR)\tk.res: \
- $(RCDIR)\buttons.bmp \
$(RCDIR)\cursor*.cur \
$(RCDIR)\tk.ico
@@ -662,13 +742,22 @@ install-binaries:
!if !$(STATIC_BUILD)
@echo creating package index
@type << > $(OUT_DIR)\pkgIndex.tcl
-if {![package vsatisfies [package provide Tcl] 8.6.0]} return
+if {![package vsatisfies [package provide Tcl] 8.7-]} return
if {($$::tcl_platform(platform) eq "unix") && ([info exists ::env(DISPLAY)]
|| ([info exists ::argv] && ("-display" in $$::argv)))} {
- package ifneeded Tk $(TK_PATCH_LEVEL) [list load [file join $$dir .. .. bin libtk$(DOTVERSION).dll]]
+ if {[package vsatisfies [package provide Tcl] 9.0]} {
+ package ifneeded tk $(TK_PATCH_LEVEL) [list load [file normalize [file join $$dir .. .. bin libtcl9tk$(DOTVERSION).dll]]]
+ } else {
+ package ifneeded tk $(TK_PATCH_LEVEL) [list load [file normalize [file join $$dir .. .. bin libtk$(DOTVERSION).dll]]]
+ }
} else {
- package ifneeded Tk $(TK_PATCH_LEVEL) [list load [file join $$dir .. .. bin $(TKLIBNAME)]]
+ if {[package vsatisfies [package provide Tcl] 9.0]} {
+ package ifneeded tk $(TK_PATCH_LEVEL) [list load [file normalize [file join $$dir .. .. bin $(TKLIBNAME9)]]]
+ } else {
+ package ifneeded tk $(TK_PATCH_LEVEL) [list load [file normalize [file join $$dir .. .. bin $(TKLIBNAME8)]]]
+ }
}
+package ifneeded Tk $(TK_PATCH_LEVEL) [list package require -exact tk $(TK_PATCH_LEVEL)]
<<
@$(CPY) $(OUT_DIR)\pkgIndex.tcl "$(SCRIPT_INSTALL_DIR)\"
!endif
@@ -682,6 +771,10 @@ install-libraries:
@$(CPY) "$(GENERICDIR)\tkPlatDecls.h" "$(INCLUDE_INSTALL_DIR)\"
@$(CPY) "$(GENERICDIR)\tkIntXlibDecls.h" "$(INCLUDE_INSTALL_DIR)\"
@$(CPY) "$(XLIBDIR)\X11\*.h" "$(INCLUDE_INSTALL_DIR)\X11\"
+!if !$(USING_PRE87_TCL)
+ @$(CPY) "$(TKSCRIPTZIP)" "$(LIB_INSTALL_DIR)"
+!endif
+!if !$(TK_EMBED_SCRIPTS)
@echo installing script library
@$(CPY) "$(LIBDIR)\*" "$(SCRIPT_INSTALL_DIR)\"
@echo installing theme library
@@ -690,6 +783,7 @@ install-libraries:
@$(CPY) "$(LIBDIR)\images\*" "$(SCRIPT_INSTALL_DIR)\images\"
@echo installing language files
@$(CPY) "$(LIBDIR)\msgs\*" "$(SCRIPT_INSTALL_DIR)\msgs\"
+!endif
@echo installing demos
@$(CPY) "$(DEMODIR)\*" "$(DEMO_INSTALL_DIR)\"
@$(CPY) "$(DEMODIR)\images\*" "$(DEMO_INSTALL_DIR)\images\"
@@ -717,3 +811,8 @@ tidy:
@echo Removing $(TKSTUBLIB) ...
@if exist $(TKSTUBLIB) del $(TKSTUBLIB)
+.PHONY:
+
+# Local Variables:
+# mode: makefile
+# End: