2 # List of variables we want to print in the build banner.
3 print_build_config_vars := \
4 PLATFORM_VERSION_CODENAME \
14 TARGET_2ND_ARCH_VARIANT \
15 TARGET_2ND_CPU_VARIANT \
27 ifeq ($(TARGET_BUILD_PDK),true)
28 print_build_config_vars += \
30 PDK_FUSION_PLATFORM_ZIP
33 # ---------------------------------------------------------------
34 # the setpath shell function in envsetup.sh uses this to figure out
35 # what to add to the path given the config we have chosen.
36 ifeq ($(CALLED_FROM_SETUP),true)
38 ifneq ($(filter /%,$(HOST_OUT_EXECUTABLES)),)
39 ABP:=$(HOST_OUT_EXECUTABLES)
41 ABP:=$(PWD)/$(HOST_OUT_EXECUTABLES)
44 ANDROID_BUILD_PATHS := $(ABP)
45 ANDROID_PREBUILTS := prebuilt/$(HOST_PREBUILT_TAG)
46 ANDROID_GCC_PREBUILTS := prebuilts/gcc/$(HOST_PREBUILT_TAG)
48 # The "dumpvar" stuff lets you say something like
50 # CALLED_FROM_SETUP=true \
51 # make -f config/envsetup.make dumpvar-TARGET_OUT
53 # CALLED_FROM_SETUP=true \
54 # make -f config/envsetup.make dumpvar-abs-HOST_OUT_EXECUTABLES
56 # The plain (non-abs) version just dumps the value of the named variable.
57 # The "abs" version will treat the variable as a path, and dumps an
58 # absolute path to it.
61 $(strip $(patsubst dumpvar-%,%,$(filter dumpvar-%,$(MAKECMDGOALS))))
64 ifneq ($(words $(dumpvar_goals)),1)
65 $(error Only one "dumpvar-" goal allowed. Saw "$(MAKECMDGOALS)")
68 # If the goal is of the form "dumpvar-abs-VARNAME", then
69 # treat VARNAME as a path and return the absolute path to it.
70 absolute_dumpvar := $(strip $(filter abs-%,$(dumpvar_goals)))
71 ifdef absolute_dumpvar
72 dumpvar_goals := $(patsubst abs-%,%,$(dumpvar_goals))
73 DUMPVAR_VALUE := $(abspath $($(dumpvar_goals)))
74 dumpvar_target := dumpvar-abs-$(dumpvar_goals)
76 DUMPVAR_VALUE := $($(dumpvar_goals))
77 dumpvar_target := dumpvar-$(dumpvar_goals)
80 .PHONY: $(dumpvar_target)
82 @echo $(DUMPVAR_VALUE)
86 ifneq ($(dumpvar_goals),report_config)
90 ifneq ($(filter report_config,$(DUMP_MANY_VARS)),)
91 # Construct the shell commands that print the config banner.
92 report_config_sh := echo '============================================';
93 report_config_sh += $(foreach v,$(print_build_config_vars),echo '$v=$($(v))';)
94 report_config_sh += echo '============================================';
97 # Dump mulitple variables to "<var>=<value>" pairs, one per line.
98 # The output may be executed as bash script.
100 # DUMP_MANY_VARS: the list of variable names.
101 # DUMP_VAR_PREFIX: an optional prefix of the variable name added to the output.
102 # DUMP_MANY_ABS_VARS: the list of abs variable names.
103 # DUMP_ABS_VAR_PREFIX: an optional prefix of the abs variable name added to the output.
104 .PHONY: dump-many-vars
106 @$(foreach v, $(filter-out report_config, $(DUMP_MANY_VARS)),\
107 echo "$(DUMP_VAR_PREFIX)$(v)='$($(v))'";)
108 ifneq ($(filter report_config, $(DUMP_MANY_VARS)),)
109 @# Construct a special variable for report_config.
110 @# Escape \` to defer the execution of report_config_sh to preserve the line breaks.
111 @echo "$(DUMP_VAR_PREFIX)report_config=\`$(report_config_sh)\`"
113 @$(foreach v, $(sort $(DUMP_MANY_ABS_VARS)),\
114 echo "$(DUMP_ABS_VAR_PREFIX)$(v)='$(abspath $($(v)))'";)
116 endif # CALLED_FROM_SETUP
118 ifneq ($(PRINT_BUILD_CONFIG),)
119 $(info ============================================)
120 $(foreach v, $(print_build_config_vars),\
122 $(info ============================================)