diff options
Diffstat (limited to 'core/config.mk')
-rw-r--r-- | core/config.mk | 95 |
1 files changed, 86 insertions, 9 deletions
diff --git a/core/config.mk b/core/config.mk index 41e60ea..b0b5082 100644 --- a/core/config.mk +++ b/core/config.mk @@ -28,10 +28,12 @@ SRC_HEADERS := \ $(TOPDIR)hardware/libhardware/include \ $(TOPDIR)hardware/libhardware_legacy/include \ $(TOPDIR)hardware/ril/include \ - $(TOPDIR)dalvik/libnativehelper/include \ + $(TOPDIR)libnativehelper/include \ + $(TOPDIR)frameworks/native/include \ + $(TOPDIR)frameworks/native/opengl/include \ + $(TOPDIR)frameworks/av/include \ $(TOPDIR)frameworks/base/include \ $(TOPDIR)frameworks/base/opengl/include \ - $(TOPDIR)frameworks/base/native/include \ $(TOPDIR)external/skia/include SRC_HOST_HEADERS:=$(TOPDIR)tools/include SRC_LIBRARIES:= $(TOPDIR)libs @@ -73,6 +75,8 @@ BUILD_COPY_HEADERS := $(BUILD_SYSTEM)/copy_headers.mk BUILD_NATIVE_TEST := $(BUILD_SYSTEM)/native_test.mk BUILD_HOST_NATIVE_TEST := $(BUILD_SYSTEM)/host_native_test.mk +-include cts/build/config.mk + # ############################################################### # Parse out any modifier targets. # ############################################################### @@ -117,7 +121,10 @@ TARGET_SHELL := mksh # If this file doesn't exist, the environemnt variables will # be used, and if that doesn't work, then the default is an # arm build --include $(TOPDIR)buildspec.mk +ifndef ANDROID_BUILDSPEC +ANDROID_BUILDSPEC := $(TOPDIR)buildspec.mk +endif +-include $(ANDROID_BUILDSPEC) # --------------------------------------------------------------- # Define most of the global variables. These are the ones that @@ -144,6 +151,64 @@ include $(board_config_mk) TARGET_DEVICE_DIR := $(patsubst %/,%,$(dir $(board_config_mk))) board_config_mk := +# The build system exposes several variables for where to find the kernel +# headers: +# TARGET_DEVICE_KERNEL_HEADERS is automatically created for the current +# device being built. It is set as $(TARGET_DEVICE_DIR)/kernel-headers, +# e.g. device/samsung/tuna/kernel-headers. This directory is not +# explicitly set by anyone, the build system always adds this subdir. +# +# TARGET_BOARD_KERNEL_HEADERS is specified by the BoardConfig.mk file +# to allow other directories to be included. This is useful if there's +# some common place where a few headers are being kept for a group +# of devices. For example, device/<vendor>/common/kernel-headers could +# contain some headers for several of <vendor>'s devices. +# +# TARGET_PRODUCT_KERNEL_HEADERS is generated by the product inheritance +# graph. This allows architecture products to provide headers for the +# devices using that architecture. For example, +# hardware/ti/omap4xxx/omap4.mk will specify +# PRODUCT_VENDOR_KERNEL_HEADERS variable that specify where the omap4 +# specific headers are, e.g. hardware/ti/omap4xxx/kernel-headers. +# The build system then combines all the values specified by all the +# PRODUCT_VENDOR_KERNEL_HEADERS directives in the product inheritance +# tree and then exports a TARGET_PRODUCT_KERNEL_HEADERS variable. +# +# The layout of subdirs in any of the kernel-headers dir should mirror the +# layout of the kernel include/ directory. For example, +# device/samsung/tuna/kernel-headers/linux/, +# hardware/ti/omap4xxx/kernel-headers/media/, +# etc. +# +# NOTE: These directories MUST contain post-processed headers using the +# bionic/libc/kernel/clean_header.py tool. Additionally, the original kernel +# headers must also be checked in, but in a different subdirectory. By +# convention, the originals should be checked into original-kernel-headers +# directory of the same parent dir. For example, +# device/samsung/tuna/kernel-headers <----- post-processed +# device/samsung/tuna/original-kernel-headers <----- originals +# +TARGET_DEVICE_KERNEL_HEADERS := $(strip $(wildcard $(TARGET_DEVICE_DIR)/kernel-headers)) + +define validate-kernel-headers +$(if $(firstword $(foreach hdr_dir,$(1),\ + $(filter-out kernel-headers,$(notdir $(hdr_dir))))),\ + $(error Kernel header dirs must be end in kernel-headers: $(1))) +endef +# also allow the board config to provide additional directories since +# there could be device/oem/base_hw and device/oem/derived_hw +# that both are valid devices but derived_hw needs to use kernel headers +# from base_hw. +TARGET_BOARD_KERNEL_HEADERS := $(strip $(wildcard $(TARGET_BOARD_KERNEL_HEADERS))) +TARGET_BOARD_KERNEL_HEADERS := $(patsubst %/,%,$(TARGET_BOARD_KERNEL_HEADERS)) +$(call validate-kernel-headers,$(TARGET_BOARD_KERNEL_HEADERS)) + +# then add product-inherited includes, to allow for +# hardware/sivendor/chip/chip.mk to include their own headers +TARGET_PRODUCT_KERNEL_HEADERS := $(strip $(wildcard $(PRODUCT_VENDOR_KERNEL_HEADERS))) +TARGET_PRODUCT_KERNEL_HEADERS := $(patsubst %/,%,$(TARGET_PRODUCT_KERNEL_HEADERS)) +$(call validate-kernel-headers,$(TARGET_PRODUCT_KERNEL_HEADERS)) + # 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)) @@ -166,6 +231,14 @@ include $(BUILD_SYSTEM)/combo/select.mk combo_target := TARGET_ include $(BUILD_SYSTEM)/combo/select.mk +# Compute TARGET_TOOLCHAIN_ROOT from TARGET_TOOLS_PREFIX +# if only TARGET_TOOLS_PREFIX is passed to the make command. +ifndef TARGET_TOOLCHAIN_ROOT +TARGET_TOOLCHAIN_ROOT := $(patsubst %/, %, $(dir $(TARGET_TOOLS_PREFIX))) +TARGET_TOOLCHAIN_ROOT := $(patsubst %/, %, $(dir $(TARGET_TOOLCHAIN_ROOT))) +TARGET_TOOLCHAIN_ROOT := $(wildcard $(TARGET_TOOLCHAIN_ROOT)) +endif + # Pick a Java compiler. include $(BUILD_SYSTEM)/combo/javac.mk @@ -230,7 +303,6 @@ ACP := $(BUILD_OUT_EXECUTABLES)/acp$(BUILD_EXECUTABLE_SUFFIX) DX := $(HOST_OUT_EXECUTABLES)/dx ZIPALIGN := $(HOST_OUT_EXECUTABLES)/zipalign$(HOST_EXECUTABLE_SUFFIX) FINDBUGS := prebuilt/common/findbugs/bin/findbugs -LOCALIZE := $(HOST_OUT_EXECUTABLES)/localize$(HOST_EXECUTABLE_SUFFIX) EMMA_JAR := external/emma/lib/emma$(COMMON_JAVA_PACKAGE_SUFFIX) # Deal with archaic version of bison on Mac OS X. @@ -254,7 +326,7 @@ endif ifeq ($(HOST_OS),darwin) dir := $(HOST_OS)-$(HOST_ARCH) endif -OLD_FLEX := prebuilt/$(HOST_PREBUILT_TAG)/flex/flex-2.5.4a$(HOST_EXECUTABLE_SUFFIX) +OLD_FLEX := prebuilts/misc/$(HOST_PREBUILT_TAG)/flex/flex-2.5.4a$(HOST_EXECUTABLE_SUFFIX) ifeq ($(HOST_OS),darwin) # Mac OS' screwy version of java uses a non-standard directory layout @@ -315,7 +387,9 @@ HOST_GLOBAL_LD_DIRS += -L$(HOST_OUT_INTERMEDIATE_LIBRARIES) TARGET_GLOBAL_LD_DIRS += -L$(TARGET_OUT_INTERMEDIATE_LIBRARIES) HOST_PROJECT_INCLUDES:= $(SRC_HEADERS) $(SRC_HOST_HEADERS) $(HOST_OUT_HEADERS) -TARGET_PROJECT_INCLUDES:= $(SRC_HEADERS) $(TARGET_OUT_HEADERS) +TARGET_PROJECT_INCLUDES:= $(SRC_HEADERS) $(TARGET_OUT_HEADERS) \ + $(TARGET_DEVICE_KERNEL_HEADERS) $(TARGET_BOARD_KERNEL_HEADERS) \ + $(TARGET_PRODUCT_KERNEL_HEADERS) # Many host compilers don't support these flags, so we have to make # sure to only specify them for the target compilers checked in to @@ -329,6 +403,9 @@ HOST_GLOBAL_CPPFLAGS += $(HOST_RELEASE_CPPFLAGS) TARGET_GLOBAL_CFLAGS += $(TARGET_RELEASE_CFLAGS) TARGET_GLOBAL_CPPFLAGS += $(TARGET_RELEASE_CPPFLAGS) +# define llvm tools and global flags +include $(BUILD_SYSTEM)/llvm_config.mk + PREBUILT_IS_PRESENT := $(if $(wildcard prebuilt/Android.mk),true) # ############################################################### @@ -336,8 +413,8 @@ PREBUILT_IS_PRESENT := $(if $(wildcard prebuilt/Android.mk),true) # For use with the LOCAL_SDK_VERSION variable for include $(BUILD_PACKAGE) # ############################################################### -HISTORICAL_SDK_VERSIONS_ROOT := $(TOPDIR)prebuilt/sdk -HISTORICAL_NDK_VERSIONS_ROOT := $(TOPDIR)prebuilt/ndk +HISTORICAL_SDK_VERSIONS_ROOT := $(TOPDIR)prebuilts/sdk +HISTORICAL_NDK_VERSIONS_ROOT := $(TOPDIR)prebuilts/ndk # Historical SDK version N is stored in $(HISTORICAL_SDK_VERSIONS_ROOT)/N. # The 'current' version is whatever this source tree is. @@ -355,7 +432,7 @@ $(shell function sgrax() { \ ( sgrax $(1) | sort -g ) ) endef -TARGET_AVAILABLE_SDK_VERSIONS := current $(call numerically_sort,\ +TARGET_AVAILABLE_SDK_VERSIONS := $(call numerically_sort,\ $(patsubst $(HISTORICAL_SDK_VERSIONS_ROOT)/%/android.jar,%, \ $(wildcard $(HISTORICAL_SDK_VERSIONS_ROOT)/*/android.jar))) |