blob: 0f7dd8f0ff75cea9cf456232153ddd4ae4217ab7 [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
Jing Yuf5172c72012-03-29 20:45:50 -070013ifneq ($(wildcard $(PWD)/prebuilts/gcc/$(HOST_PREBUILT_TAG)/arm/arm-linux-androideabi-4.6/bin),)
Jeff Browne33ba4c2011-07-11 22:11:46 -070014 # this should be copied to HOST_OUT_EXECUTABLES instead
Jing Yuf5172c72012-03-29 20:45:50 -070015 ABP:=$(ABP):$(PWD)/prebuilts/gcc/$(HOST_PREBUILT_TAG)/arm/arm-linux-androideabi-4.6/bin
Bruce Beareb73dc662010-07-12 07:53:28 -070016endif
Nick Kralevich0ab21d32011-11-11 09:02:01 -080017
18# Add the x86 toolchain bin dir if it actually exists
Jean-Baptiste Queruea91f0a2012-01-09 13:02:03 -080019ifneq ($(wildcard $(PWD)/prebuilts/gcc/$(HOST_PREBUILT_TAG)/x86/i686-android-linux-4.4.3/bin),)
Nick Kralevich0ab21d32011-11-11 09:02:01 -080020 # this should be copied to HOST_OUT_EXECUTABLES instead
Jing Yuf5172c72012-03-29 20:45:50 -070021 ABP:=$(ABP):$(PWD)/prebuilts/gcc/$(HOST_PREBUILT_TAG)/x86/i686-android-linux-4.4.3/bin
Nick Kralevich0ab21d32011-11-11 09:02:01 -080022endif
Bruce Beareb73dc662010-07-12 07:53:28 -070023ANDROID_BUILD_PATHS := $(ABP)
24ANDROID_PREBUILTS := prebuilt/$(HOST_PREBUILT_TAG)
Jing Yuf5172c72012-03-29 20:45:50 -070025ANDROID_GCC_PREBUILTS := prebuilts/gcc/$(HOST_PREBUILT_TAG)
Bruce Beareb73dc662010-07-12 07:53:28 -070026
27# The "dumpvar" stuff lets you say something like
28#
29# CALLED_FROM_SETUP=true \
30# make -f config/envsetup.make dumpvar-TARGET_OUT
31# or
32# CALLED_FROM_SETUP=true \
33# make -f config/envsetup.make dumpvar-abs-HOST_OUT_EXECUTABLES
34#
35# The plain (non-abs) version just dumps the value of the named variable.
36# The "abs" version will treat the variable as a path, and dumps an
37# absolute path to it.
38#
39dumpvar_goals := \
40 $(strip $(patsubst dumpvar-%,%,$(filter dumpvar-%,$(MAKECMDGOALS))))
41ifdef dumpvar_goals
42
43 ifneq ($(words $(dumpvar_goals)),1)
44 $(error Only one "dumpvar-" goal allowed. Saw "$(MAKECMDGOALS)")
45 endif
46
47 # If the goal is of the form "dumpvar-abs-VARNAME", then
48 # treat VARNAME as a path and return the absolute path to it.
49 absolute_dumpvar := $(strip $(filter abs-%,$(dumpvar_goals)))
50 ifdef absolute_dumpvar
51 dumpvar_goals := $(patsubst abs-%,%,$(dumpvar_goals))
Jean-Baptiste Queru8af0efd2011-12-06 16:32:40 -080052 ifneq ($(filter /%,$($(dumpvar_goals))),)
53 DUMPVAR_VALUE := $($(dumpvar_goals))
54 else
55 DUMPVAR_VALUE := $(PWD)/$($(dumpvar_goals))
56 endif
Bruce Beareb73dc662010-07-12 07:53:28 -070057 dumpvar_target := dumpvar-abs-$(dumpvar_goals)
58 else
59 DUMPVAR_VALUE := $($(dumpvar_goals))
60 dumpvar_target := dumpvar-$(dumpvar_goals)
61 endif
62
63.PHONY: $(dumpvar_target)
64$(dumpvar_target):
65 @echo $(DUMPVAR_VALUE)
66
67endif # dumpvar_goals
68
69ifneq ($(dumpvar_goals),report_config)
70PRINT_BUILD_CONFIG:=
71endif
72
73endif # CALLED_FROM_SETUP
74
75
76ifneq ($(PRINT_BUILD_CONFIG),)
Conley Owens5f1c9ba2012-02-07 11:16:42 -080077HOST_OS_EXTRA:=$(shell python -c "import platform; print(platform.platform())")
Bruce Beareb73dc662010-07-12 07:53:28 -070078$(info ============================================)
79$(info PLATFORM_VERSION_CODENAME=$(PLATFORM_VERSION_CODENAME))
80$(info PLATFORM_VERSION=$(PLATFORM_VERSION))
81$(info TARGET_PRODUCT=$(TARGET_PRODUCT))
82$(info TARGET_BUILD_VARIANT=$(TARGET_BUILD_VARIANT))
Bruce Beareb73dc662010-07-12 07:53:28 -070083$(info TARGET_BUILD_TYPE=$(TARGET_BUILD_TYPE))
84$(info TARGET_BUILD_APPS=$(TARGET_BUILD_APPS))
85$(info TARGET_ARCH=$(TARGET_ARCH))
Bruce Beare8ee0dfd2010-10-14 12:21:58 -070086$(info TARGET_ARCH_VARIANT=$(TARGET_ARCH_VARIANT))
Bruce Beareb73dc662010-07-12 07:53:28 -070087$(info HOST_ARCH=$(HOST_ARCH))
88$(info HOST_OS=$(HOST_OS))
Conley Owens5f1c9ba2012-02-07 11:16:42 -080089$(info HOST_OS_EXTRA=$(HOST_OS_EXTRA))
Bruce Beareb73dc662010-07-12 07:53:28 -070090$(info HOST_BUILD_TYPE=$(HOST_BUILD_TYPE))
91$(info BUILD_ID=$(BUILD_ID))
Jean-Baptiste Queruffe03c92011-12-06 10:29:46 -080092$(info OUT_DIR=$(OUT_DIR))
Bruce Beareb73dc662010-07-12 07:53:28 -070093$(info ============================================)
94endif