Browse Source

adjust make.tcl to copy deps

master
Julian Noble 1 year ago
parent
commit
ab41e0a7ca
  1. 26
      src/make.tcl

26
src/make.tcl

@ -10,9 +10,9 @@ puts stdout "::argv $::argv"
set dirname [file normalize [file dirname [info script]]] set dirname [file normalize [file dirname [info script]]]
# ---------------------------------------- # ----------------------------------------
set src_module_dir $dirname/modules
proc copy_modules_in_dir {srcdir basedir {subdirlist {}}} { proc copy_modules_in_dir {srcdir basedir {subdirlist {}}} {
set module_list [list]
set src_modules [glob -nocomplain -dir $srcdir -type f -tail *.tm] set src_modules [glob -nocomplain -dir $srcdir -type f -tail *.tm]
if {![file exists $basedir]} { if {![file exists $basedir]} {
error "copy_modules_in_dir basedir:'$basedir' doesn't exist" error "copy_modules_in_dir basedir:'$basedir' doesn't exist"
@ -25,26 +25,38 @@ proc copy_modules_in_dir {srcdir basedir {subdirlist {}}} {
foreach m $src_modules { foreach m $src_modules {
puts stdout "copying module $srcdir/$m to $target_module_dir" puts stdout "copying module $srcdir/$m to $target_module_dir"
file copy -force $srcdir/$m $target_module_dir file copy -force $srcdir/$m $target_module_dir
lappend module_list $srcdir/$m
} }
set subdirs [glob -nocomplain -dir $srcdir -type d -tail *] set subdirs [glob -nocomplain -dir $srcdir -type d -tail *]
#puts stderr "subdirs: $subdirs" #puts stderr "subdirs: $subdirs"
foreach d $subdirs { foreach d $subdirs {
if {[string match "#*" $d]} { if {[string match "#*" $d] || ($d eq "_aside")} {
continue continue
} }
if {![file exists $target_module_dir/$d]} { if {![file exists $target_module_dir/$d]} {
file mkdir $target_module_dir/$d file mkdir $target_module_dir/$d
} }
copy_modules_in_dir $srcdir/$d $basedir [list {*}$subdirlist $d] lappend module_list {*}[copy_modules_in_dir $srcdir/$d $basedir [list {*}$subdirlist $d]]
} }
return $module_list
} }
set src_modules [glob -nocomplain -dir $src_module_dir -type f -tail *.tm]
set target_modules_base [file dirname $dirname]/modules set target_modules_base [file dirname $dirname]/modules
file mkdir $target_modules_base file mkdir $target_modules_base
copy_modules_in_dir $src_module_dir $target_modules_base
#external modules first
set copied [copy_modules_in_dir $dirname/deps $target_modules_base]
puts stderr "Copied [llength $copied] dependencies"
set src_module_dir $dirname/modules
#modules belonging to this package/app
set copied [copy_modules_in_dir $src_module_dir $target_modules_base]
puts stderr "Copied [llength $copied] app modules"
#set src_modules [glob -nocomplain -dir $src_module_dir -type f -tail *.tm]
#foreach m $src_modules { #foreach m $src_modules {
# puts stdout "copying module $src_module_dir/$m to $target_module_dir" # puts stdout "copying module $src_module_dir/$m to $target_module_dir"
# file copy -force $src_module_dir/$m $target_module_dir # file copy -force $src_module_dir/$m $target_module_dir

Loading…
Cancel
Save