]> rtime.felk.cvut.cz Git - fpga/virtex2/msp_motion.git/blob - build/create.tcl
Makefile creating ISE project file
[fpga/virtex2/msp_motion.git] / build / create.tcl
1 # xtclsh create.tcl <project.ise> <sources1.prj> <sources2.prj> ...
2 #===============================================================================
3
4 proc xfile_add_prj prj {
5     set f [open $prj]
6     set dir [file dirname $prj]
7
8     while {[gets $f line] >= 0} {
9         set l [string trim $line]
10         regsub      "#.*" $l "" l
11         regsub -all "\t"  $l " " l
12         regsub -all " +"  $l " " l
13
14         if {[string length $l] > 5} {
15             set list [split $l " "]
16             set lib [lindex $list 1]
17             set src $dir/[lindex $list 2]
18
19             puts [format "Adding (%s) %s" $lib $src]
20
21             xfile add $src
22         }
23     }
24
25     close $f
26 }
27
28 #===============================================================================
29
30 if {$argc < 2} {
31     puts "ERROR: there are missing arguments, see source file..."
32     exit 1
33 }
34
35
36 project new [lindex $argv 0]
37
38 for {set i 1} {$i < $argc} {incr i} {
39     xfile_add_prj [lindex $argv $i]
40 }
41
42 project close
43