Skip to content

Commit

Permalink
Merge 8.7
Browse files Browse the repository at this point in the history
  • Loading branch information
apnadkarni committed Oct 11, 2023
2 parents 3388de5 + 646abe6 commit 055f6b6
Showing 1 changed file with 72 additions and 21 deletions.
93 changes: 72 additions & 21 deletions win/makefile.vc
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
# or examine Sections 6-8 in rules.vc.
#
# Possible values of TARGET are:
# release -- Builds the core, the shell and the dlls. (default)
# release -- Builds everything that ships with a release. (default)
# core -- Builds the core [tclXX.(dll|lib)]
# shell -- Builds tclsh and the core.
# dlls -- Just builds the windows extensions
# shell -- Just builds the shell and the core.
# core -- Only builds the core [tclXX.(dll|lib)].
# all -- Builds everything.
# test -- Builds and runs the test suite.
# tcltest -- Just builds the test shell.
Expand Down Expand Up @@ -141,6 +141,13 @@ RCFILE = tcl.rc
# the build configuration, macros, output directories etc.
!include "rules.vc"

#
# The tclsh executable without the embedded libzip. We need this
# separately from tclsh to have dependency and build order work right.
# Ditto for the DLL and tcltest
TCLSHRAW=$(TCLSH:.exe=-raw.exe)
TCLLIBRAW=$(TCLLIB:.dll=-raw.dll)

# Tcl version info based on macros set up by rules.vc
DOTVERSION = $(TCL_MAJOR_VERSION).$(TCL_MINOR_VERSION)
VERSION = $(TCL_MAJOR_VERSION)$(TCL_MINOR_VERSION)
Expand Down Expand Up @@ -215,6 +222,7 @@ TCLDDELIBNAME = $(PROJECT)9dde$(DDEVERSION)$(SUFX:t=).$(EXT)
TCLDDELIB = $(OUT_DIR)\$(TCLDDELIBNAME)

TCLTEST = $(OUT_DIR)\$(PROJECT)test.exe
TCLTESTRAW = $(TCLTEST:.exe=-raw.exe)

TCLSHOBJS = \
$(TMP_DIR)\tclAppInit.obj \
Expand Down Expand Up @@ -474,32 +482,65 @@ TESTFLAGS = $(TESTFLAGS) -file $(TESTPAT)

#---------------------------------------------------------------------
# Project specific targets
# There are 4 primary build configurations to consider from the combination
# of static/shared and embed/noembed of the library zip. The targets are
# done in the following order.
# $(TCLLIB) - this is either the core static .lib or the .dll. The target
# build does not embed the library zip in the DLL irrespective
# of the noembed setting. A copy is made as $(TCLLIBRAW)
# as the $(TCLLIB) binary is potentially modified later.
# dlls - these are the registry and dde DLL's or static libraries
# $(TCLSH) - the Tcl shell WITHOUT any embedded zip. This needs $(TCLLIB)
# to be built first as it links against it. A copy is made
# as $(TCLSHRAW) as $(TCLSH) binary may be modified later.
# $(TCLSCRIPTZIP) - the zip file that is to be embedded. Note this also
# ships separately and needs to be built irrespective of the
# whether it is embedded or not. All above targets need to
# be built prior as they are used to build the zip (unlike
# Unix where the external zip program is used.)
# core - this virtual target builds the final release ready Tcl
# library. For shared, embedded builds it appends $(TCLSCRIPTZIP)
# to the $(TCLLIB). For other build configurations, this
# is a no-op.
# shell - this virtual target builds the final release ready tclsh shell.
# For static, embedded builds it appends $(TCLSCRIPTZIP)
# to the $(TCLSH). For other build configurations, this
# is a no-op.
# release - Everything that builds as part of a release
#---------------------------------------------------------------------

release: setup $(TCLSH) $(TCLSTUBLIB) dlls libtclzip embed pkgs
core: setup $(TCLLIB) $(TCLSTUBLIB)
shell: setup $(TCLSH)
dlls: setup $(TCLREGLIB) $(TCLDDELIB) $(OUT_DIR)\zlib1.dll $(OUT_DIR)\libtommath.dll
libtclzip: core dlls $(TCLSCRIPTZIP)
all: setup $(TCLSH) $(TCLSTUBLIB) dlls libtclzip embed pkgs
embed: setup $(TCLSH) $(TCLSTUBLIB) libtclzip
!if $(TCL_EMBED_SCRIPTS)
!if $(STATIC_BUILD)
@copy /y /b "$(TCLSH)"+"$(TCLSCRIPTZIP)" "$(TCLSH)"
!else
@copy /y /b "$(TCLLIB)"+"$(TCLSCRIPTZIP)" "$(TCLLIB)"
release: setup libtclzip core dlls shell pkgs
all: setup libtclzip core dlls shell pkgs

core: setup $(TCLLIB)
!if $(TCL_EMBED_SCRIPTS) && !$(STATIC_BUILD)
core: libtclzip
@$(COPY) /b "$(TCLLIBRAW)"+"$(TCLSCRIPTZIP)" "$(TCLLIB)"
!endif

shell: setup core $(TCLSH)
!if $(TCL_EMBED_SCRIPTS) && $(STATIC_BUILD)
shell: libtclzip
@$(COPY) /b "$(TCLSHRAW)"+"$(TCLSCRIPTZIP)" "$(TCLSH)"
!endif

dlls: setup $(TCLREGLIB) $(TCLDDELIB) $(OUT_DIR)\zlib1.dll $(OUT_DIR)\libtommath.dll
libtclzip: $(TCLSCRIPTZIP)

tcltest: setup core $(TCLTEST) dlls
!if $(TCL_EMBED_SCRIPTS) && $(STATIC_BUILD)
tcltest: libtclzip
@$(COPY) /b "$(TCLTESTRAW)"+"$(TCLSCRIPTZIP)" "$(TCLTEST)"
!endif

tcltest: setup $(TCLTEST) dlls
install: install-binaries install-libraries install-docs install-pkgs
!if $(SYMBOLS)
install: install-pdbs
!endif
setup: default-setup

test: test-core test-pkgs
test-core: setup $(TCLTEST) dlls
test-core: tcltest
set TCL_LIBRARY=$(TCL_TEST_LIBRARY)
$(DEBUGGER) $(TCLTEST) "$(ROOT:\=/)/tests/all.tcl" $(TESTFLAGS) -loadfile <<
package ifneeded dde 1.4.5 [list load "$(TCLDDELIB:\=/)"]
Expand All @@ -510,7 +551,7 @@ runtest: setup $(TCLTEST) dlls
set TCL_LIBRARY=$(TCL_TEST_LIBRARY)
$(DEBUGGER) $(TCLTEST) $(SCRIPT)

runshell: setup $(TCLSH) dlls
runshell: setup core shell dlls
set TCL_LIBRARY=$(TCL_TEST_LIBRARY)
$(DEBUGGER) $(TCLSH) $(SCRIPT)

Expand All @@ -528,6 +569,9 @@ $(TCLLIB): $(TCLOBJS)
$**
<<
$(_VC_MANIFEST_EMBED_DLL)
!if $(TCL_EMBED_SCRIPTS) && !$(STATIC_BUILD)
$(COPY) $@ $(TCLLIBRAW)
!endif

$(TCLIMPLIB): $(TCLLIB)

Expand All @@ -539,10 +583,17 @@ $(TCLSTUBLIB): $(TCLSTUBOBJS)
$(TCLSH): $(TCLSHOBJS) $(TCLSTUBLIB) $(TCLIMPLIB)
$(CONEXECMD) -stack:2300000 $**
$(_VC_MANIFEST_EMBED_EXE)
!if $(TCL_EMBED_SCRIPTS) && $(STATIC_BUILD)
$(COPY) $@ $(TCLSHRAW)
!endif


$(TCLTEST): $(TCLTESTOBJS) $(TCLSTUBLIB) $(TCLIMPLIB)
$(CONEXECMD) -stack:2300000 $**
$(_VC_MANIFEST_EMBED_EXE)
!if $(TCL_EMBED_SCRIPTS) && $(STATIC_BUILD)
$(COPY) $@ $(TCLTESTRAW)
!endif

!if $(STATIC_BUILD)
$(TCLDDELIB): $(TMP_DIR)\tclWinDde.obj
Expand Down Expand Up @@ -591,8 +642,9 @@ $(OUT_DIR)\tommath.lib: $(TOMMATHDIR)\win64\tommath.lib
$(COPY) $(TOMMATHDIR)\win64\tommath.lib $(OUT_DIR)\tommath.lib
!endif

$(TCLSCRIPTZIP): $(TCLDDELIB) $(TCLREGLIB)
@echo Building Tcl library zip file
$(TCLSCRIPTZIP): $(TCLLIB) $(TCLSH) dlls
@echo Building Tcl library zip file $(TCLSCRIPTZIP)
@set TCL_LIBRARY=$(ROOT:\=/)/library
@if exist "$(LIBTCLVFS)" $(RMDIR) "$(LIBTCLVFS)"
@$(MKDIR) "$(LIBTCLVFS)"
@$(CPYDIR) $(LIBDIR) "$(LIBTCLVFS)\tcl_library"
Expand All @@ -611,7 +663,6 @@ $(TCLSCRIPTZIP): $(TCLDDELIB) $(TCLREGLIB)
@echo zipfs mkzip {$@} {$(LIBTCLVFS)} {$(LIBTCLVFS)} >> "$(OUT_DIR)\zipper.tcl"
@cd "$(OUT_DIR)" && $(TCLSH_NATIVE) zipper.tcl


pkgs:
@for /d %d in ($(PKGSDIR)\*) do \
@if exist "%~fd\win\makefile.vc" ( \
Expand Down

0 comments on commit 055f6b6

Please sign in to comment.