forked from openkylin/platform_build
resolved conflicts for merge of 2b5d2c55
to klp-dev-plus-aosp
Change-Id: Icd9d5eff3f9acba042c100f694309f902c9d56cf
This commit is contained in:
commit
246daf755a
|
@ -183,6 +183,10 @@ ifeq ($(strip $(WITH_SYNTAX_CHECK)),)
|
|||
LOCAL_NO_SYNTAX_CHECK := true
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(WITH_STATIC_ANALYZER)),)
|
||||
LOCAL_NO_STATIC_ANALYZER := true
|
||||
endif
|
||||
|
||||
ifneq ($(strip $(LOCAL_IS_HOST_MODULE)),)
|
||||
my_syntax_arch := host
|
||||
else
|
||||
|
@ -196,9 +200,13 @@ ifeq ($(strip $(LOCAL_CC)),)
|
|||
LOCAL_CC := $($(my_prefix)CC)
|
||||
endif
|
||||
endif
|
||||
ifneq ($(LOCAL_NO_STATIC_ANALYZER),true)
|
||||
LOCAL_CC := $(SYNTAX_TOOLS_PREFIX)/ccc-analyzer $(my_syntax_arch) "$(LOCAL_CC)"
|
||||
else
|
||||
ifneq ($(LOCAL_NO_SYNTAX_CHECK),true)
|
||||
LOCAL_CC := $(SYNTAX_TOOLS_PREFIX)/ccc-syntax $(my_syntax_arch) "$(LOCAL_CC)"
|
||||
endif
|
||||
endif
|
||||
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_CC := $(LOCAL_CC)
|
||||
|
||||
ifeq ($(strip $(LOCAL_CXX)),)
|
||||
|
@ -208,9 +216,13 @@ ifeq ($(strip $(LOCAL_CXX)),)
|
|||
LOCAL_CXX := $($(my_prefix)CXX)
|
||||
endif
|
||||
endif
|
||||
ifneq ($(LOCAL_NO_STATIC_ANALYZER),true)
|
||||
LOCAL_CXX := $(SYNTAX_TOOLS_PREFIX)/cxx-analyzer $(my_syntax_arch) "$(LOCAL_CXX)"
|
||||
else
|
||||
ifneq ($(LOCAL_NO_SYNTAX_CHECK),true)
|
||||
LOCAL_CXX := $(SYNTAX_TOOLS_PREFIX)/cxx-syntax $(my_syntax_arch) "$(LOCAL_CXX)"
|
||||
endif
|
||||
endif
|
||||
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_CXX := $(LOCAL_CXX)
|
||||
|
||||
# TODO: support a mix of standard extensions so that this isn't necessary
|
||||
|
|
|
@ -141,6 +141,7 @@ LOCAL_POST_INSTALL_CMD:=
|
|||
LOCAL_DIST_BUNDLED_BINARIES:=
|
||||
LOCAL_HAL_STATIC_LIBRARIES:=
|
||||
LOCAL_NO_SYNTAX_CHECK:=
|
||||
LOCAL_NO_STATIC_ANALYZER:=
|
||||
|
||||
# Trim MAKEFILE_LIST so that $(call my-dir) doesn't need to
|
||||
# iterate over thousands of entries every time.
|
||||
|
|
|
@ -267,8 +267,22 @@ TARGET_TOOLCHAIN_ROOT := $(patsubst %/, %, $(dir $(TARGET_TOOLCHAIN_ROOT)))
|
|||
TARGET_TOOLCHAIN_ROOT := $(wildcard $(TARGET_TOOLCHAIN_ROOT))
|
||||
endif
|
||||
|
||||
# Disable WITH_SYNTAX_CHECK if tool can't be found
|
||||
# Normalize WITH_STATIC_ANALYZER and WITH_SYNTAX_CHECK
|
||||
ifeq ($(strip $(WITH_STATIC_ANALYZER)),0)
|
||||
WITH_STATIC_ANALYZER :=
|
||||
endif
|
||||
ifeq ($(strip $(WITH_SYNTAX_CHECK)),0)
|
||||
WITH_SYNTAX_CHECK :=
|
||||
endif
|
||||
|
||||
# Disable WITH_STATIC_ANALYZER and WITH_SYNTAX_CHECK if tool can't be found
|
||||
SYNTAX_TOOLS_PREFIX := prebuilts/clang/$(HOST_PREBUILT_TAG)/host/3.3/bin
|
||||
ifneq ($(strip $(WITH_STATIC_ANALYZER)),)
|
||||
ifeq ($(wildcard $(SYNTAX_TOOLS_PREFIX)/ccc-analyzer),)
|
||||
$(warning *** Disable WITH_STATIC_ANALYZER because $(SYNTAX_TOOLS_PREFIX)/ccc-analyzer does not exist)
|
||||
WITH_STATIC_ANALYZER :=
|
||||
endif
|
||||
endif
|
||||
ifneq ($(strip $(WITH_SYNTAX_CHECK)),)
|
||||
ifeq ($(wildcard $(SYNTAX_TOOLS_PREFIX)/ccc-syntax),)
|
||||
$(warning *** Disable WITH_SYNTAX_CHECK because $(SYNTAX_TOOLS_PREFIX)/ccc-syntax does not exist)
|
||||
|
@ -276,6 +290,14 @@ ifneq ($(strip $(WITH_SYNTAX_CHECK)),)
|
|||
endif
|
||||
endif
|
||||
|
||||
# WITH_STATIC_ANALYZER trumps WITH_SYNTAX_CHECK
|
||||
ifneq ($(strip $(WITH_STATIC_ANALYZER)),)
|
||||
ifneq ($(strip $(WITH_SYNTAX_CHECK)),)
|
||||
$(warning *** Disable WITH_SYNTAX_CHECK in the presence of static analyzer WITH_STATIC_ANALYZER)
|
||||
WITH_SYNTAX_CHECK :=
|
||||
endif
|
||||
endif
|
||||
|
||||
# Pick a Java compiler.
|
||||
include $(BUILD_SYSTEM)/combo/javac.mk
|
||||
|
||||
|
|
43
envsetup.sh
43
envsetup.sh
|
@ -603,11 +603,26 @@ function gettop
|
|||
fi
|
||||
}
|
||||
|
||||
# Return driver for "make", if any (eg. static analyzer)
|
||||
function getdriver()
|
||||
{
|
||||
local T="$1"
|
||||
test "$WITH_STATIC_ANALYZER" = "0" && unset WITH_STATIC_ANALYZER
|
||||
if [ -n "$WITH_STATIC_ANALYZER" ]; then
|
||||
echo "\
|
||||
$T/prebuilts/clang/linux-x86/host/3.3/tools/scan-build/scan-build \
|
||||
--use-analyzer $T/prebuilts/clang/linux-x86/host/3.3/bin/clang \
|
||||
--status-bugs \
|
||||
--top=$T"
|
||||
fi
|
||||
}
|
||||
|
||||
function m()
|
||||
{
|
||||
T=$(gettop)
|
||||
local T=$(gettop)
|
||||
local DRV=$(getdriver $T)
|
||||
if [ "$T" ]; then
|
||||
make -C $T -f build/core/main.mk $@
|
||||
$DRV make -C $T -f build/core/main.mk $@
|
||||
else
|
||||
echo "Couldn't locate the top of the tree. Try setting TOP."
|
||||
fi
|
||||
|
@ -632,13 +647,14 @@ function findmakefile()
|
|||
|
||||
function mm()
|
||||
{
|
||||
local T=$(gettop)
|
||||
local DRV=$(getdriver $T)
|
||||
# If we're sitting in the root of the build tree, just do a
|
||||
# normal make.
|
||||
if [ -f build/core/envsetup.mk -a -f Makefile ]; then
|
||||
make $@
|
||||
$DRV make $@
|
||||
else
|
||||
# Find the closest Android.mk file.
|
||||
T=$(gettop)
|
||||
local M=$(findmakefile)
|
||||
local MODULES=
|
||||
local GET_INSTALL_PATH=
|
||||
|
@ -662,14 +678,15 @@ function mm()
|
|||
MODULES=all_modules
|
||||
ARGS=$@
|
||||
fi
|
||||
ONE_SHOT_MAKEFILE=$M make -C $T -f build/core/main.mk $MODULES $ARGS
|
||||
ONE_SHOT_MAKEFILE=$M $DRV make -C $T -f build/core/main.mk $MODULES $ARGS
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
function mmm()
|
||||
{
|
||||
T=$(gettop)
|
||||
local T=$(gettop)
|
||||
local DRV=$(getdriver $T)
|
||||
if [ "$T" ]; then
|
||||
local MAKEFILE=
|
||||
local MODULES=
|
||||
|
@ -707,7 +724,7 @@ function mmm()
|
|||
ARGS=$GET_INSTALL_PATH
|
||||
MODULES=
|
||||
fi
|
||||
ONE_SHOT_MAKEFILE="$MAKEFILE" make -C $T -f build/core/main.mk $DASH_ARGS $MODULES $ARGS
|
||||
ONE_SHOT_MAKEFILE="$MAKEFILE" $DRV make -C $T -f build/core/main.mk $DASH_ARGS $MODULES $ARGS
|
||||
else
|
||||
echo "Couldn't locate the top of the tree. Try setting TOP."
|
||||
fi
|
||||
|
@ -715,21 +732,23 @@ function mmm()
|
|||
|
||||
function mma()
|
||||
{
|
||||
local T=$(gettop)
|
||||
local DRV=$(getdriver $T)
|
||||
if [ -f build/core/envsetup.mk -a -f Makefile ]; then
|
||||
make $@
|
||||
$DRV make $@
|
||||
else
|
||||
T=$(gettop)
|
||||
if [ ! "$T" ]; then
|
||||
echo "Couldn't locate the top of the tree. Try setting TOP."
|
||||
fi
|
||||
local MY_PWD=`PWD= /bin/pwd|sed 's:'$T'/::'`
|
||||
make -C $T -f build/core/main.mk $@ all_modules BUILD_MODULES_IN_PATHS="$MY_PWD"
|
||||
$DRV make -C $T -f build/core/main.mk $@ all_modules BUILD_MODULES_IN_PATHS="$MY_PWD"
|
||||
fi
|
||||
}
|
||||
|
||||
function mmma()
|
||||
{
|
||||
T=$(gettop)
|
||||
local T=$(gettop)
|
||||
local DRV=$(getdriver $T)
|
||||
if [ "$T" ]; then
|
||||
local DASH_ARGS=$(echo "$@" | awk -v RS=" " -v ORS=" " '/^-.*$/')
|
||||
local DIRS=$(echo "$@" | awk -v RS=" " -v ORS=" " '/^[^-].*$/')
|
||||
|
@ -756,7 +775,7 @@ function mmma()
|
|||
esac
|
||||
fi
|
||||
done
|
||||
make -C $T -f build/core/main.mk $DASH_ARGS $ARGS all_modules BUILD_MODULES_IN_PATHS="$MODULE_PATHS"
|
||||
$DRV make -C $T -f build/core/main.mk $DASH_ARGS $ARGS all_modules BUILD_MODULES_IN_PATHS="$MODULE_PATHS"
|
||||
else
|
||||
echo "Couldn't locate the top of the tree. Try setting TOP."
|
||||
fi
|
||||
|
|
Loading…
Reference in New Issue