From efb126543f991101ab3703d8f659d64674a54cd2 Mon Sep 17 00:00:00 2001 From: apnadkarni Date: Thu, 3 Dec 2020 16:50:23 +0000 Subject: Add makefile.vc target sfe for single-file executable --- win/makefile.vc | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) 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. -- cgit v0.12