3 # This is a generic script to parse --info output. For the kernel, don't use
4 # this script, use build_kernel_data.sh instead.
6 NR_CPU
=$
(cat /proc
/cpuinfo |
grep ^processor |
wc -l)
7 SCRIPT_DIR
=$
(dirname $0)
15 echo "Updates the smatch_data/ directory and builds the smatch database"
16 echo " -p <project> (default = $PROJECT)"
22 if [[ "$1" == "--target" ]] ; then
26 elif [ "$1" == "-p" ] ||
[ "$1" == "--project" ] ; then
30 elif [ "$1" == "--help" ] ||
[ "$1" = "-h" ] ; then
37 if [ -e $SCRIPT_DIR/..
/smatch
] ; then
38 BIN_DIR
=$SCRIPT_DIR/..
/
40 echo "This script should be located in the smatch_scripts/ subdirectory of the smatch source."
44 # If someone is building the database for the first time then make sure all the
45 # required packages are installed
46 if [ ! -e smatch_db.sqlite
] ; then
47 [ -e smatch_warns.txt
] ||
touch smatch_warns.txt
48 if ! $SCRIPT_DIR/..
/smatch_data
/db
/create_db.sh
-p=$PROJECT smatch_warns.txt
; then
49 echo "Hm... Not working. Make sure you have all the sqlite3 packages"
50 echo "And the sqlite3 libraries for Perl and Python"
55 make -j${NR_CPU} CHECK
="$BIN_DIR/smatch --call-tree --info --param-mapper --spammy --file-output" $TARGET
57 find -name \
*.c.smatch
-exec cat \
{\
} \
; -exec rm \
{\
} \
; > smatch_warns.txt
59 for i
in $SCRIPT_DIR/gen_
* ; do
60 $i smatch_warns.txt
-p=${PROJECT}
64 mv $PROJECT.
* $DATA_DIR
66 $SCRIPT_DIR/..
/smatch_data
/db
/create_db.sh
-p=$PROJECT smatch_warns.txt