blob: 8c3223b36c95e58155ca1ae2b303785892269838 [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)
David Eddlemon1d801a32013-09-17 22:53:00 +040014 ifneq ($(wildcard $(PWD)/prebuilts/gcc/$(HOST_PREBUILT_TAG)/arm/arm-linux-androideabi-$(TARGET_GCC_VERSION_AND)/bin),)
Bruce Beare42ced6d2012-07-17 21:40:01 -070015 # this should be copied to HOST_OUT_EXECUTABLES instead
David Eddlemon1d801a32013-09-17 22:53:00 +040016 ABP:=$(ABP):$(PWD)/prebuilts/gcc/$(HOST_PREBUILT_TAG)/arm/arm-linux-androideabi-$(TARGET_GCC_VERSION_AND)/bin
Bruce Beare42ced6d2012-07-17 21:40:01 -070017 endif
David Eddlemon1d801a32013-09-17 22:53:00 +040018 ifneq ($(wildcard $(PWD)/prebuilts/gcc/$(HOST_PREBUILT_TAG)/arm/arm-eabi-$(TARGET_GCC_VERSION_ARM)/bin),)
Ben Cheng8bc4c432012-11-16 13:29:13 -080019 # this should be copied to HOST_OUT_EXECUTABLES instead
David Eddlemon1d801a32013-09-17 22:53:00 +040020 ABP:=$(ABP):$(PWD)/prebuilts/gcc/$(HOST_PREBUILT_TAG)/arm/arm-eabi-$(TARGET_GCC_VERSION_ARM)/bin
Ben Cheng8bc4c432012-11-16 13:29:13 -080021 endif
Bruce Beare42ced6d2012-07-17 21:40:01 -070022else ifeq ($(TARGET_ARCH),x86)
Nick Kralevich0ab21d32011-11-11 09:02:01 -080023
24# Add the x86 toolchain bin dir if it actually exists
David Eddlemon1d801a32013-09-17 22:53:00 +040025 ifneq ($(wildcard $(PWD)/prebuilts/gcc/$(HOST_PREBUILT_TAG)/x86/i686-linux-android-$(TARGET_GCC_VERSION_AND)/bin),)
Bruce Beare42ced6d2012-07-17 21:40:01 -070026 # this should be copied to HOST_OUT_EXECUTABLES instead
David Eddlemon1d801a32013-09-17 22:53:00 +040027 ABP:=$(ABP):$(PWD)/prebuilts/gcc/$(HOST_PREBUILT_TAG)/x86/i686-linux-android-$(TARGET_GCC_VERSION_AND)/bin
Bruce Beare42ced6d2012-07-17 21:40:01 -070028 endif
Nick Kralevich0ab21d32011-11-11 09:02:01 -080029endif
Raghu Gandham8da43102012-07-25 19:57:22 -070030
31# Add the mips toolchain bin dir if it actually exists
David Eddlemon1d801a32013-09-17 22:53:00 +040032ifneq ($(wildcard $(PWD)/prebuilts/gcc/$(HOST_PREBUILT_TAG)/mips/mipsel-linux-android-$(TARGET_GCC_VERSION_AND)/bin),)
Raghu Gandham8da43102012-07-25 19:57:22 -070033 # this should be copied to HOST_OUT_EXECUTABLES instead
David Eddlemon1d801a32013-09-17 22:53:00 +040034 ABP:=$(ABP):$(PWD)/prebuilts/gcc/$(HOST_PREBUILT_TAG)/mips/mipsel-linux-android-$(TARGET_GCC_VERSION_AND)/bin
Raghu Gandham8da43102012-07-25 19:57:22 -070035endif
36
Bruce Beareb73dc662010-07-12 07:53:28 -070037ANDROID_BUILD_PATHS := $(ABP)
38ANDROID_PREBUILTS := prebuilt/$(HOST_PREBUILT_TAG)
Jing Yuf5172c72012-03-29 20:45:50 -070039ANDROID_GCC_PREBUILTS := prebuilts/gcc/$(HOST_PREBUILT_TAG)
Bruce Beareb73dc662010-07-12 07:53:28 -070040
41# The "dumpvar" stuff lets you say something like
42#
43# CALLED_FROM_SETUP=true \
44# make -f config/envsetup.make dumpvar-TARGET_OUT
45# or
46# CALLED_FROM_SETUP=true \
47# make -f config/envsetup.make dumpvar-abs-HOST_OUT_EXECUTABLES
48#
49# The plain (non-abs) version just dumps the value of the named variable.
50# The "abs" version will treat the variable as a path, and dumps an
51# absolute path to it.
52#
53dumpvar_goals := \
54 $(strip $(patsubst dumpvar-%,%,$(filter dumpvar-%,$(MAKECMDGOALS))))
55ifdef dumpvar_goals
56
57 ifneq ($(words $(dumpvar_goals)),1)
58 $(error Only one "dumpvar-" goal allowed. Saw "$(MAKECMDGOALS)")
59 endif
60
61 # If the goal is of the form "dumpvar-abs-VARNAME", then
62 # treat VARNAME as a path and return the absolute path to it.
63 absolute_dumpvar := $(strip $(filter abs-%,$(dumpvar_goals)))
64 ifdef absolute_dumpvar
65 dumpvar_goals := $(patsubst abs-%,%,$(dumpvar_goals))
Jean-Baptiste Queru8af0efd2011-12-06 16:32:40 -080066 ifneq ($(filter /%,$($(dumpvar_goals))),)
67 DUMPVAR_VALUE := $($(dumpvar_goals))
68 else
69 DUMPVAR_VALUE := $(PWD)/$($(dumpvar_goals))
70 endif
Bruce Beareb73dc662010-07-12 07:53:28 -070071 dumpvar_target := dumpvar-abs-$(dumpvar_goals)
72 else
73 DUMPVAR_VALUE := $($(dumpvar_goals))
74 dumpvar_target := dumpvar-$(dumpvar_goals)
75 endif
76
77.PHONY: $(dumpvar_target)
78$(dumpvar_target):
79 @echo $(DUMPVAR_VALUE)
80
81endif # dumpvar_goals
82
83ifneq ($(dumpvar_goals),report_config)
84PRINT_BUILD_CONFIG:=
85endif
86
87endif # CALLED_FROM_SETUP
88
89
90ifneq ($(PRINT_BUILD_CONFIG),)
Conley Owens5f1c9ba2012-02-07 11:16:42 -080091HOST_OS_EXTRA:=$(shell python -c "import platform; print(platform.platform())")
Bruce Beareb73dc662010-07-12 07:53:28 -070092$(info ============================================)
93$(info PLATFORM_VERSION_CODENAME=$(PLATFORM_VERSION_CODENAME))
94$(info PLATFORM_VERSION=$(PLATFORM_VERSION))
broodplankcd17a182014-02-07 00:53:41 +010095$(info KERNEL_VERSION=$(KERNEL_VERSION))
Bruce Beareb73dc662010-07-12 07:53:28 -070096$(info TARGET_PRODUCT=$(TARGET_PRODUCT))
97$(info TARGET_BUILD_VARIANT=$(TARGET_BUILD_VARIANT))
Bruce Beareb73dc662010-07-12 07:53:28 -070098$(info TARGET_BUILD_TYPE=$(TARGET_BUILD_TYPE))
99$(info TARGET_BUILD_APPS=$(TARGET_BUILD_APPS))
100$(info TARGET_ARCH=$(TARGET_ARCH))
Bruce Beare8ee0dfd2010-10-14 12:21:58 -0700101$(info TARGET_ARCH_VARIANT=$(TARGET_ARCH_VARIANT))
Ben Cheng7028f5e2013-01-15 14:36:42 -0800102$(info TARGET_CPU_VARIANT=$(TARGET_CPU_VARIANT))
Donald Hoskins45ad7a92014-03-03 12:46:02 -0500103$(info TARGET_GCC_VERSION_AND=$(TARGET_GCC_VERSION_AND))
104$(info TARGET_GCC_VERSION_ARM=$(TARGET_GCC_VERSION_ARM))
Bruce Beareb73dc662010-07-12 07:53:28 -0700105$(info HOST_ARCH=$(HOST_ARCH))
106$(info HOST_OS=$(HOST_OS))
Conley Owens5f1c9ba2012-02-07 11:16:42 -0800107$(info HOST_OS_EXTRA=$(HOST_OS_EXTRA))
Bruce Beareb73dc662010-07-12 07:53:28 -0700108$(info HOST_BUILD_TYPE=$(HOST_BUILD_TYPE))
109$(info BUILD_ID=$(BUILD_ID))
Jean-Baptiste Queruffe03c92011-12-06 10:29:46 -0800110$(info OUT_DIR=$(OUT_DIR))
Bruce Beareb73dc662010-07-12 07:53:28 -0700111$(info ============================================)
112endif