Bruce Beare | b73dc66 | 2010-07-12 07:53:28 -0700 | [diff] [blame] | 1 | # --------------------------------------------------------------- |
| 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. |
| 4 | ifeq ($(CALLED_FROM_SETUP),true) |
| 5 | |
Jean-Baptiste Queru | ffe03c9 | 2011-12-06 10:29:46 -0800 | [diff] [blame] | 6 | ifneq ($(filter /%,$(HOST_OUT_EXECUTABLES)),) |
| 7 | ABP:=$(HOST_OUT_EXECUTABLES) |
| 8 | else |
Bruce Beare | b73dc66 | 2010-07-12 07:53:28 -0700 | [diff] [blame] | 9 | ABP:=$(PWD)/$(HOST_OUT_EXECUTABLES) |
Jean-Baptiste Queru | ffe03c9 | 2011-12-06 10:29:46 -0800 | [diff] [blame] | 10 | endif |
Bruce Beare | b73dc66 | 2010-07-12 07:53:28 -0700 | [diff] [blame] | 11 | |
Bruce Beare | b73dc66 | 2010-07-12 07:53:28 -0700 | [diff] [blame] | 12 | ANDROID_BUILD_PATHS := $(ABP) |
| 13 | ANDROID_PREBUILTS := prebuilt/$(HOST_PREBUILT_TAG) |
Jing Yu | f5172c7 | 2012-03-29 20:45:50 -0700 | [diff] [blame] | 14 | ANDROID_GCC_PREBUILTS := prebuilts/gcc/$(HOST_PREBUILT_TAG) |
Bruce Beare | b73dc66 | 2010-07-12 07:53:28 -0700 | [diff] [blame] | 15 | |
| 16 | # The "dumpvar" stuff lets you say something like |
| 17 | # |
| 18 | # CALLED_FROM_SETUP=true \ |
| 19 | # make -f config/envsetup.make dumpvar-TARGET_OUT |
| 20 | # or |
| 21 | # CALLED_FROM_SETUP=true \ |
| 22 | # make -f config/envsetup.make dumpvar-abs-HOST_OUT_EXECUTABLES |
| 23 | # |
| 24 | # The plain (non-abs) version just dumps the value of the named variable. |
| 25 | # The "abs" version will treat the variable as a path, and dumps an |
| 26 | # absolute path to it. |
| 27 | # |
| 28 | dumpvar_goals := \ |
| 29 | $(strip $(patsubst dumpvar-%,%,$(filter dumpvar-%,$(MAKECMDGOALS)))) |
| 30 | ifdef dumpvar_goals |
| 31 | |
| 32 | ifneq ($(words $(dumpvar_goals)),1) |
| 33 | $(error Only one "dumpvar-" goal allowed. Saw "$(MAKECMDGOALS)") |
| 34 | endif |
| 35 | |
| 36 | # If the goal is of the form "dumpvar-abs-VARNAME", then |
| 37 | # treat VARNAME as a path and return the absolute path to it. |
| 38 | absolute_dumpvar := $(strip $(filter abs-%,$(dumpvar_goals))) |
| 39 | ifdef absolute_dumpvar |
| 40 | dumpvar_goals := $(patsubst abs-%,%,$(dumpvar_goals)) |
Jean-Baptiste Queru | 8af0efd | 2011-12-06 16:32:40 -0800 | [diff] [blame] | 41 | ifneq ($(filter /%,$($(dumpvar_goals))),) |
| 42 | DUMPVAR_VALUE := $($(dumpvar_goals)) |
| 43 | else |
| 44 | DUMPVAR_VALUE := $(PWD)/$($(dumpvar_goals)) |
| 45 | endif |
Bruce Beare | b73dc66 | 2010-07-12 07:53:28 -0700 | [diff] [blame] | 46 | dumpvar_target := dumpvar-abs-$(dumpvar_goals) |
| 47 | else |
| 48 | DUMPVAR_VALUE := $($(dumpvar_goals)) |
| 49 | dumpvar_target := dumpvar-$(dumpvar_goals) |
| 50 | endif |
| 51 | |
| 52 | .PHONY: $(dumpvar_target) |
| 53 | $(dumpvar_target): |
| 54 | @echo $(DUMPVAR_VALUE) |
| 55 | |
| 56 | endif # dumpvar_goals |
| 57 | |
| 58 | ifneq ($(dumpvar_goals),report_config) |
| 59 | PRINT_BUILD_CONFIG:= |
| 60 | endif |
| 61 | |
| 62 | endif # CALLED_FROM_SETUP |
| 63 | |
| 64 | |
| 65 | ifneq ($(PRINT_BUILD_CONFIG),) |
Conley Owens | 5f1c9ba | 2012-02-07 11:16:42 -0800 | [diff] [blame] | 66 | HOST_OS_EXTRA:=$(shell python -c "import platform; print(platform.platform())") |
Bruce Beare | b73dc66 | 2010-07-12 07:53:28 -0700 | [diff] [blame] | 67 | $(info ============================================) |
| 68 | $(info PLATFORM_VERSION_CODENAME=$(PLATFORM_VERSION_CODENAME)) |
| 69 | $(info PLATFORM_VERSION=$(PLATFORM_VERSION)) |
| 70 | $(info TARGET_PRODUCT=$(TARGET_PRODUCT)) |
| 71 | $(info TARGET_BUILD_VARIANT=$(TARGET_BUILD_VARIANT)) |
Bruce Beare | b73dc66 | 2010-07-12 07:53:28 -0700 | [diff] [blame] | 72 | $(info TARGET_BUILD_TYPE=$(TARGET_BUILD_TYPE)) |
| 73 | $(info TARGET_BUILD_APPS=$(TARGET_BUILD_APPS)) |
| 74 | $(info TARGET_ARCH=$(TARGET_ARCH)) |
Bruce Beare | 8ee0dfd | 2010-10-14 12:21:58 -0700 | [diff] [blame] | 75 | $(info TARGET_ARCH_VARIANT=$(TARGET_ARCH_VARIANT)) |
Ben Cheng | 7028f5e | 2013-01-15 14:36:42 -0800 | [diff] [blame] | 76 | $(info TARGET_CPU_VARIANT=$(TARGET_CPU_VARIANT)) |
Christopher Ferris | 4fe22ae | 2014-05-14 18:21:34 -0700 | [diff] [blame] | 77 | $(info TARGET_2ND_ARCH=$(TARGET_2ND_ARCH)) |
| 78 | $(info TARGET_2ND_ARCH_VARIANT=$(TARGET_2ND_ARCH_VARIANT)) |
| 79 | $(info TARGET_2ND_CPU_VARIANT=$(TARGET_2ND_CPU_VARIANT)) |
Bruce Beare | b73dc66 | 2010-07-12 07:53:28 -0700 | [diff] [blame] | 80 | $(info HOST_ARCH=$(HOST_ARCH)) |
| 81 | $(info HOST_OS=$(HOST_OS)) |
Conley Owens | 5f1c9ba | 2012-02-07 11:16:42 -0800 | [diff] [blame] | 82 | $(info HOST_OS_EXTRA=$(HOST_OS_EXTRA)) |
Bruce Beare | b73dc66 | 2010-07-12 07:53:28 -0700 | [diff] [blame] | 83 | $(info HOST_BUILD_TYPE=$(HOST_BUILD_TYPE)) |
| 84 | $(info BUILD_ID=$(BUILD_ID)) |
Jean-Baptiste Queru | ffe03c9 | 2011-12-06 10:29:46 -0800 | [diff] [blame] | 85 | $(info OUT_DIR=$(OUT_DIR)) |
Bruce Beare | b73dc66 | 2010-07-12 07:53:28 -0700 | [diff] [blame] | 86 | $(info ============================================) |
| 87 | endif |