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 SCRIPT_DIR
=$
(dirname $0)
13 echo "Updates the smatch_data/ directory and builds the smatch database"
18 if [ "$1" = "-h" ] ||
[ "$1" = "--help" ] ; then
22 if [ -e $SCRIPT_DIR/..
/smatch
] ; then
23 BIN_DIR
=$SCRIPT_DIR/..
/
25 echo "This script should be located in the smatch_scripts/ subdirectory of the smatch source."
29 # If someone is building the database for the first time then make sure all the
30 # required packages are installed
31 if [ ! -e smatch_db.sqlite
] ; then
32 [ -e smatch_warns.txt
] ||
touch smatch_warns.txt
33 if ! $SCRIPT_DIR/..
/smatch_data
/db
/create_db.sh
-p=kernel smatch_warns.txt
; then
34 echo "Hm... Not working. Make sure you have all the sqlite3 packages"
35 echo "And the sqlite3 libraries for Perl and Python"
40 make CHECK
="$BIN_DIR/smatch --call-tree --info --param-mapper --spammy --file-output" $
*
42 find -name \
*.c.smatch
-exec cat \
{\
} \
; -exec rm \
{\
} \
; > smatch_warns.txt
44 for i
in $SCRIPT_DIR/gen_
* ; do
45 $i smatch_warns.txt
-p=${PROJECT}
49 mv $PROJECT.
* $DATA_DIR
51 $SCRIPT_DIR/..
/smatch_data
/db
/create_db.sh smatch_warns.txt