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 used to prepare the NDK to build with the clang-3.2 17# toolchain any number of source files 18# 19# its purpose is to define (or re-define) templates used to build 20# various sources into target object files, libraries or executables. 21# 22# Note that this file may end up being parsed several times in future 23# revisions of the NDK. 24# 25 26TOOLCHAIN_VERSION := 4.7 27 28ifneq ($(filter %bcarmeabi-v7a,$(TARGET_ARCH_ABI)),) 29SYSROOT_LINK := $(NDK_PLATFORMS_ROOT)/$(TARGET_PLATFORM)/arch-arm 30TARGET_GDBSERVER := $(NDK_ROOT)/prebuilt/android-arm/gdbserver/gdbserver 31TARGET_ARCH_ABI := armeabi-v7a 32NDK_APP_DST_DIR := $(NDK_APP_PROJECT_PATH)/libs/$(TARGET_ARCH_ABI) 33 34TARGET_PREBUILT_ROOT = $(call host-prebuilt-tag,$(NDK_ROOT)/toolchains/arm-linux-androideabi-$(TOOLCHAIN_VERSION)) 35cmd-strip = $(TARGET_PREBUILT_ROOT)/bin/arm-linux-androideabi-strip$(HOST_EXEEXT) --strip-unneeded $(call host-path,$1) 36 37include $(NDK_ROOT)/toolchains/llvm-3.2/setup-common.mk 38 39else 40ifneq ($(filter %bcarmeabi,$(TARGET_ARCH_ABI)),) 41SYSROOT_LINK := $(NDK_PLATFORMS_ROOT)/$(TARGET_PLATFORM)/arch-arm 42TARGET_GDBSERVER := $(NDK_ROOT)/prebuilt/android-arm/gdbserver/gdbserver 43TARGET_ARCH_ABI := armeabi 44NDK_APP_DST_DIR := $(NDK_APP_PROJECT_PATH)/libs/$(TARGET_ARCH_ABI) 45 46TARGET_PREBUILT_ROOT = $(call host-prebuilt-tag,$(NDK_ROOT)/toolchains/arm-linux-androideabi-$(TOOLCHAIN_VERSION)) 47cmd-strip = $(TARGET_PREBUILT_ROOT)/bin/arm-linux-androideabi-strip$(HOST_EXEEXT) --strip-unneeded $(call host-path,$1) 48 49include $(NDK_ROOT)/toolchains/llvm-3.2/setup-common.mk 50 51else 52ifneq ($(filter %bcx86,$(TARGET_ARCH_ABI)),) 53SYSROOT_LINK := $(NDK_PLATFORMS_ROOT)/$(TARGET_PLATFORM)/arch-x86 54TARGET_GDBSERVER := $(NDK_ROOT)/prebuilt/android-x86/gdbserver/gdbserver 55TARGET_ARCH_ABI := x86 56NDK_APP_DST_DIR := $(NDK_APP_PROJECT_PATH)/libs/$(TARGET_ARCH_ABI) 57 58TARGET_PREBUILT_ROOT = $(call host-prebuilt-tag,$(NDK_ROOT)/toolchains/x86-$(TOOLCHAIN_VERSION)) 59cmd-strip = $(TARGET_PREBUILT_ROOT)/bin/i686-linux-android-strip$(HOST_EXEEXT) --strip-unneeded $(call host-path,$1) 60 61include $(NDK_ROOT)/toolchains/llvm-3.2/setup-common.mk 62 63else 64ifneq ($(filter %bcmips,$(TARGET_ARCH_ABI)),) 65SYSROOT_LINK := $(NDK_PLATFORMS_ROOT)/$(TARGET_PLATFORM)/arch-mips 66TARGET_GDBSERVER := $(NDK_ROOT)/prebuilt/android-mips/gdbserver/gdbserver 67TARGET_ARCH_ABI := mips 68NDK_APP_DST_DIR := $(NDK_APP_PROJECT_PATH)/libs/$(TARGET_ARCH_ABI) 69 70TARGET_PREBUILT_ROOT = $(call host-prebuilt-tag,$(NDK_ROOT)/toolchains/mipsel-linux-android-$(TOOLCHAIN_VERSION)) 71cmd-strip = $(TARGET_PREBUILT_ROOT)/bin/mipsel-linux-android-strip$(HOST_EXEEXT) --strip-unneeded $(call host-path,$1) 72 73include $(NDK_ROOT)/toolchains/llvm-3.2/setup-common.mk 74 75else 76 77ifneq ($(filter %armeabi-v7a,$(TARGET_ARCH_ABI)),) 78 79SYSROOT_LINK := $(NDK_PLATFORMS_ROOT)/$(TARGET_PLATFORM)/arch-arm 80TARGET_GDBSERVER := $(NDK_ROOT)/prebuilt/android-arm/gdbserver/gdbserver 81TARGET_ARCH_ABI := armeabi-v7a 82NDK_APP_DST_DIR := $(NDK_APP_PROJECT_PATH)/libs/$(TARGET_ARCH_ABI) 83TARGET_LDLIBS := $(NDK_ROOT)/sources/android/libportable/libs/armeabi-v7a/libportable.a $(TARGET_LDLIBS) 84TARGET_LDFLAGS += -Wl,@$(NDK_ROOT)/sources/android/libportable/libs/armeabi-v7a/libportable.wrap 85include $(NDK_ROOT)/toolchains/arm-linux-androideabi-clang3.2/setup.mk 86 87else 88ifneq ($(filter %armeabi,$(TARGET_ARCH_ABI)),) 89 90SYSROOT_LINK := $(NDK_PLATFORMS_ROOT)/$(TARGET_PLATFORM)/arch-arm 91TARGET_GDBSERVER := $(NDK_ROOT)/prebuilt/android-arm/gdbserver/gdbserver 92TARGET_ARCH_ABI := armeabi 93NDK_APP_DST_DIR := $(NDK_APP_PROJECT_PATH)/libs/$(TARGET_ARCH_ABI) 94TARGET_LDLIBS := $(NDK_ROOT)/sources/android/libportable/libs/armeabi/libportable.a $(TARGET_LDLIBS) 95TARGET_LDFLAGS += -Wl,@$(NDK_ROOT)/sources/android/libportable/libs/armeabi/libportable.wrap 96include $(NDK_ROOT)/toolchains/arm-linux-androideabi-clang3.2/setup.mk 97 98else 99ifneq ($(filter %x86,$(TARGET_ARCH_ABI)),) 100 101SYSROOT_LINK := $(NDK_PLATFORMS_ROOT)/$(TARGET_PLATFORM)/arch-x86 102TARGET_GDBSERVER := $(NDK_ROOT)/prebuilt/android-x86/gdbserver/gdbserver 103TARGET_ARCH_ABI := x86 104NDK_APP_DST_DIR := $(NDK_APP_PROJECT_PATH)/libs/$(TARGET_ARCH_ABI) 105TARGET_LDLIBS := $(NDK_ROOT)/sources/android/libportable/libs/x86/libportable.a $(TARGET_LDLIBS) 106TARGET_LDFLAGS += -Wl,@$(NDK_ROOT)/sources/android/libportable/libs/x86/libportable.wrap 107include $(NDK_ROOT)/toolchains/x86-clang3.2/setup.mk 108 109else 110ifneq ($(filter %mips,$(TARGET_ARCH_ABI)),) 111 112SYSROOT_LINK := $(NDK_PLATFORMS_ROOT)/$(TARGET_PLATFORM)/arch-mips 113TARGET_GDBSERVER := $(NDK_ROOT)/prebuilt/android-mips/gdbserver/gdbserver 114TARGET_ARCH_ABI := mips 115NDK_APP_DST_DIR := $(NDK_APP_PROJECT_PATH)/libs/$(TARGET_ARCH_ABI) 116TARGET_LDLIBS := $(NDK_ROOT)/sources/android/libportable/libs/mips/libportable.a $(TARGET_LDLIBS) 117TARGET_LDFLAGS += -Wl,@$(NDK_ROOT)/sources/android/libportable/libs/mips/libportable.wrap 118include $(NDK_ROOT)/toolchains/mipsel-linux-android-clang3.2/setup.mk 119 120else 121 122TARGET_OBJ_EXTENSION := .bc 123TARGET_LIB_EXTENSION := .a 124TARGET_SONAME_EXTENSION := .bc 125 126include $(NDK_ROOT)/toolchains/llvm-3.2/setup-common.mk 127 128endif 129endif 130endif 131endif 132endif 133endif 134endif 135endif 136