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. 4ifeq ($(CALLED_FROM_SETUP),true) 5 6ifneq ($(filter /%,$(HOST_OUT_EXECUTABLES)),) 7ABP:=$(HOST_OUT_EXECUTABLES) 8else 9ABP:=$(PWD)/$(HOST_OUT_EXECUTABLES) 10endif 11 12ANDROID_BUILD_PATHS := $(ABP) 13ANDROID_PREBUILTS := prebuilt/$(HOST_PREBUILT_TAG) 14ANDROID_GCC_PREBUILTS := prebuilts/gcc/$(HOST_PREBUILT_TAG) 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# 28dumpvar_goals := \ 29 $(strip $(patsubst dumpvar-%,%,$(filter dumpvar-%,$(MAKECMDGOALS)))) 30ifdef 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)) 41 ifneq ($(filter /%,$($(dumpvar_goals))),) 42 DUMPVAR_VALUE := $($(dumpvar_goals)) 43 else 44 DUMPVAR_VALUE := $(PWD)/$($(dumpvar_goals)) 45 endif 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 56endif # dumpvar_goals 57 58ifneq ($(dumpvar_goals),report_config) 59PRINT_BUILD_CONFIG:= 60endif 61 62endif # CALLED_FROM_SETUP 63 64 65ifneq ($(PRINT_BUILD_CONFIG),) 66HOST_OS_EXTRA:=$(shell python -c "import platform; print(platform.platform())") 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)) 72$(info TARGET_BUILD_TYPE=$(TARGET_BUILD_TYPE)) 73$(info TARGET_BUILD_APPS=$(TARGET_BUILD_APPS)) 74$(info TARGET_ARCH=$(TARGET_ARCH)) 75$(info TARGET_ARCH_VARIANT=$(TARGET_ARCH_VARIANT)) 76$(info TARGET_CPU_VARIANT=$(TARGET_CPU_VARIANT)) 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)) 80$(info HOST_ARCH=$(HOST_ARCH)) 81$(info HOST_OS=$(HOST_OS)) 82$(info HOST_OS_EXTRA=$(HOST_OS_EXTRA)) 83$(info HOST_BUILD_TYPE=$(HOST_BUILD_TYPE)) 84$(info BUILD_ID=$(BUILD_ID)) 85$(info OUT_DIR=$(OUT_DIR)) 86$(info ============================================) 87endif 88