Browse Source

wip: make.tcl to support multiple runtime executables

master
Julian Noble 1 year ago
parent
commit
3ed0fb4a3a
  1. 28
      src/make.tcl

28
src/make.tcl

@ -361,16 +361,20 @@ if {[catch {exec sdx help} errM]} {
}
if {[llength $runtimes] > 1} {
puts stderr "Found multiple runtimes in $rtfolder ($runtimes) - unable to proceed - currently limited to one."
exit 3
}
#if {[llength $runtimes] > 1} {
# puts stderr "Found multiple runtimes in $rtfolder ($runtimes) - unable to proceed - currently limited to one."
# exit 3
#}
set vfs_folder_changes [dict create] ;#cache whether each .vfs folder has changes so we don't re-run tests if building from same .vfs with multiple runtime executables
set installername "make.tcl"
# -- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
set runtimefile [lindex $runtimes 0]
#set runtimefile [lindex $runtimes 0]
foreach runtimefile $runtimes {
#runtimefile e.g tclkit86bi.exe
#sdx *may* be pointed to use the runtime we use to build the kit, or the user may manually use this runtime if they don't have tclsh
#sdx will complain if the same runtime is used for the shell as is used in the -runtime argument - so we make a copy (REVIEW)
#if {![file exists $buildfolder/buildruntime.exe]} {
@ -384,7 +388,7 @@ set config [dict create\
lassign [punkcheck::start_installer_event $basedir/.punkcheck $installername $rtfolder $buildfolder $config] _eventid punkcheck_eventid _recordset record_list
set target_relpath [punkcheck::lib::path_relative $basedir $buildfolder/buildruntime.exe]
set target_relpath [punkcheck::lib::path_relative $basedir $buildfolder/build_$runtimefile]
set file_record [punkcheck::installfile_begin $basedir $target_relpath $installername -eventid $punkcheck_eventid]
# -- --- --- --- --- ---
set source_relpath [punkcheck::lib::path_relative $basedir $rtfolder/$runtimefile]
@ -394,14 +398,18 @@ set changed_unchanged [punkcheck::recordlist::file_install_record_source_changes
if {[llength [dict get $changed_unchanged changed]]} {
set file_record [punkcheck::installfile_started_install $basedir $file_record]
# -- --- --- --- --- ---
puts stdout "Copying runtime from $rtfolder/$runtimefile to $buildfolder/buildruntime.exe"
file copy -force $rtfolder/$runtimefile $buildfolder/buildruntime.exe
puts stdout "Copying runtime from $rtfolder/$runtimefile to $buildfolder/build_$runtimefile"
file copy -force $rtfolder/$runtimefile $buildfolder/build_$runtimefile
# -- --- --- --- --- ---
set file_record [punkcheck::installfile_finished_install $basedir $file_record]
} else {
puts stderr "."
set file_record [punkcheck::installfile_skipped_install $basedir $file_record]
}
}
# -- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
@ -540,7 +548,7 @@ foreach vfs $vfs_folders {
if {[file exists $buildfolder/$targetexe]} {
puts stderr "deleting existing $buildfolder/$targetexe"
if {[catch {
file delete $sourcefolder/_build/$targetexe
file delete $buildfolder/$targetexe
} msg]} {
puts stderr "Failed to delete $buildfolder/$targetexe"
exit 4
@ -548,7 +556,7 @@ foreach vfs $vfs_folders {
}
if {$::tcl_platform(platform) eq "windows"} {
file rename $buildfolder/$vfsname $sourcefolder/_build/${vfsname}.exe
file rename $buildfolder/$vfsname $buildfolder/${vfsname}.exe
}
after 200

Loading…
Cancel
Save