| 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 |  | 
| Nick Kralevich | 0ab21d3 | 2011-11-11 09:02:01 -0800 | [diff] [blame] | 12 | # Add the ARM toolchain bin dir if it actually exists | 
| Jeff Brown | e33ba4c | 2011-07-11 22:11:46 -0700 | [diff] [blame] | 13 | ifneq ($(wildcard $(PWD)/prebuilt/$(HOST_PREBUILT_TAG)/toolchain/arm-linux-androideabi-4.4.x/bin),) | 
|  | 14 | # this should be copied to HOST_OUT_EXECUTABLES instead | 
|  | 15 | ABP:=$(ABP):$(PWD)/prebuilt/$(HOST_PREBUILT_TAG)/toolchain/arm-linux-androideabi-4.4.x/bin | 
| Bruce Beare | b73dc66 | 2010-07-12 07:53:28 -0700 | [diff] [blame] | 16 | endif | 
| Nick Kralevich | 0ab21d3 | 2011-11-11 09:02:01 -0800 | [diff] [blame] | 17 |  | 
|  | 18 | # Add the x86 toolchain bin dir if it actually exists | 
|  | 19 | ifneq ($(wildcard $(PWD)/prebuilt/$(HOST_PREBUILT_TAG)/toolchain/i686-android-linux-4.4.3/bin),) | 
|  | 20 | # this should be copied to HOST_OUT_EXECUTABLES instead | 
|  | 21 | ABP:=$(ABP):$(PWD)/prebuilt/$(HOST_PREBUILT_TAG)/toolchain/i686-android-linux-4.4.3/bin | 
|  | 22 | endif | 
| Bruce Beare | b73dc66 | 2010-07-12 07:53:28 -0700 | [diff] [blame] | 23 | ANDROID_BUILD_PATHS := $(ABP) | 
|  | 24 | ANDROID_PREBUILTS := prebuilt/$(HOST_PREBUILT_TAG) | 
|  | 25 |  | 
|  | 26 | # The "dumpvar" stuff lets you say something like | 
|  | 27 | # | 
|  | 28 | #     CALLED_FROM_SETUP=true \ | 
|  | 29 | #       make -f config/envsetup.make dumpvar-TARGET_OUT | 
|  | 30 | # or | 
|  | 31 | #     CALLED_FROM_SETUP=true \ | 
|  | 32 | #       make -f config/envsetup.make dumpvar-abs-HOST_OUT_EXECUTABLES | 
|  | 33 | # | 
|  | 34 | # The plain (non-abs) version just dumps the value of the named variable. | 
|  | 35 | # The "abs" version will treat the variable as a path, and dumps an | 
|  | 36 | # absolute path to it. | 
|  | 37 | # | 
|  | 38 | dumpvar_goals := \ | 
|  | 39 | $(strip $(patsubst dumpvar-%,%,$(filter dumpvar-%,$(MAKECMDGOALS)))) | 
|  | 40 | ifdef dumpvar_goals | 
|  | 41 |  | 
|  | 42 | ifneq ($(words $(dumpvar_goals)),1) | 
|  | 43 | $(error Only one "dumpvar-" goal allowed. Saw "$(MAKECMDGOALS)") | 
|  | 44 | endif | 
|  | 45 |  | 
|  | 46 | # If the goal is of the form "dumpvar-abs-VARNAME", then | 
|  | 47 | # treat VARNAME as a path and return the absolute path to it. | 
|  | 48 | absolute_dumpvar := $(strip $(filter abs-%,$(dumpvar_goals))) | 
|  | 49 | ifdef absolute_dumpvar | 
|  | 50 | dumpvar_goals := $(patsubst abs-%,%,$(dumpvar_goals)) | 
| Jean-Baptiste Queru | 8af0efd | 2011-12-06 16:32:40 -0800 | [diff] [blame] | 51 | ifneq ($(filter /%,$($(dumpvar_goals))),) | 
|  | 52 | DUMPVAR_VALUE := $($(dumpvar_goals)) | 
|  | 53 | else | 
|  | 54 | DUMPVAR_VALUE := $(PWD)/$($(dumpvar_goals)) | 
|  | 55 | endif | 
| Bruce Beare | b73dc66 | 2010-07-12 07:53:28 -0700 | [diff] [blame] | 56 | dumpvar_target := dumpvar-abs-$(dumpvar_goals) | 
|  | 57 | else | 
|  | 58 | DUMPVAR_VALUE := $($(dumpvar_goals)) | 
|  | 59 | dumpvar_target := dumpvar-$(dumpvar_goals) | 
|  | 60 | endif | 
|  | 61 |  | 
|  | 62 | .PHONY: $(dumpvar_target) | 
|  | 63 | $(dumpvar_target): | 
|  | 64 | @echo $(DUMPVAR_VALUE) | 
|  | 65 |  | 
|  | 66 | endif # dumpvar_goals | 
|  | 67 |  | 
|  | 68 | ifneq ($(dumpvar_goals),report_config) | 
|  | 69 | PRINT_BUILD_CONFIG:= | 
|  | 70 | endif | 
|  | 71 |  | 
|  | 72 | endif # CALLED_FROM_SETUP | 
|  | 73 |  | 
|  | 74 |  | 
|  | 75 | ifneq ($(PRINT_BUILD_CONFIG),) | 
|  | 76 | $(info ============================================) | 
|  | 77 | $(info   PLATFORM_VERSION_CODENAME=$(PLATFORM_VERSION_CODENAME)) | 
|  | 78 | $(info   PLATFORM_VERSION=$(PLATFORM_VERSION)) | 
|  | 79 | $(info   TARGET_PRODUCT=$(TARGET_PRODUCT)) | 
|  | 80 | $(info   TARGET_BUILD_VARIANT=$(TARGET_BUILD_VARIANT)) | 
| Bruce Beare | b73dc66 | 2010-07-12 07:53:28 -0700 | [diff] [blame] | 81 | $(info   TARGET_BUILD_TYPE=$(TARGET_BUILD_TYPE)) | 
|  | 82 | $(info   TARGET_BUILD_APPS=$(TARGET_BUILD_APPS)) | 
|  | 83 | $(info   TARGET_ARCH=$(TARGET_ARCH)) | 
| Bruce Beare | 8ee0dfd | 2010-10-14 12:21:58 -0700 | [diff] [blame] | 84 | $(info   TARGET_ARCH_VARIANT=$(TARGET_ARCH_VARIANT)) | 
| Bruce Beare | b73dc66 | 2010-07-12 07:53:28 -0700 | [diff] [blame] | 85 | $(info   HOST_ARCH=$(HOST_ARCH)) | 
|  | 86 | $(info   HOST_OS=$(HOST_OS)) | 
|  | 87 | $(info   HOST_BUILD_TYPE=$(HOST_BUILD_TYPE)) | 
|  | 88 | $(info   BUILD_ID=$(BUILD_ID)) | 
| Jean-Baptiste Queru | ffe03c9 | 2011-12-06 10:29:46 -0800 | [diff] [blame] | 89 | $(info   OUT_DIR=$(OUT_DIR)) | 
| Bruce Beare | b73dc66 | 2010-07-12 07:53:28 -0700 | [diff] [blame] | 90 | $(info ============================================) | 
|  | 91 | endif |