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 CMD
=$SCRIPT_DIR/..
/smatch
20 elif which smatch |
grep smatch
> /dev
/null
; then
23 echo "Smatch binary not found."
28 find -name \
*.c.smatch
-exec rm \
{\
} \
;
29 make -j${NR_CPU} -k CHECK
="$CMD -p=kernel --file-output $*" \
30 C
=1 bzImage modules
2>&1 |
tee compile.warns
31 find -name \
*.c.smatch
-exec cat \
{\
} \
; > warns.txt