diff options
author | Patrick Georgi <patrick.georgi@coresystems.de> | 2010-03-14 21:25:03 +0000 |
---|---|---|
committer | Patrick Georgi <patrick.georgi@coresystems.de> | 2010-03-14 21:25:03 +0000 |
commit | 020f51fdc0c54c8dcb115de611d48946695b155d (patch) | |
tree | 31eaaef17f69842cccc00c2a60a37539cb0074b4 /util/abuild | |
parent | 8702ab5ab1ee3e9f4f4d6edd7cec85ed6029aac8 (diff) | |
download | coreboot-020f51fdc0c54c8dcb115de611d48946695b155d.tar.xz |
Add scan-build support to the build system.
When configured in Kconfig, just running "make"
calls scan-build as appropriate (however, it does not
check for the presence of scan-build)
The target directory for the scan-build report is configurable
and defaults to the scan-build default of /tmp/scan-build-$date-$num
abuild is adapted to properly run scanbuild when ran
with the -sb option.
Signed-off-by: Patrick Georgi <patrick.georgi@coresystems.de>
Acked-by: Stefan Reinauer <stepan@coresystems.de>
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@5208 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'util/abuild')
-rwxr-xr-x | util/abuild/abuild | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/util/abuild/abuild b/util/abuild/abuild index a9633c9215..1e67685ffb 100755 --- a/util/abuild/abuild +++ b/util/abuild/abuild @@ -173,6 +173,12 @@ function create_config echo "CONFIG_DEFAULT_CONSOLE_LOGLEVEL_$loglevel=y" >> .config echo "CONFIG_DEFAULT_CONSOLE_LOGLEVEL=$loglevel" >> .config fi + + if [ "$scanbuild" = "true" ]; then + printf "(scan-build enabled) " + echo "CONFIG_SCANBUILD_ENABLE=y" >> .config + echo "CONFIG_SCANBUILD_REPORT_LOCATION=\"$TARGET/scan-build-results-tmp\"" >> .config + fi fi yes "" | $MAKE oldconfig obj=${build_dir} > ${build_dir}/config.log @@ -364,21 +370,6 @@ function build_target CC="$CC -fno-stack-protector" fi - if [ "$scanbuild" = "true" ]; then - ccwrap=`mktemp` - mkdir -p $TARGET/${VENDOR}_${MAINBOARD} - mkdir -p $TARGET/scan-build-results-tmp - mv $ccwrap $TARGET/${VENDOR}_${MAINBOARD} - ccwrap=$TARGET/${VENDOR}_${MAINBOARD}/`basename $ccwrap` - echo '#!/bin/sh' > $ccwrap - echo $CC' "$@"' >> $ccwrap - chmod +x $ccwrap - origMAKE=$MAKE - MAKE="scan-build --use-cc=$ccwrap -o $TARGET/scan-build-results-tmp -analyze-headers $MAKE GCC=$ccwrap" - CC="\$(CC)" - HOSTCC="CCC_CC=$HOSTCC \$(CC)" - fi - built_successfully $VENDOR $MAINBOARD && \ { printf " ( mainboard/$VENDOR/$MAINBOARD previously ok )\n\n" |