genConfig.tcl
上传用户:baixin
上传日期:2008-03-13
资源大小:4795k
文件大小:1k
- # genConfig.tcl
- #
- # modification history
- # --------------------
- # 01a,16oct01,sn wrote
- #
- # DESCRIPTION
- # wtxtcl genConfig.tcl <configlette_name> <obj> ... <obj>
- # Output a C file that defines __<configlette_name>Init
- # and for each specified file.o references the corresponding
- # __file_o marker symbol.
- set symbolList {}
- set arrayName "__[lindex $argv 0]"
- set externSymbolName "__[lindex $argv 0]Init"
- foreach arg [lrange $argv 1 [expr [llength $argv] - 1]] {
- if [regexp "(.*).o" $arg dummy symbol] {
- regsub -all "\-" $symbol "_" symbol
- lappend symbolList "__${symbol}_o"
- }
- }
- foreach symbol $symbolList {
- puts "extern char $symbol;"
- }
- puts ""
- puts "static char * $arrayName [] ="
- puts "{"
- foreach symbol $symbolList {
- puts " &$symbol,"
- }
- puts " 0"
- puts "};"
- puts ""
- puts "char ** $externSymbolName ()"
- puts "{"
- puts " return $arrayName;"
- puts "}"