1 # Copyright (C) 2009 The Android Open Source Project 2 # 3 # Licensed under the Apache License, Version 2.0 (the "License"); 4 # you may not use this file except in compliance with the License. 5 # You may obtain a copy of the License at 6 # 7 # http://www.apache.org/licenses/LICENSE-2.0 8 # 9 # Unless required by applicable law or agreed to in writing, software 10 # distributed under the License is distributed on an "AS IS" BASIS, 11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 # See the License for the specific language governing permissions and 13 # limitations under the License. 14 # 15 16 # this file is included multiple times by build/core/setup-app.mk 17 # 18 19 $(call ndk_log,Building application '$(NDK_APP_NAME)' for ABI '$(TARGET_ARCH_ABI)') 20 21 TARGET_ARCH := $(strip $(NDK_ABI.$(TARGET_ARCH_ABI).arch)) 22 ifndef TARGET_ARCH 23 $(call __ndk_info,ERROR: The $(TARGET_ARCH_ABI) ABI has no associated architecture!) 24 $(call __ndk_error,Aborting...) 25 endif 26 27 TARGET_OUT := $(NDK_APP_OUT)/$(_app)/$(TARGET_ARCH_ABI) 28 29 # Special handling for x86: The minimal platform is android-9 here 30 # For now, handle this with a simple substitution. We may want to implement 31 # more general filtering in the future when introducing other ABIs. 32 TARGET_PLATFORM_SAVED := $(TARGET_PLATFORM) 33 ifneq ($(filter %x86,$(TARGET_ARCH_ABI)),) 34 $(foreach _plat,3 4 5 8,\ 35 $(eval TARGET_PLATFORM := $$(subst android-$(_plat),android-9,$$(TARGET_PLATFORM)))\ 36 ) 37 endif 38 39 # The minimal platform for mips is android-9 40 ifneq ($(filter %mips,$(TARGET_ARCH_ABI)),) 41 $(foreach _plat,3 4 5 8,\ 42 $(eval TARGET_PLATFORM := $$(subst android-$(_plat),android-9,$$(TARGET_PLATFORM)))\ 43 ) 44 endif 45 46 # Separate the debug and release objects. This prevents rebuilding 47 # everything when you switch between these two modes. For projects 48 # with lots of C++ sources, this can be a considerable time saver. 49 ifeq ($(NDK_APP_OPTIM),debug) 50 TARGET_OBJS := $(TARGET_OUT)/objs-debug 51 else 52 TARGET_OBJS := $(TARGET_OUT)/objs 53 endif 54 55 TARGET_GDB_SETUP := $(TARGET_OUT)/setup.gdb 56 57 include $(BUILD_SYSTEM)/setup-toolchain.mk 58 59 # Restore TARGET_PLATFORM, see above. 60 TARGET_PLATFORM := $(TARGET_PLATFORM_SAVED) 61