# # Copyright (C) 2006 The Android Open Source Project # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # # Configuration for Linux on ARM. # Included by combo/select.mk # You can set TARGET_ARCH_VARIANT to use an arch version other # than ARMv5TE. Each value should correspond to a file named # $(BUILD_COMBOS)/arch/.mk which must contain # makefile variable definitions similar to the preprocessor # defines in build/core/combo/include/arch//AndroidConfig.h. Their # purpose is to allow module Android.mk files to selectively compile # different versions of code based upon the funtionality and # instructions available in a given architecture version. # # The blocks also define specific arch_variant_cflags, which # include defines, and compiler settings for the given architecture # version. # ifeq ($(strip $(TARGET_ARCH_VARIANT)),) TARGET_ARCH_VARIANT := armv5te endif TARGET_ARCH_SPECIFIC_MAKEFILE := $(BUILD_COMBOS)/arch/$(TARGET_ARCH)/$(TARGET_ARCH_VARIANT).mk ifeq ($(strip $(wildcard $(TARGET_ARCH_SPECIFIC_MAKEFILE))),) $(error Unknown ARM architecture version: $(TARGET_ARCH_VARIANT)) endif include $(TARGET_ARCH_SPECIFIC_MAKEFILE) # You can set TARGET_TOOLS_PREFIX to get gcc from somewhere else ifeq ($(strip $(TARGET_TOOLS_PREFIX)),) TARGET_TOOLCHAIN_ROOT := prebuilts/gcc/$(HOST_PREBUILT_TAG)/arm/arm-linux-androideabi-4.6 TARGET_TOOLS_PREFIX := $(TARGET_TOOLCHAIN_ROOT)/bin/arm-linux-androideabi- endif # Only define these if there's actually a gcc in there. # The gcc toolchain does not exists for windows/cygwin. In this case, do not reference it. ifneq ($(wildcard $(TARGET_TOOLS_PREFIX)gcc$(HOST_EXECUTABLE_SUFFIX)),) TARGET_CC := $(TARGET_TOOLS_PREFIX)gcc$(HOST_EXECUTABLE_SUFFIX) TARGET_CXX := $(TARGET_TOOLS_PREFIX)g++$(HOST_EXECUTABLE_SUFFIX) TARGET_AR := $(TARGET_TOOLS_PREFIX)ar$(HOST_EXECUTABLE_SUFFIX) TARGET_OBJCOPY := $(TARGET_TOOLS_PREFIX)objcopy$(HOST_EXECUTABLE_SUFFIX) TARGET_LD := $(TARGET_TOOLS_PREFIX)ld$(HOST_EXECUTABLE_SUFFIX) TARGET_STRIP := $(TARGET_TOOLS_PREFIX)strip$(HOST_EXECUTABLE_SUFFIX) ifeq ($(TARGET_BUILD_VARIANT),user) TARGET_STRIP_COMMAND = $(TARGET_STRIP) --strip-all $< -o $@ else TARGET_STRIP_COMMAND = $(TARGET_STRIP) --strip-all $< -o $@ && \ $(TARGET_OBJCOPY) --add-gnu-debuglink=$< $@ endif endif TARGET_NO_UNDEFINED_LDFLAGS := -Wl,--no-undefined TARGET_arm_CFLAGS := -O2 \ -fomit-frame-pointer \ -fstrict-aliasing \ -funswitch-loops # Modules can choose to compile some source as thumb. As # non-thumb enabled targets are supported, this is treated # as a 'hint'. If thumb is not enabled, these files are just # compiled as ARM. ifeq ($(ARCH_ARM_HAVE_THUMB_SUPPORT),true) TARGET_thumb_CFLAGS := -mthumb \ -Os \ -fomit-frame-pointer \ -fno-strict-aliasing else TARGET_thumb_CFLAGS := $(TARGET_arm_CFLAGS) endif # Set FORCE_ARM_DEBUGGING to "true" in your buildspec.mk # or in your environment to force a full arm build, even for # files that are normally built as thumb; this can make # gdb debugging easier. Don't forget to do a clean build. # # NOTE: if you try to build a -O0 build with thumb, several # of the libraries (libpv, libwebcore, libkjs) need to be built # with -mlong-calls. When built at -O0, those libraries are # too big for a thumb "BL