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."
19 WINE_ARGS
="-p=wine --full-path -D__i386__"
22 if [[ "$1" == "--sparse" ]] ; then
25 elif [[ "$1" == "--valgrind" ]] ; then
28 elif [[ "$1" == "" ]] ; then
31 if [[ "$1" == "--help" ]] ; then
35 if echo $1 |
grep -q ^
- ; then
45 cname
=$
(echo ${cname/.o/.c})
46 if [[ "$cname" == "" ]] ; then
49 if ! test -e $cname ; then
53 oname
=$
(echo ${cname/.c/.o})
54 if ! echo $oname |
grep .o$
> /dev
/null
; then
60 file_dir
=$
(dirname $oname)
61 o_short_name
=$
(basename $oname)
63 make CC
="$PRE $CMD $POST $WINE_ARGS" $o_short_name