1 # Copyright (c) 1999-2012 OPEN CASCADE SAS
3 # The content of this file is subject to the Open CASCADE Technology Public
4 # License Version 6.5 (the "License"). You may not use the content of this file
5 # except in compliance with the License. Please obtain a copy of the License
6 # at http://www.opencascade.org and read it completely before using this file.
8 # The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
9 # main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
11 # The Original Code and all software distributed under the License is
12 # distributed on an "AS IS" basis, without warranty of any kind, and the
13 # Initial Developer hereby disclaims all such warranties, including without
14 # limitation, any warranties of merchantability, fitness for a particular
15 # purpose or non-infringement. Please see the License for the specific terms
16 # and conditions governing the rights and limitations under the License.
20 # procedures pour automatiser la fabrication de gti
23 puts " ***** loading build_list ***** "
24 ###############################################################################
27 proc build_list { factory ilot workbench exelist toolkitlist packagelist } {
30 ###############################################################################
31 # fabrique la liste des executables, toolkits et packages
32 # pour un workbench donne
35 upvar $exelist EXECUTABLE_LIST
36 upvar $toolkitlist TOOLKIT_LIST
37 upvar $packagelist PACKAGE_LIST
38 wokcd [concat $factory:$ilot:$workbench]
40 set UD_LIST [ w_info -l ]
42 set EXECUTABLE_LIST ""
44 for { set i 0 } { $i <= [expr [ llength $UD_LIST ] - 1 ]} { incr i } {
45 set p [lindex $UD_LIST $i]
46 set typ [ uinfo -t $p ]
47 if { $typ == "executable" } {
48 lappend EXECUTABLE_LIST $p
49 } elseif { $typ == "toolkit" } {
50 lappend TOOLKIT_LIST $p
51 } elseif { $typ == "package" || $typ == "nocdlpack" } {
52 lappend PACKAGE_LIST $p
56 puts " ***** loading extract_from_cdl ***** "
57 ###############################################################################
60 proc extract_from_cdl { factory ilot workbench } {
63 ###############################################################################
64 build_list $factory $ilot $workbench TYPE_OF_PACKAGE_LIST(1) TYPE_OF_PACKAGE_LIST(2) TYPE_OF_PACKAGE_LIST(3)
65 puts " *********** Extraction commencing at "
67 for { set i 0 } { $i <= [expr [ llength $TYPE_OF_PACKAGE_LIST(3) ] - 1 ]} { incr i } {
68 set PACKAGE [lindex $TYPE_OF_PACKAGE_LIST(3) $i]
70 set LOCAL_UD [ wokcd ]
73 set ERROR_FILE [ wokinfo -p admfile:cdlcompile.log $LOCAL_UD ]
74 set ERROR_DIRECTORY [ file dirname $ERROR_FILE ]
77 # attention : verifier que la directory existe
79 if { [ file isdirectory $ERROR_DIRECTORY ] } {
80 set FILE_DESCRIPTOR [ open $ERROR_FILE w ]
82 # on initialise avec un chaine null le fichier
84 puts $FILE_DESCRIPTOR ""
86 # on redirige les erreurs avec un dispatcheur
88 msgsetcmd dispatch_compile_message $FILE_DESCRIPTOR
90 catch { umake -fe obj.inc }
91 # puts "umake -fe obj.inc"
92 if { [ file isdirectory $ERROR_DIRECTORY ] } {
93 close $FILE_DESCRIPTOR
98 puts " ********** Extraction ending at "
102 puts " ***** loading force_build_only_obj ***** "
103 ###############################################################################
106 proc force_build_only_obj { factory ilot workbench } {
109 ###############################################################################
110 build_list $factory $ilot $workbench TYPE_OF_PACKAGE_LIST(1) TYPE_OF_PACKAGE_LIST(2) TYPE_OF_PACKAGE_LIST(3)
111 puts " ********* Obj commencing at "
112 puts " [ exec date ] "
113 for { set i 0 } { $i <= [expr [ llength $TYPE_OF_PACKAGE_LIST(3) ] - 1 ]} { incr i } {
114 set p [lindex $TYPE_OF_PACKAGE_LIST(3) $i]
116 set LOCAL_UD [ wokcd ]
117 set ERROR_FILE [ wokinfo -p stadmfile:objcompile.log $LOCAL_UD ]
118 set ERROR_DIRECTORY [ file dirname $ERROR_FILE ]
121 # attention : verifier que la directory existe
123 if { [ file isdirectory $ERROR_DIRECTORY ] } {
124 set FILE_DESCRIPTOR [ open $ERROR_FILE w ]
126 # on initialise avec un chaine null le fichier
128 puts $FILE_DESCRIPTOR ""
130 # on redirige les erreurs avec un dispatcheur
132 msgsetcmd dispatch_compile_message $FILE_DESCRIPTOR
134 catch { umake -of obj }
135 # puts " umake -o obj $p "
136 if { [ file isdirectory $ERROR_DIRECTORY ] } {
137 close $FILE_DESCRIPTOR
143 for { set j 1 } { $j <= 2 } { incr j } {
144 for { set i 0 } { $i <= [expr [ llength $TYPE_OF_PACKAGE_LIST($j) ] - 1 ]} { incr i } {
145 set p [lindex $TYPE_OF_PACKAGE_LIST($j) $i]
147 set LOCAL_UD [ wokcd ]
148 set ERROR_FILE [ wokinfo -p stadmfile:objcompile.log $LOCAL_UD ]
149 set ERROR_DIRECTORY [ file dirname $ERROR_FILE ]
152 # attention : verifier que la directory existe
154 if { [ file isdirectory $ERROR_DIRECTORY ] } {
155 set FILE_DESCRIPTOR [ open $ERROR_FILE w ]
157 # on initialise avec un chaine null le fichier
159 puts $FILE_DESCRIPTOR ""
161 # on redirige les erreurs avec un dispatcheur
163 msgsetcmd dispatch_compile_message $FILE_DESCRIPTOR
168 if { [ file isdirectory $ERROR_DIRECTORY ] } {
169 close $FILE_DESCRIPTOR
175 puts " ********* Obj ending at "
176 puts " [ exec date ] "
179 puts " ***** loading build_only_obj ****** "
180 ###############################################################################
183 proc build_only_obj { factory ilot workbench } {
186 ###############################################################################
188 build_list $factory $ilot $workbench TYPE_OF_PACKAGE_LIST(1) TYPE_OF_PACKAGE_LIST(2) TYPE_OF_PACKAGE_LIST(3)
189 puts " ********* Obj commencing at "
190 puts " [ exec date ] "
191 for { set i 0 } { $i <= [expr [ llength $TYPE_OF_PACKAGE_LIST(3) ] - 1 ]} { incr i } {
192 set p [lindex $TYPE_OF_PACKAGE_LIST(3) $i]
194 set LOCAL_UD [ wokcd ]
195 set ERROR_FILE [ wokinfo -p stadmfile:objcompile.log $LOCAL_UD ]
196 set ERROR_DIRECTORY [ file dirname $ERROR_FILE ]
199 # attention : verifier que la directory existe
201 if { [ file isdirectory $ERROR_DIRECTORY ] } {
202 set FILE_DESCRIPTOR [ open $ERROR_FILE w ]
204 # on initialise avec un chaine null le fichier
206 puts $FILE_DESCRIPTOR ""
208 # on redirige les erreurs avec un dispatcheur
210 msgsetcmd dispatch_compile_message $FILE_DESCRIPTOR
212 catch { umake -o obj }
213 # puts " umake -o obj $p "
214 if { [ file isdirectory $ERROR_DIRECTORY ] } {
215 close $FILE_DESCRIPTOR
221 for { set j 1 } { $j <= 2 } { incr j } {
222 for { set i 0 } { $i <= [expr [ llength $TYPE_OF_PACKAGE_LIST($j) ] - 1 ]} { incr i } {
223 set p [lindex $TYPE_OF_PACKAGE_LIST($j) $i]
225 set LOCAL_UD [ wokcd ]
226 set ERROR_FILE [ wokinfo -p stadmfile:objcompile.log $LOCAL_UD ]
227 set ERROR_DIRECTORY [ file dirname $ERROR_FILE ]
230 # attention : verifier que la directory existe
232 if { [ file isdirectory $ERROR_DIRECTORY ] } {
233 set FILE_DESCRIPTOR [ open $ERROR_FILE w ]
235 # on initialise avec un chaine null le fichier
237 puts $FILE_DESCRIPTOR ""
239 # on redirige les erreurs avec un dispatcheur
241 msgsetcmd dispatch_compile_message $FILE_DESCRIPTOR
246 if { [ file isdirectory $ERROR_DIRECTORY ] } {
247 close $FILE_DESCRIPTOR
253 puts " ********* Obj ending at "
254 puts " [ exec date ] "
257 ###############################################################################
260 proc dispatch_compile_message { code message file } {
263 ###############################################################################
265 if { $code == "E" } {
266 puts $file " $message "
283 puts " ***** loading build_obj_log ***** "
284 ###############################################################################
287 proc build_obj_log { factory ilot workbench } {
290 ###############################################################################
291 puts " Erreurs dans les compiles obj :"
292 build_list $factory $ilot $workbench TYPE_OF_PACKAGE_LIST(1) TYPE_OF_PACKAGE_LIST(2) TYPE_OF_PACKAGE_LIST(3)
293 for { set j 2 } { $j <= 3 } { incr j } {
294 for { set i 0 } { $i <= [expr [ llength $TYPE_OF_PACKAGE_LIST($j) ] - 1 ]} { incr i } {
295 set p [lindex $TYPE_OF_PACKAGE_LIST($j) $i]
297 set LOCAL_UD [ wokcd ]
298 set ERROR_FILE [ wokinfo -p stadmfile:objcompile.log $LOCAL_UD ]
299 if { [ file exists $ERROR_FILE ] } {
300 set FILE_DESCRIPTOR [ open $ERROR_FILE r ]
302 while { [ gets $FILE_DESCRIPTOR LINE ] >= 0 && $ERROR_HAPPENED == 0 } {
303 if { [ regexp Error $LINE ] } {
308 close $FILE_DESCRIPTOR
313 puts " ***** loading build_cdl_log ****** "
314 ###############################################################################
317 proc build_cdl_log { factory ilot workbench } {
320 ###############################################################################
321 puts "Erreurs dans les compiles cdl :"
322 build_list $factory $ilot $workbench TYPE_OF_PACKAGE_LIST(1) TYPE_OF_PACKAGE_LIST(2) TYPE_OF_PACKAGE_LIST(3)
323 for { set i 0 } { $i <= [expr [ llength $TYPE_OF_PACKAGE_LIST(3) ] - 1 ]} { incr i } {
324 set p [lindex $TYPE_OF_PACKAGE_LIST(3) $i]
326 set LOCAL_UD [ wokcd ]
327 set ERROR_FILE [ wokinfo -p admfile:cdlcompile.log $LOCAL_UD ]
328 if { [ file exists $ERROR_FILE ] } {
329 set FILE_DESCRIPTOR [ open $ERROR_FILE r ]
331 while { [ gets $FILE_DESCRIPTOR LINE ] >= 0 && $ERROR_HAPPENED == 0} {
332 if { [ regexp Error $LINE ] } {
337 close $FILE_DESCRIPTOR