4 echo "Usage: $0 [--sparse][--valgrind][--debug] path/to/file.c"
8 SCRIPT_DIR
=$
(dirname $0)
9 if [ -e $SCRIPT_DIR/..
/smatch
] ; then
10 CMD
=$SCRIPT_DIR/..
/smatch
11 elif which smatch |
grep smatch
> /dev
/null
; then
14 echo "Smatch binary not found."
18 POST
="--project=kernel"
21 if [[ "$1" == "--sparse" ]] ; then
24 elif [[ "$1" == "--valgrind" ]] ; then
27 elif [[ "$1" == "" ]] ; then
30 if [[ "$1" == "--help" ]] ; then
34 if echo $1 |
grep -q ^
- ; then
44 cname
=$
(echo ${cname/.o/.c})
45 if [[ "$cname" == "" ]] ; then
48 if ! test -e $cname ; then
52 oname
=$
(echo ${cname/.c/.o})
53 if ! echo $oname |
grep .o$
> /dev
/null
; then
57 make C
=y CHECK
="$PRE $CMD $POST" $oname