3 NR_CPU
=$
(cat /proc
/cpuinfo |
grep ^processor |
wc -l)
7 echo "Usage: $0 [smatch options]"
8 echo "Compiles the kernel with -j${NR_CPU}"
13 if [ "$1" = "-h" ] ||
[ "$1" = "--help" ] ; then
17 SCRIPT_DIR
=$
(dirname $0)
18 if [ -e $SCRIPT_DIR/..
/smatch
] ; then
19 cp $SCRIPT_DIR/..
/smatch
$SCRIPT_DIR/..
/bak.smatch
20 CMD
=$SCRIPT_DIR/..
/bak.smatch
21 elif which smatch |
grep smatch
> /dev
/null
; then
24 echo "Smatch binary not found."
29 find -name \
*.c.smatch
-exec rm \
{\
} \
;
30 make -j${NR_CPU} -k CHECK
="$CMD -p=kernel --file-output $*" \
31 C
=1 bzImage modules
2>&1 |
tee compile.warns
32 find -name \
*.c.smatch
-exec cat \
{\
} \
; > warns.txt