]> rtime.felk.cvut.cz Git - fpga/virtex2/msp_motion.git/blobdiff - build/create.tcl
Makefile creating ISE project file
[fpga/virtex2/msp_motion.git] / build / create.tcl
diff --git a/build/create.tcl b/build/create.tcl
new file mode 100644 (file)
index 0000000..7009a91
--- /dev/null
@@ -0,0 +1,43 @@
+# 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
+