--- /dev/null
+# xtclsh create.tcl <project.ise> <sources1.prj> <sources2.prj> ...
+#===============================================================================
+
+proc xfile_add_prj prj {
+ set f [open $prj]
+ set dir [file dirname $prj]
+
+ while {[gets $f line] >= 0} {
+ set l [string trim $line]
+ regsub "#.*" $l "" l
+ regsub -all "\t" $l " " l
+ regsub -all " +" $l " " l
+
+ if {[string length $l] > 5} {
+ set list [split $l " "]
+ set lib [lindex $list 1]
+ set src $dir/[lindex $list 2]
+
+ puts [format "Adding (%s) %s" $lib $src]
+
+ xfile add $src
+ }
+ }
+
+ close $f
+}
+
+#===============================================================================
+
+if {$argc < 2} {
+ puts "ERROR: there are missing arguments, see source file..."
+ exit 1
+}
+
+
+project new [lindex $argv 0]
+
+for {set i 1} {$i < $argc} {incr i} {
+ xfile_add_prj [lindex $argv $i]
+}
+
+project close
+