From b73dc6690baf38bbc7c102a3992722db8d61a5a0 Mon Sep 17 00:00:00 2001 From: Bruce Beare Date: Mon, 12 Jul 2010 07:53:28 -0700 Subject: [PATCH] Allow TARGET_ARCH to be set from BoardConfig.mk Change-Id: I66aed78b763d238719822257c1f4f35301247df6 Signed-off-by: Bruce Beare --- core/config.mk | 2 + core/dumpvar.mk | 77 ++++++++++++++++++++++++ core/envsetup.mk | 78 ------------------------- target/board/generic_x86/BoardConfig.mk | 1 + 4 files changed, 80 insertions(+), 78 deletions(-) create mode 100644 core/dumpvar.mk diff --git a/core/config.mk b/core/config.mk index 2a46a2900..337152c91 100644 --- a/core/config.mk +++ b/core/config.mk @@ -141,6 +141,8 @@ include $(board_config_mk) TARGET_DEVICE_DIR := $(patsubst %/,%,$(dir $(board_config_mk))) board_config_mk := +include $(BUILD_SYSTEM)/dumpvar.mk + # Clean up/verify variables defined by the board config file. TARGET_BOOTLOADER_BOARD_NAME := $(strip $(TARGET_BOOTLOADER_BOARD_NAME)) TARGET_CPU_ABI := $(strip $(TARGET_CPU_ABI)) diff --git a/core/dumpvar.mk b/core/dumpvar.mk new file mode 100644 index 000000000..fa20eceb9 --- /dev/null +++ b/core/dumpvar.mk @@ -0,0 +1,77 @@ +# --------------------------------------------------------------- +# the setpath shell function in envsetup.sh uses this to figure out +# what to add to the path given the config we have chosen. +ifeq ($(CALLED_FROM_SETUP),true) + +ABP:=$(PWD)/$(HOST_OUT_EXECUTABLES) + +ifeq ($(TARGET_SIMULATOR),true) + ABP:=$(ABP):$(TARGET_OUT_EXECUTABLES) +else + # this should be copied to HOST_OUT_EXECUTABLES instead + ABP:=$(ABP):$(PWD)/prebuilt/$(HOST_PREBUILT_TAG)/toolchain/arm-eabi-4.4.0/bin +endif +ANDROID_BUILD_PATHS := $(ABP) +ANDROID_PREBUILTS := prebuilt/$(HOST_PREBUILT_TAG) + +# The "dumpvar" stuff lets you say something like +# +# CALLED_FROM_SETUP=true \ +# make -f config/envsetup.make dumpvar-TARGET_OUT +# or +# CALLED_FROM_SETUP=true \ +# make -f config/envsetup.make dumpvar-abs-HOST_OUT_EXECUTABLES +# +# The plain (non-abs) version just dumps the value of the named variable. +# The "abs" version will treat the variable as a path, and dumps an +# absolute path to it. +# +dumpvar_goals := \ + $(strip $(patsubst dumpvar-%,%,$(filter dumpvar-%,$(MAKECMDGOALS)))) +ifdef dumpvar_goals + + ifneq ($(words $(dumpvar_goals)),1) + $(error Only one "dumpvar-" goal allowed. Saw "$(MAKECMDGOALS)") + endif + + # If the goal is of the form "dumpvar-abs-VARNAME", then + # treat VARNAME as a path and return the absolute path to it. + absolute_dumpvar := $(strip $(filter abs-%,$(dumpvar_goals))) + ifdef absolute_dumpvar + dumpvar_goals := $(patsubst abs-%,%,$(dumpvar_goals)) + DUMPVAR_VALUE := $(PWD)/$($(dumpvar_goals)) + dumpvar_target := dumpvar-abs-$(dumpvar_goals) + else + DUMPVAR_VALUE := $($(dumpvar_goals)) + dumpvar_target := dumpvar-$(dumpvar_goals) + endif + +.PHONY: $(dumpvar_target) +$(dumpvar_target): + @echo $(DUMPVAR_VALUE) + +endif # dumpvar_goals + +ifneq ($(dumpvar_goals),report_config) +PRINT_BUILD_CONFIG:= +endif + +endif # CALLED_FROM_SETUP + + +ifneq ($(PRINT_BUILD_CONFIG),) +$(info ============================================) +$(info PLATFORM_VERSION_CODENAME=$(PLATFORM_VERSION_CODENAME)) +$(info PLATFORM_VERSION=$(PLATFORM_VERSION)) +$(info TARGET_PRODUCT=$(TARGET_PRODUCT)) +$(info TARGET_BUILD_VARIANT=$(TARGET_BUILD_VARIANT)) +$(info TARGET_SIMULATOR=$(TARGET_SIMULATOR)) +$(info TARGET_BUILD_TYPE=$(TARGET_BUILD_TYPE)) +$(info TARGET_BUILD_APPS=$(TARGET_BUILD_APPS)) +$(info TARGET_ARCH=$(TARGET_ARCH)) +$(info HOST_ARCH=$(HOST_ARCH)) +$(info HOST_OS=$(HOST_OS)) +$(info HOST_BUILD_TYPE=$(HOST_BUILD_TYPE)) +$(info BUILD_ID=$(BUILD_ID)) +$(info ============================================) +endif diff --git a/core/envsetup.mk b/core/envsetup.mk index 5f2e8bbff..87ac2f68a 100644 --- a/core/envsetup.mk +++ b/core/envsetup.mk @@ -272,81 +272,3 @@ endif ifeq ($(PRINT_BUILD_CONFIG),) PRINT_BUILD_CONFIG := true endif - -# --------------------------------------------------------------- -# the setpath shell function in envsetup.sh uses this to figure out -# what to add to the path given the config we have chosen. -ifeq ($(CALLED_FROM_SETUP),true) - -ABP:=$(PWD)/$(HOST_OUT_EXECUTABLES) - -ifeq ($(TARGET_SIMULATOR),true) - ABP:=$(ABP):$(TARGET_OUT_EXECUTABLES) -else - # this should be copied to HOST_OUT_EXECUTABLES instead - ABP:=$(ABP):$(PWD)/prebuilt/$(HOST_PREBUILT_TAG)/toolchain/arm-eabi-4.4.0/bin -endif -ANDROID_BUILD_PATHS := $(ABP) -ANDROID_PREBUILTS := prebuilt/$(HOST_PREBUILT_TAG) - -# The "dumpvar" stuff lets you say something like -# -# CALLED_FROM_SETUP=true \ -# make -f config/envsetup.make dumpvar-TARGET_OUT -# or -# CALLED_FROM_SETUP=true \ -# make -f config/envsetup.make dumpvar-abs-HOST_OUT_EXECUTABLES -# -# The plain (non-abs) version just dumps the value of the named variable. -# The "abs" version will treat the variable as a path, and dumps an -# absolute path to it. -# -dumpvar_goals := \ - $(strip $(patsubst dumpvar-%,%,$(filter dumpvar-%,$(MAKECMDGOALS)))) -ifdef dumpvar_goals - - ifneq ($(words $(dumpvar_goals)),1) - $(error Only one "dumpvar-" goal allowed. Saw "$(MAKECMDGOALS)") - endif - - # If the goal is of the form "dumpvar-abs-VARNAME", then - # treat VARNAME as a path and return the absolute path to it. - absolute_dumpvar := $(strip $(filter abs-%,$(dumpvar_goals))) - ifdef absolute_dumpvar - dumpvar_goals := $(patsubst abs-%,%,$(dumpvar_goals)) - DUMPVAR_VALUE := $(PWD)/$($(dumpvar_goals)) - dumpvar_target := dumpvar-abs-$(dumpvar_goals) - else - DUMPVAR_VALUE := $($(dumpvar_goals)) - dumpvar_target := dumpvar-$(dumpvar_goals) - endif - -.PHONY: $(dumpvar_target) -$(dumpvar_target): - @echo $(DUMPVAR_VALUE) - -endif # dumpvar_goals - -ifneq ($(dumpvar_goals),report_config) -PRINT_BUILD_CONFIG:= -endif - -endif # CALLED_FROM_SETUP - - -ifneq ($(PRINT_BUILD_CONFIG),) -$(info ============================================) -$(info PLATFORM_VERSION_CODENAME=$(PLATFORM_VERSION_CODENAME)) -$(info PLATFORM_VERSION=$(PLATFORM_VERSION)) -$(info TARGET_PRODUCT=$(TARGET_PRODUCT)) -$(info TARGET_BUILD_VARIANT=$(TARGET_BUILD_VARIANT)) -$(info TARGET_SIMULATOR=$(TARGET_SIMULATOR)) -$(info TARGET_BUILD_TYPE=$(TARGET_BUILD_TYPE)) -$(info TARGET_BUILD_APPS=$(TARGET_BUILD_APPS)) -$(info TARGET_ARCH=$(TARGET_ARCH)) -$(info HOST_ARCH=$(HOST_ARCH)) -$(info HOST_OS=$(HOST_OS)) -$(info HOST_BUILD_TYPE=$(HOST_BUILD_TYPE)) -$(info BUILD_ID=$(BUILD_ID)) -$(info ============================================) -endif diff --git a/target/board/generic_x86/BoardConfig.mk b/target/board/generic_x86/BoardConfig.mk index 608aee1dc..89fb5e4dc 100644 --- a/target/board/generic_x86/BoardConfig.mk +++ b/target/board/generic_x86/BoardConfig.mk @@ -1,3 +1,4 @@ +TARGET_ARCH=x86 TARGET_COMPRESS_MODULE_SYMBOLS := false TARGET_PRELINK_MODULE := false TARGET_NO_RECOVERY := true