blob: c47aa0f6c23d07a52e1d55493986435df16afbdf [file] [log] [blame]
Bruce Beareb73dc662010-07-12 07:53:28 -07001# ---------------------------------------------------------------
2# the setpath shell function in envsetup.sh uses this to figure out
3# what to add to the path given the config we have chosen.
4ifeq ($(CALLED_FROM_SETUP),true)
5
Jean-Baptiste Queruffe03c92011-12-06 10:29:46 -08006ifneq ($(filter /%,$(HOST_OUT_EXECUTABLES)),)
7ABP:=$(HOST_OUT_EXECUTABLES)
8else
Bruce Beareb73dc662010-07-12 07:53:28 -07009ABP:=$(PWD)/$(HOST_OUT_EXECUTABLES)
Jean-Baptiste Queruffe03c92011-12-06 10:29:46 -080010endif
Bruce Beareb73dc662010-07-12 07:53:28 -070011
Nick Kralevich0ab21d32011-11-11 09:02:01 -080012# Add the ARM toolchain bin dir if it actually exists
Bruce Beare42ced6d2012-07-17 21:40:01 -070013ifeq ($(TARGET_ARCH),arm)
Andrew Hsieh06b63ba2012-10-23 12:06:01 +080014 ifneq ($(wildcard $(PWD)/prebuilts/gcc/$(HOST_PREBUILT_TAG)/arm/arm-linux-androideabi-$(TARGET_GCC_VERSION)/bin),)
Bruce Beare42ced6d2012-07-17 21:40:01 -070015 # this should be copied to HOST_OUT_EXECUTABLES instead
Andrew Hsieh06b63ba2012-10-23 12:06:01 +080016 ABP:=$(ABP):$(PWD)/prebuilts/gcc/$(HOST_PREBUILT_TAG)/arm/arm-linux-androideabi-$(TARGET_GCC_VERSION)/bin
Bruce Beare42ced6d2012-07-17 21:40:01 -070017 endif
18else ifeq ($(TARGET_ARCH),x86)
Nick Kralevich0ab21d32011-11-11 09:02:01 -080019
20# Add the x86 toolchain bin dir if it actually exists
Andrew Hsieh06b63ba2012-10-23 12:06:01 +080021 ifneq ($(wildcard $(PWD)/prebuilts/gcc/$(HOST_PREBUILT_TAG)/x86/i686-linux-android-$(TARGET_GCC_VERSION)/bin),)
Bruce Beare42ced6d2012-07-17 21:40:01 -070022 # this should be copied to HOST_OUT_EXECUTABLES instead
Andrew Hsieh06b63ba2012-10-23 12:06:01 +080023 ABP:=$(ABP):$(PWD)/prebuilts/gcc/$(HOST_PREBUILT_TAG)/x86/i686-linux-android-$(TARGET_GCC_VERSION)/bin
Bruce Beare42ced6d2012-07-17 21:40:01 -070024 endif
Nick Kralevich0ab21d32011-11-11 09:02:01 -080025endif
Raghu Gandham8da43102012-07-25 19:57:22 -070026
27# Add the mips toolchain bin dir if it actually exists
Andrew Hsieh06b63ba2012-10-23 12:06:01 +080028ifneq ($(wildcard $(PWD)/prebuilts/gcc/$(HOST_PREBUILT_TAG)/mips/mipsel-linux-android-$(TARGET_GCC_VERSION)/bin),)
Raghu Gandham8da43102012-07-25 19:57:22 -070029 # this should be copied to HOST_OUT_EXECUTABLES instead
Andrew Hsieh06b63ba2012-10-23 12:06:01 +080030 ABP:=$(ABP):$(PWD)/prebuilts/gcc/$(HOST_PREBUILT_TAG)/mips/mipsel-linux-android-$(TARGET_GCC_VERSION)/bin
Raghu Gandham8da43102012-07-25 19:57:22 -070031endif
32
Bruce Beareb73dc662010-07-12 07:53:28 -070033ANDROID_BUILD_PATHS := $(ABP)
34ANDROID_PREBUILTS := prebuilt/$(HOST_PREBUILT_TAG)
Jing Yuf5172c72012-03-29 20:45:50 -070035ANDROID_GCC_PREBUILTS := prebuilts/gcc/$(HOST_PREBUILT_TAG)
Bruce Beareb73dc662010-07-12 07:53:28 -070036
37# The "dumpvar" stuff lets you say something like
38#
39# CALLED_FROM_SETUP=true \
40# make -f config/envsetup.make dumpvar-TARGET_OUT
41# or
42# CALLED_FROM_SETUP=true \
43# make -f config/envsetup.make dumpvar-abs-HOST_OUT_EXECUTABLES
44#
45# The plain (non-abs) version just dumps the value of the named variable.
46# The "abs" version will treat the variable as a path, and dumps an
47# absolute path to it.
48#
49dumpvar_goals := \
50 $(strip $(patsubst dumpvar-%,%,$(filter dumpvar-%,$(MAKECMDGOALS))))
51ifdef dumpvar_goals
52
53 ifneq ($(words $(dumpvar_goals)),1)
54 $(error Only one "dumpvar-" goal allowed. Saw "$(MAKECMDGOALS)")
55 endif
56
57 # If the goal is of the form "dumpvar-abs-VARNAME", then
58 # treat VARNAME as a path and return the absolute path to it.
59 absolute_dumpvar := $(strip $(filter abs-%,$(dumpvar_goals)))
60 ifdef absolute_dumpvar
61 dumpvar_goals := $(patsubst abs-%,%,$(dumpvar_goals))
Jean-Baptiste Queru8af0efd2011-12-06 16:32:40 -080062 ifneq ($(filter /%,$($(dumpvar_goals))),)
63 DUMPVAR_VALUE := $($(dumpvar_goals))
64 else
65 DUMPVAR_VALUE := $(PWD)/$($(dumpvar_goals))
66 endif
Bruce Beareb73dc662010-07-12 07:53:28 -070067 dumpvar_target := dumpvar-abs-$(dumpvar_goals)
68 else
69 DUMPVAR_VALUE := $($(dumpvar_goals))
70 dumpvar_target := dumpvar-$(dumpvar_goals)
71 endif
72
73.PHONY: $(dumpvar_target)
74$(dumpvar_target):
75 @echo $(DUMPVAR_VALUE)
76
77endif # dumpvar_goals
78
79ifneq ($(dumpvar_goals),report_config)
80PRINT_BUILD_CONFIG:=
81endif
82
83endif # CALLED_FROM_SETUP
84
85
86ifneq ($(PRINT_BUILD_CONFIG),)
Conley Owens5f1c9ba2012-02-07 11:16:42 -080087HOST_OS_EXTRA:=$(shell python -c "import platform; print(platform.platform())")
Bruce Beareb73dc662010-07-12 07:53:28 -070088$(info ============================================)
89$(info PLATFORM_VERSION_CODENAME=$(PLATFORM_VERSION_CODENAME))
90$(info PLATFORM_VERSION=$(PLATFORM_VERSION))
91$(info TARGET_PRODUCT=$(TARGET_PRODUCT))
92$(info TARGET_BUILD_VARIANT=$(TARGET_BUILD_VARIANT))
Bruce Beareb73dc662010-07-12 07:53:28 -070093$(info TARGET_BUILD_TYPE=$(TARGET_BUILD_TYPE))
94$(info TARGET_BUILD_APPS=$(TARGET_BUILD_APPS))
95$(info TARGET_ARCH=$(TARGET_ARCH))
Bruce Beare8ee0dfd2010-10-14 12:21:58 -070096$(info TARGET_ARCH_VARIANT=$(TARGET_ARCH_VARIANT))
Bruce Beareb73dc662010-07-12 07:53:28 -070097$(info HOST_ARCH=$(HOST_ARCH))
98$(info HOST_OS=$(HOST_OS))
Conley Owens5f1c9ba2012-02-07 11:16:42 -080099$(info HOST_OS_EXTRA=$(HOST_OS_EXTRA))
Bruce Beareb73dc662010-07-12 07:53:28 -0700100$(info HOST_BUILD_TYPE=$(HOST_BUILD_TYPE))
101$(info BUILD_ID=$(BUILD_ID))
Jean-Baptiste Queruffe03c92011-12-06 10:29:46 -0800102$(info OUT_DIR=$(OUT_DIR))
Bruce Beareb73dc662010-07-12 07:53:28 -0700103$(info ============================================)
104endif