summaryrefslogtreecommitdiffstats
path: root/runtime/probes/build
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/probes/build')
-rwxr-xr-xruntime/probes/build74
1 files changed, 15 insertions, 59 deletions
diff --git a/runtime/probes/build b/runtime/probes/build
index ac9994a9..584f792a 100755
--- a/runtime/probes/build
+++ b/runtime/probes/build
@@ -1,81 +1,37 @@
#!/usr/bin/tclsh
# -*- tcl -*-
-# simple script to do a make or "make clean" in each probe directory
+# simple script to build each probe directory
proc usage {} {
- puts "Usage: build \[clean\]"
+ puts "Usage: build \[-v\] \[clean\]"
exit
}
-set clean 0
+set clean ""
+set verbose ""
foreach arg $argv {
if {$arg == "clean"} {
- set clean 1
+ set clean $arg
+ } elseif {$arg == "-v"} {
+ set verbose $arg
} else {
usage
}
}
-set dirs {shellsnoop test4 where_func scf}
+set cmd "exec ../build_probe $verbose $clean"
-foreach i $dirs {
- cd $i
- if {$clean} {
- puts "Cleaning $i"
- if {[catch {exec make clean >& compile.errors} res]} {
- [exec cat compile.errors]
+foreach filename [lsort [glob *]] {
+ if {$filename != "CVS" && [file isdirectory $filename]} {
+ cd $filename
+ if {[catch {exec ../build_probe $verbose $clean} res]} {
+ puts $res
exit
}
- } else {
- puts "Building $i"
- if {[catch {exec make >& compile.errors} res]} {
- puts "\n------------ Compile error in $i -------------------\n"
- if {[catch {open compile.errors r} fd]} {
- puts "Compile failed for unknown reasons"
- exit
- }
- while {[gets $fd line] >= 0} {
- puts $line
- }
- close $fd
- exit
- } else {
- if {![catch {open compile.errors r} fd]} {
- # search for warnings
- set bad 0
- while {[gets $fd line] >= 0} {
- if {[regexp {[^W]*([A-Za-z][A-Za-z0-9_]*)[^\"]*\"([^\"]*)} $line match warn var]} {
- if {$warn == "Warning"} {
- switch $var {
- _stp_ctrl_unregister -
- _stp_ctrl_register -
- relay_subbufs_consumed -
- _stp_ctrl_send -
- relay_open -
- relayfs_create_dir -
- relayfs_remove_dir -
- relay_close {}
- default {
- if {$bad == 0} {
- puts "\n------------ Unexpected Warnings in $i -------------------\n"
- }
- puts $line
- set bad 1
- }
- }
- }
- }
- }
- close $fd
- }
- if {$bad} {
- exit
- }
- }
+ puts $res
+ cd ..
}
- catch {exec /bin/rm compile.errors}
- cd ..
}