Changeset 306 for tbroadcast
- Timestamp:
- Nov 10, 2006, 11:23:41 AM (18 years ago)
- Location:
- tbroadcast/HEAD
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
tbroadcast/HEAD/python/tbroadcast.py
r261 r306 492 492 #sys.exit(-1) 493 493 494 495 def generate_make (self, file, command): 496 print 'generate_make' 497 makefile = open (file, 'w+') 498 self.recursive_make (self.current_package, command, makefile, len(self.packages)) 499 makefile.close () 500 501 def recursive_make (self, package, command, makefile, indice,actions=list()): 502 lines = self.generate_action_make (package, command, indice) 503 makefile.write (lines) 504 print lines 505 for pkg in self.packages[package] ['uses']: 506 if pkg not in actions: 507 actions.append(pkg) 508 indice = indice - 1 509 self.recursive_make(pkg, command,makefile, indice, actions) 510 511 def generate_action_make (self, package, command, indice): 512 lines = package + ' :: ' 513 # add dependencies 514 for pkg in self.packages[package] ['uses']: 515 lines = lines + ' ' + pkg 516 517 # add the action itself 518 newcommand = string.replace (command, '<package>', package) 519 lines = lines + '\n' 520 lines = lines + '\t@echo "#--------------------------------------------------------------"\n' 521 lines = lines + '\t@echo "# ('+str(indice)+'/'+str(len(self.packages))+') Now trying ['+newcommand+'] in '+ self.packages[package]['path']+'"\n' 522 lines = lines + '\t@echo "#--------------------------------------------------------------"\n' 523 lines = lines + '\t@cd ' + self.packages[package]['path'] 524 lines = lines + ' ; ' + newcommand 525 lines = lines + '\n\n' 526 return lines 527 494 528 #--------- EoF --------# -
tbroadcast/HEAD/scripts/tbroadcast
r259 r306 24 24 print '# -global : Reach packages in all CMTPATH/CMTPROJECTPATH items' 25 25 print '# -ignore_cycles : Suppress automatically the cycles' 26 print '# -make=<file> : Generate a recursive Make, see: http://www.tip.net.au/~millerp/rmch/recu-make-cons-harm.html' 26 27 print '# -nb=<num_worker> : Change the total number of threads[default is 20]' 27 28 print '# -output=<location> : Output directory to store output files with the form <package>_output.log' … … 48 49 error = None 49 50 file = None 51 make = None 52 makefile = 'Makefile' 50 53 51 54 if len(sys.argv) == 1: … … 84 87 elif option == '-print': 85 88 print_graph = True 89 elif option == '-make': 90 make = True 91 makefile = string.split(arg,'=')[1] 86 92 else: 87 93 command = arg … … 94 100 elif print_graph: 95 101 master.print_dependencies () 102 elif make: 103 master.generate_make (makefile, command) 96 104 else: 97 105 master.execute_all (command)
Note: See TracChangeset
for help on using the changeset viewer.