Browse Source

rename make_punk86.tcl to make.tcl and fix to handle modules in subdirectories

master
Julian Noble 1 year ago
parent
commit
5ac8a99794
  1. 43
      src/make.tcl

43
src/make_punk86.tcl → src/make.tcl

@ -12,14 +12,45 @@ set dirname [file normalize [file dirname [info script]]]
# ---------------------------------------- # ----------------------------------------
set src_module_dir $dirname/modules set src_module_dir $dirname/modules
set src_modules [glob -nocomplain -dir $src_module_dir -type f -tail *.tm] proc copy_modules_in_dir {srcdir basedir {subdirlist {}}} {
set target_module_dir [file dirname $dirname]/modules set src_modules [glob -nocomplain -dir $srcdir -type f -tail *.tm]
file mkdir $target_module_dir if {![file exists $basedir]} {
foreach m $src_modules { error "copy_modules_in_dir basedir:'$basedir' doesn't exist"
puts stdout "copying module $src_module_dir/$m to $target_module_dir" }
file copy -force $src_module_dir/$m $target_module_dir if {[llength $subdirlist] == 0} {
set target_module_dir $basedir
} else {
set target_module_dir $basedir/[file join {*}$subdirlist]
}
foreach m $src_modules {
puts stdout "copying module $srcdir/$m to $target_module_dir"
file copy -force $srcdir/$m $target_module_dir
}
set subdirs [glob -nocomplain -dir $srcdir -type d -tail *]
#puts stderr "subdirs: $subdirs"
foreach d $subdirs {
if {[string match "#*" $d]} {
continue
}
if {![file exists $target_module_dir/$d]} {
file mkdir $target_module_dir/$d
}
copy_modules_in_dir $srcdir/$d $basedir [list {*}$subdirlist $d]
}
} }
set src_modules [glob -nocomplain -dir $src_module_dir -type f -tail *.tm]
set target_modules_base [file dirname $dirname]/modules
file mkdir $target_modules_base
copy_modules_in_dir $src_module_dir $target_modules_base
#foreach m $src_modules {
# puts stdout "copying module $src_module_dir/$m to $target_module_dir"
# file copy -force $src_module_dir/$m $target_module_dir
#}
# ---------------------------------------- # ----------------------------------------
# #
if {![file exists $dirname/punk86.vfs]} { if {![file exists $dirname/punk86.vfs]} {
Loading…
Cancel
Save