!ifndef VERSION
!message *** You must specify the Tcl version. Set VERSION=84 or 85
-!message *** You may also specify SYMBOLS=0|1
+!message *** You may also specify SYMBOLS=0|1 UPX=0|1
!error
!else
V=$(VERSION)
SYMBOLS=0
!endif
+!ifndef UPX
+!if ![upx -V > NUL]
+!message *** Enabling upx compression of executables
+UPX=1
+!else
+!message *** Disabling upx compression of executables
+UPX=0
+!endif
+!endif
+
MAKE = $(MAKE) -nologo
CPY = xcopy /i /y >NUL
COPY = copy /y >NUL
OPTS = $(OPTS),symbols
CFLAGS = -MDd -Od -Zi -D_DEBUG $(CFLAGS)
LDFLAGS = -debug
+UPXCOMP =
!else
CFLAGS = -MD -O2 -DNDEBUG $(CFLAGS)
LDFLAGS = -release
+!if $(UPX)
+UPXCOMP = upx -q9 $@ >NUL
+!endif
+!endif
+
+#-------------------------------------------------------------------------
+# MSVC8 (ships with Visual Studio 2005) generates a manifest
+# file that we should link into the binaries. This is how.
+#-------------------------------------------------------------------------
+
+_VC_MANIFEST_EMBED_EXE=
+_VC_MANIFEST_EMBED_DLL=
+VCVER=0
+!if ![echo VCVERSION=_MSC_VER > vercl.x] \
+ && ![cl -nologo -TC -P vercl.x $(ERRNULL)]
+!include vercl.i
+!if $(VCVERSION) >= 1400
+VCVER=8
+_VC_MANIFEST_EMBED_EXE=if exist $@.manifest mt -nologo -manifest $@.manifest -outputresource:$@;1
+_VC_MANIFEST_EMBED_DLL=if exist $@.manifest mt -nologo -manifest $@.manifest -outputresource:$@;2
+!elseif $(VCVERSION) >= 1300
+VCVER=7
+!elseif $(VCVERSION) >= 1200
+VCVER=6
+!endif
!endif
+#-------------------------------------------------------------------------
+
CLIOBJS = $(BUILD)\pwb.obj $(BUILD)\rechan.obj \
- $(BUILD)\zlib.obj $(BUILD)\tclAppInit.obj
+ $(BUILD)\zlib.obj $(BUILD)\tclAppInit.obj $(BUILD)\tclkitsh.res
GUIOBJS = $(BUILD)\pwb.obj $(BUILD)\rechan.obj \
$(BUILD)\zlib.obj $(BUILD)\winMain.obj $(BUILD)\tclkit.res
tclkit-cli.exe: kit-cli.exe tidy
@$(COPY) kit-cli.exe $@
- -@upx -q9 $@ >NUL
+ -@$(UPXCOMP)
kit-cli.exe -init- ../../setupvfs.tcl $(KITOPTS) $@ cli
tclkit-gui.exe: kit-gui.exe tidy
@$(COPY) kit-gui.exe $@
- -@upx -q9 $@ >NUL
+ -@$(UPXCOMP)
kit-cli.exe -init- ../../setupvfs.tcl $(KITOPTS) $@ gui
kit-cli.exe: setup tcl $(PARTS) files $(CLIOBJS)
$(BUILD)\lib\tcl$V*.lib \
$(BUILD)\lib\tcldde1*.lib \
$(BUILD)\lib\tclreg1*.lib $(LIBS)
+ $(_VC_MANIFEST_EMBED_EXE)
kit-gui.exe: setup tcl tk $(PARTS) files $(GUIOBJS)
@$(CC) $(CFLAGS) -I$(BUILD)/include -DKIT_LITE -DKIT_INCLUDES_TK \
$(BUILD)\lib\tk$V*.lib \
$(BUILD)\lib\tcldde1*.lib \
$(BUILD)\lib\tclreg1*.lib $(LIBS)
+ $(_VC_MANIFEST_EMBED_EXE)
tcl: $(BUILD)\lib\tcl$V$X.lib
$(BUILD)\lib\tcl$V$X.lib:
-I..\tcl\generic -I..\tcl\win -I..\tk\generic -I..\tk\win \
-DTK_LOCAL_APPINIT=TclKit_AppInit -Fo$@ -c $**
+$(BUILD)\tclkitsh.res: ..\..\tclkit.rc
+ $(RC) -fo $@ -r -d STATIC_BUILD=1 -i $(BUILD)\include \
+ -i $(BUILD)\files -i ..\tcl\win\rc $**
+
$(BUILD)\tclkit.res: ..\..\tclkit.rc
$(COPY) $** $(BUILD)\tk\tclkit.rc
- $(RC) -fo $@ -r -d STATIC_BUILD=1 -i $(BUILD)\include \
- -i $(BUILD)\tk -i $(BUILD)\files -i ..\tk\win\rc \
- $(BUILD)\tk\tclkit.rc
+ $(RC) -fo $@ -r -d STATIC_BUILD=1 -d BASE_NO_TK_ICON=1 \
+ -d TCLKIT_WITH_TK -i $(BUILD)\include -i $(BUILD)\tk \
+ -i $(BUILD)\files -i ..\tk\win\rc $(BUILD)\tk\tclkit.rc
.PHONY: setup files tidy clean
@if exist kit-cli.lib del kit-cli.lib
@if exist kit-gui.exp del kit-gui.exp
@if exist kit-gui.lib del kit-gui.lib
+ @if exist vercl.i del vercl.i
+ @if exist vercl.x del vercl.x
clean: tidy
@if exist build\nul $(RMDIR) build
-// RCS: @(#) $Id: tclkit.rc,v 1.2 2006/01/12 09:00:23 jcw Exp $
-//
-// Version Resource Script
-//
-
-#include <windows.h>
+/* RCS: @(#) $Id: tclkit.rc,v 1.2 2006/01/12 09:00:23 jcw Exp $
+ *
+ * Version Resource Script
+ *
+ */
#define RESOURCE_INCLUDED
+
+#include <winver.h>
+#include <tcl.h>
+
+#ifdef TCLKIT_WITH_TK
#include <tk.h>
+#endif
#define STRINGIFY1(x) #x
#define STRINGIFY(x) STRINGIFY1(x)
-//
-// build-up the name suffix that defines the type of build this is.
-//
+/*
+ * build-up the name suffix that defines the type of build this is.
+ */
+
#ifdef TCL_THREADS
#define SUFFIX_THREADS "t"
#else
#define SUFFIX_THREADS ""
#endif
+#if STATIC_BUILD
+#define SUFFIX_STATIC "s"
+#else
+#define SUFFIX_STATIC ""
+#endif
+
#ifdef DEBUG
-#define SUFFIX_DEBUG "d"
+#define SUFFIX_DEBUG "g"
#else
#define SUFFIX_DEBUG ""
#endif
-#define SUFFIX SUFFIX_THREADS SUFFIX_DEBUG
+#define SUFFIX SUFFIX_THREADS SUFFIX_STATIC SUFFIX_DEBUG
+LANGUAGE 0x9, 0x1 /* LANG_ENGLISH, SUBLANG_DEFAULT */
+
VS_VERSION_INFO VERSIONINFO
+#ifdef TCLKIT_WITH_TK
FILEVERSION TK_MAJOR_VERSION,TK_MINOR_VERSION,TK_RELEASE_LEVEL,TK_RELEASE_SERIAL
PRODUCTVERSION TK_MAJOR_VERSION,TK_MINOR_VERSION,TK_RELEASE_LEVEL,TK_RELEASE_SERIAL
+#else
+ FILEVERSION TCL_MAJOR_VERSION,TCL_MINOR_VERSION,TCL_RELEASE_LEVEL,TCL_RELEASE_SERIAL
+ PRODUCTVERSION TCL_MAJOR_VERSION,TCL_MINOR_VERSION,TCL_RELEASE_LEVEL,TCL_RELEASE_SERIAL
+#endif
FILEFLAGSMASK 0x3fL
#ifdef DEBUG
FILEFLAGS VS_FF_DEBUG
BLOCK "040904b0"
BEGIN
VALUE "FileDescription", "Tclkit, a standalone runtime for Tcl/Tk\0"
- VALUE "OriginalFilename", "tclkit.exe\0"
+ VALUE "OriginalFilename", "tclkit-gui.exe\0"
VALUE "CompanyName", "Equi4 Software\0"
- VALUE "FileVersion", TK_PATCH_LEVEL
VALUE "LegalCopyright", "Copyright \251 1989-2003 by J.Ousterhout et al.\0"
+#ifdef TCLKIT_WITH_TK
+ VALUE "FileVersion", TK_PATCH_LEVEL
VALUE "ProductName", "Tclkit " TK_VERSION " for Windows\0"
VALUE "ProductVersion", TK_PATCH_LEVEL
+#else
+ VALUE "FileVersion", TCL_PATCH_LEVEL
+ VALUE "ProductName", "Tclkit " TCL_VERSION " for Windows\0"
+ VALUE "ProductVersion", TCL_PATCH_LEVEL
+#endif
END
END
BLOCK "VarFileInfo"
END
END
-//
-// Include the base resources.
-//
+/*
+ * Icon
+ */
+
+tk ICON DISCARDABLE "tclkit.ico"
+
+#ifdef TCLKIT_WITH_TK
+/*
+ * Include the base resources.
+ */
#include "tk_base.rc"
-//
-// This enables themed scrollbars in XP by trying to use comctl32 v6.
-//
+/*
+ * This enables themed scrollbars in XP by trying to use comctl32 v6.
+ */
#ifndef RT_MANIFEST
#define RT_MANIFEST 24
#define CREATEPROCESS_MANIFEST_RESOURCE_ID 1
#endif
CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "wish.exe.manifest"
+
+#endif