build: make scan-build work again
This drops the scan-build related Kconfig options since it's now possible to simply run scan-build [-o outdir] make and get coreboot built with its report. There's also no inner make process anymore, and the way things work should be clearer now. Also adapt abuild to this new reality. Change-Id: I03e03334761ec83f718b3235ebf811834cd2e3e3 Signed-off-by: Patrick Georgi <patrick@georgi-clan.de> Reviewed-on: http://review.coreboot.org/5774 Tested-by: build bot (Jenkins) Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
This commit is contained in:
30
Makefile
30
Makefile
@@ -30,19 +30,9 @@
|
||||
## SUCH DAMAGE.
|
||||
##
|
||||
|
||||
ifeq ($(INNER_SCANBUILD),y)
|
||||
CC_real:=$(CC)
|
||||
endif
|
||||
|
||||
$(if $(wildcard .xcompile),,$(eval $(shell bash util/xcompile/xcompile $(XGCCPATH) > .xcompile)))
|
||||
include .xcompile
|
||||
|
||||
ifeq ($(INNER_SCANBUILD),y)
|
||||
CC:=$(CC_real)
|
||||
HOSTCC:=$(CC_real) --hostcc
|
||||
HOSTCXX:=$(CC_real) --hostcxx
|
||||
endif
|
||||
|
||||
export top := $(CURDIR)
|
||||
export src := src
|
||||
export srck := $(top)/util/kconfig
|
||||
@@ -119,12 +109,10 @@ include $(HAVE_DOTCONFIG)
|
||||
|
||||
include toolchain.inc
|
||||
|
||||
ifneq ($(INNER_SCANBUILD),y)
|
||||
ifeq ($(CONFIG_COMPILER_LLVM_CLANG),y)
|
||||
CC:=clang -m32 -mno-mmx -mno-sse -no-integrated-as
|
||||
HOSTCC:=clang
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_CCACHE),y)
|
||||
CCACHE:=$(word 1,$(wildcard $(addsuffix /ccache,$(subst :, ,$(PATH)))))
|
||||
@@ -143,25 +131,7 @@ strip_quotes = $(subst ",,$(subst \",,$(1)))
|
||||
# The primary target needs to be here before we include the
|
||||
# other files
|
||||
|
||||
ifeq ($(INNER_SCANBUILD),y)
|
||||
CONFIG_SCANBUILD_ENABLE:=
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_SCANBUILD_ENABLE),y)
|
||||
ifneq ($(CONFIG_SCANBUILD_REPORT_LOCATION),)
|
||||
CONFIG_SCANBUILD_REPORT_LOCATION:=-o $(CONFIG_SCANBUILD_REPORT_LOCATION)
|
||||
endif
|
||||
real-all:
|
||||
echo '#!/bin/sh' > .ccwrap
|
||||
echo 'CC="$(CC)"' >> .ccwrap
|
||||
echo 'if [ "$$1" = "--hostcc" ]; then shift; CC="$(HOSTCC)"; fi' >> .ccwrap
|
||||
echo 'if [ "$$1" = "--hostcxx" ]; then shift; CC="$(HOSTCXX)"; fi' >> .ccwrap
|
||||
echo 'eval $$CC $$*' >> .ccwrap
|
||||
chmod +x .ccwrap
|
||||
scan-build $(CONFIG_SCANBUILD_REPORT_LOCATION) -analyze-headers --use-cc=$(top)/.ccwrap --use-c++=$(top)/.ccwrap $(MAKE) INNER_SCANBUILD=y
|
||||
else
|
||||
real-all: real-target
|
||||
endif
|
||||
|
||||
# must come rather early
|
||||
.SECONDEXPANSION:
|
||||
|
Reference in New Issue
Block a user