summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorapnadkarni <apnmbx-wits@yahoo.com>2020-12-03 16:50:23 (GMT)
committerapnadkarni <apnmbx-wits@yahoo.com>2020-12-03 16:50:23 (GMT)
commitefb126543f991101ab3703d8f659d64674a54cd2 (patch)
tree5fc2e995031910b551ca821ee53d85c58a8b7de8
parentc30f3e95690c1fa32296fb55213cb7f03ac14345 (diff)
downloadtcl-efb126543f991101ab3703d8f659d64674a54cd2.zip
tcl-efb126543f991101ab3703d8f659d64674a54cd2.tar.gz
tcl-efb126543f991101ab3703d8f659d64674a54cd2.tar.bz2
Add makefile.vc target sfe for single-file executable
-rw-r--r--win/makefile.vc28
1 files changed, 28 insertions, 0 deletions
diff --git a/win/makefile.vc b/win/makefile.vc
index e752169..b8d3c11 100644
--- a/win/makefile.vc
+++ b/win/makefile.vc
@@ -179,6 +179,9 @@ VERSION = $(TCL_MAJOR_VERSION)$(TCL_MINOR_VERSION)
!include versions.vc
+# Single file Tclsh
+TCLSFE = $(OUT_DIR)\$(PROJECT)sfe$(VERSION).exe
+
DDEDOTVERSION = 1.4
DDEVERSION = $(DDEDOTVERSION:.=)
@@ -458,6 +461,13 @@ core: setup $(TCLLIB) $(TCLSTUBLIB)
shell: setup $(TCLSH)
dlls: setup $(TCLREGLIB) $(TCLDDELIB) $(OUT_DIR)\zlib1.dll $(OUT_DIR)\libtommath.dll
all: setup $(TCLSH) $(TCLSTUBLIB) dlls pkgs
+!if $(STATIC_BUILD) && $(TCL_USE_STATIC_PACKAGES)
+sfe: setup $(TCLSH) $(TCLSTUBLIB) $(TCLSFE)
+!else
+sfe:
+ @echo Single file executables need static build of Tcl. Specify "static" and "staticpkg" in OPTS.
+!endif
+
tcltest: setup $(TCLTEST) dlls
install: install-binaries install-libraries install-docs install-pkgs
!if $(SYMBOLS)
@@ -597,6 +607,24 @@ genstubs:
$(GENERICDIR:\=/)/tclOO.decls
!endif
+#---------------------------------------------------------------------
+# Build a single file executable version of Tcl
+#---------------------------------------------------------------------
+!if $(STATIC_BUILD) && $(TCL_USE_STATIC_PACKAGES)
+$(OUT_DIR)\tcl_library.zip:
+ @echo Building Tcl library zip file
+ @echo file delete -force tcl_library > "$(OUT_DIR)\zipper.tcl"
+ @echo file delete -force tcl_library.zip >> "$(OUT_DIR)\zipper.tcl"
+ @echo file copy ../../library tcl_library >> "$(OUT_DIR)\zipper.tcl"
+ @echo file rename tcl_library/manifest.txt tcl_library/pkgIndex.tcl >> "$(OUT_DIR)\zipper.tcl"
+ @echo zipfs mkzip {$@} tcl_library tcl_library >> "$(OUT_DIR)\zipper.tcl"
+ @cd "$(OUT_DIR)" && $(TCLSH) zipper.tcl
+
+$(TCLSFE): $(OUT_DIR)\tcl_library.zip
+ @echo Building single-file exe from $(TCLSH) and $(OUT_DIR)\tcl_library.zip
+ @copy /y /b "$(TCLSH)"+"$(OUT_DIR)\tcl_library.zip" "$@"
+!endif
+
#---------------------------------------------------------------------
# Build the Windows HTML help file.