1 # xtclsh create.tcl <project.ise> <sources1.prj> <sources2.prj> ...
2 #===============================================================================
4 proc xfile_add_prj prj {
6 set dir [file dirname $prj]
8 while {[gets $f line] >= 0} {
9 set l [string trim $line]
11 regsub -all "\t" $l " " l
12 regsub -all " +" $l " " l
14 if {[string length $l] > 5} {
15 set list [split $l " "]
16 set lib [lindex $list 1]
17 set src $dir/[lindex $list 2]
19 puts [format "Adding (%s) %s" $lib $src]
28 #===============================================================================
31 puts "ERROR: there are missing arguments, see source file..."
36 project new [lindex $argv 0]
38 for {set i 1} {$i < $argc} {incr i} {
39 xfile_add_prj [lindex $argv $i]