Browse Source

wip: make.tcl to support multiple runtime executables

master
Julian Noble 11 months ago
parent
commit
3ed0fb4a3a
  1. 66
      src/make.tcl

66
src/make.tcl

@ -361,47 +361,55 @@ if {[catch {exec sdx help} errM]} {
} }
if {[llength $runtimes] > 1} { #if {[llength $runtimes] > 1} {
puts stderr "Found multiple runtimes in $rtfolder ($runtimes) - unable to proceed - currently limited to one." # puts stderr "Found multiple runtimes in $rtfolder ($runtimes) - unable to proceed - currently limited to one."
exit 3 # 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 installername "make.tcl"
# -- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- # -- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
set runtimefile [lindex $runtimes 0] #set runtimefile [lindex $runtimes 0]
#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 foreach runtimefile $runtimes {
#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) #runtimefile e.g tclkit86bi.exe
#if {![file exists $buildfolder/buildruntime.exe]} {
# file copy $rtfolder/$runtimefile $buildfolder/buildruntime.exe
#}
set basedir $buildfolder #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
set config [dict create\ #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]} {
# file copy $rtfolder/$runtimefile $buildfolder/buildruntime.exe
#}
set basedir $buildfolder
set config [dict create\
-make-step copy_runtime\ -make-step copy_runtime\
] ]
lassign [punkcheck::start_installer_event $basedir/.punkcheck $installername $rtfolder $buildfolder $config] _eventid punkcheck_eventid _recordset record_list 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 file_record [punkcheck::installfile_begin $basedir $target_relpath $installername -eventid $punkcheck_eventid]
# -- --- --- --- --- --- # -- --- --- --- --- ---
set source_relpath [punkcheck::lib::path_relative $basedir $rtfolder/$runtimefile] set source_relpath [punkcheck::lib::path_relative $basedir $rtfolder/$runtimefile]
set file_record [punkcheck::installfile_add_source_and_fetch_metadata $basedir $source_relpath $file_record] set file_record [punkcheck::installfile_add_source_and_fetch_metadata $basedir $source_relpath $file_record]
# -- --- --- --- --- --- # -- --- --- --- --- ---
set changed_unchanged [punkcheck::recordlist::file_install_record_source_changes [lindex [dict get $file_record body] end]] set changed_unchanged [punkcheck::recordlist::file_install_record_source_changes [lindex [dict get $file_record body] end]]
if {[llength [dict get $changed_unchanged changed]]} { if {[llength [dict get $changed_unchanged changed]]} {
set file_record [punkcheck::installfile_started_install $basedir $file_record] set file_record [punkcheck::installfile_started_install $basedir $file_record]
# -- --- --- --- --- --- # -- --- --- --- --- ---
puts stdout "Copying runtime from $rtfolder/$runtimefile to $buildfolder/buildruntime.exe" puts stdout "Copying runtime from $rtfolder/$runtimefile to $buildfolder/build_$runtimefile"
file copy -force $rtfolder/$runtimefile $buildfolder/buildruntime.exe file copy -force $rtfolder/$runtimefile $buildfolder/build_$runtimefile
# -- --- --- --- --- --- # -- --- --- --- --- ---
set file_record [punkcheck::installfile_finished_install $basedir $file_record] set file_record [punkcheck::installfile_finished_install $basedir $file_record]
} else { } else {
puts stderr "." puts stderr "."
set file_record [punkcheck::installfile_skipped_install $basedir $file_record] set file_record [punkcheck::installfile_skipped_install $basedir $file_record]
}
} }
# -- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- # -- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
@ -540,7 +548,7 @@ foreach vfs $vfs_folders {
if {[file exists $buildfolder/$targetexe]} { if {[file exists $buildfolder/$targetexe]} {
puts stderr "deleting existing $buildfolder/$targetexe" puts stderr "deleting existing $buildfolder/$targetexe"
if {[catch { if {[catch {
file delete $sourcefolder/_build/$targetexe file delete $buildfolder/$targetexe
} msg]} { } msg]} {
puts stderr "Failed to delete $buildfolder/$targetexe" puts stderr "Failed to delete $buildfolder/$targetexe"
exit 4 exit 4
@ -548,7 +556,7 @@ foreach vfs $vfs_folders {
} }
if {$::tcl_platform(platform) eq "windows"} { if {$::tcl_platform(platform) eq "windows"} {
file rename $buildfolder/$vfsname $sourcefolder/_build/${vfsname}.exe file rename $buildfolder/$vfsname $buildfolder/${vfsname}.exe
} }
after 200 after 200

Loading…
Cancel
Save