Home | History | Annotate | Download | only in llvm-3.3
      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.3
     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 
     26 TOOLCHAIN_VERSION := 4.7
     27 
     28 ifneq ($(filter %bcarmeabi-v7a,$(TARGET_ARCH_ABI)),)
     29 SYSROOT_LINK     := $(NDK_PLATFORMS_ROOT)/$(TARGET_PLATFORM)/arch-arm
     30 TARGET_GDBSERVER := $(NDK_ROOT)/prebuilt/android-arm/gdbserver/gdbserver
     31 TARGET_ARCH_ABI  := armeabi-v7a
     32 NDK_APP_DST_DIR  := $(NDK_APP_PROJECT_PATH)/libs/$(TARGET_ARCH_ABI)
     33 
     34 TARGET_PREBUILT_ROOT = $(call host-prebuilt-tag,$(NDK_ROOT)/toolchains/arm-linux-androideabi-$(TOOLCHAIN_VERSION))
     35 cmd-strip = $(TARGET_PREBUILT_ROOT)/bin/arm-linux-androideabi-strip$(HOST_EXEEXT) --strip-unneeded $(call host-path,$1)
     36 
     37 include $(NDK_ROOT)/toolchains/llvm-3.3/setup-common.mk
     38 
     39 else
     40 ifneq ($(filter %bcarmeabi,$(TARGET_ARCH_ABI)),)
     41 SYSROOT_LINK     := $(NDK_PLATFORMS_ROOT)/$(TARGET_PLATFORM)/arch-arm
     42 TARGET_GDBSERVER := $(NDK_ROOT)/prebuilt/android-arm/gdbserver/gdbserver
     43 TARGET_ARCH_ABI  := armeabi
     44 NDK_APP_DST_DIR  := $(NDK_APP_PROJECT_PATH)/libs/$(TARGET_ARCH_ABI)
     45 
     46 TARGET_PREBUILT_ROOT = $(call host-prebuilt-tag,$(NDK_ROOT)/toolchains/arm-linux-androideabi-$(TOOLCHAIN_VERSION))
     47 cmd-strip = $(TARGET_PREBUILT_ROOT)/bin/arm-linux-androideabi-strip$(HOST_EXEEXT) --strip-unneeded $(call host-path,$1)
     48 
     49 include $(NDK_ROOT)/toolchains/llvm-3.3/setup-common.mk
     50 
     51 else
     52 ifneq ($(filter %bcx86,$(TARGET_ARCH_ABI)),)
     53 SYSROOT_LINK     := $(NDK_PLATFORMS_ROOT)/$(TARGET_PLATFORM)/arch-x86
     54 TARGET_GDBSERVER := $(NDK_ROOT)/prebuilt/android-x86/gdbserver/gdbserver
     55 TARGET_ARCH_ABI  := x86
     56 NDK_APP_DST_DIR  := $(NDK_APP_PROJECT_PATH)/libs/$(TARGET_ARCH_ABI)
     57 
     58 TARGET_PREBUILT_ROOT = $(call host-prebuilt-tag,$(NDK_ROOT)/toolchains/x86-$(TOOLCHAIN_VERSION))
     59 cmd-strip = $(TARGET_PREBUILT_ROOT)/bin/i686-linux-android-strip$(HOST_EXEEXT) --strip-unneeded $(call host-path,$1)
     60 
     61 include $(NDK_ROOT)/toolchains/llvm-3.3/setup-common.mk
     62 
     63 else
     64 ifneq ($(filter %bcmips,$(TARGET_ARCH_ABI)),)
     65 SYSROOT_LINK     := $(NDK_PLATFORMS_ROOT)/$(TARGET_PLATFORM)/arch-mips
     66 TARGET_GDBSERVER := $(NDK_ROOT)/prebuilt/android-mips/gdbserver/gdbserver
     67 TARGET_ARCH_ABI  := mips
     68 NDK_APP_DST_DIR  := $(NDK_APP_PROJECT_PATH)/libs/$(TARGET_ARCH_ABI)
     69 
     70 TARGET_PREBUILT_ROOT = $(call host-prebuilt-tag,$(NDK_ROOT)/toolchains/mipsel-linux-android-$(TOOLCHAIN_VERSION))
     71 cmd-strip = $(TARGET_PREBUILT_ROOT)/bin/mipsel-linux-android-strip$(HOST_EXEEXT) --strip-unneeded $(call host-path,$1)
     72 
     73 include $(NDK_ROOT)/toolchains/llvm-3.3/setup-common.mk
     74 
     75 else
     76 
     77 ifneq ($(filter %armeabi-v7a,$(TARGET_ARCH_ABI)),)
     78 
     79 SYSROOT_LINK     := $(NDK_PLATFORMS_ROOT)/$(TARGET_PLATFORM)/arch-arm
     80 TARGET_GDBSERVER := $(NDK_ROOT)/prebuilt/android-arm/gdbserver/gdbserver
     81 TARGET_ARCH_ABI  := armeabi-v7a
     82 NDK_APP_DST_DIR  := $(NDK_APP_PROJECT_PATH)/libs/$(TARGET_ARCH_ABI)
     83 TARGET_LDLIBS    := $(NDK_ROOT)/sources/android/libportable/libs/armeabi-v7a/libportable.a $(TARGET_LDLIBS)
     84 TARGET_LDFLAGS   += -Wl,@$(NDK_ROOT)/sources/android/libportable/libs/armeabi-v7a/libportable.wrap
     85 include $(NDK_ROOT)/toolchains/arm-linux-androideabi-clang3.3/setup.mk
     86 
     87 else
     88 ifneq ($(filter %armeabi,$(TARGET_ARCH_ABI)),)
     89 
     90 SYSROOT_LINK     := $(NDK_PLATFORMS_ROOT)/$(TARGET_PLATFORM)/arch-arm
     91 TARGET_GDBSERVER := $(NDK_ROOT)/prebuilt/android-arm/gdbserver/gdbserver
     92 TARGET_ARCH_ABI  := armeabi
     93 NDK_APP_DST_DIR  := $(NDK_APP_PROJECT_PATH)/libs/$(TARGET_ARCH_ABI)
     94 TARGET_LDLIBS    := $(NDK_ROOT)/sources/android/libportable/libs/armeabi/libportable.a $(TARGET_LDLIBS)
     95 TARGET_LDFLAGS   += -Wl,@$(NDK_ROOT)/sources/android/libportable/libs/armeabi/libportable.wrap
     96 include $(NDK_ROOT)/toolchains/arm-linux-androideabi-clang3.3/setup.mk
     97 
     98 else
     99 ifneq ($(filter %x86,$(TARGET_ARCH_ABI)),)
    100 
    101 SYSROOT_LINK     := $(NDK_PLATFORMS_ROOT)/$(TARGET_PLATFORM)/arch-x86
    102 TARGET_GDBSERVER := $(NDK_ROOT)/prebuilt/android-x86/gdbserver/gdbserver
    103 TARGET_ARCH_ABI  := x86
    104 NDK_APP_DST_DIR  := $(NDK_APP_PROJECT_PATH)/libs/$(TARGET_ARCH_ABI)
    105 TARGET_LDLIBS    := $(NDK_ROOT)/sources/android/libportable/libs/x86/libportable.a $(TARGET_LDLIBS)
    106 TARGET_LDFLAGS   += -Wl,@$(NDK_ROOT)/sources/android/libportable/libs/x86/libportable.wrap
    107 include $(NDK_ROOT)/toolchains/x86-clang3.3/setup.mk
    108 
    109 else
    110 ifneq ($(filter %mips,$(TARGET_ARCH_ABI)),)
    111 
    112 SYSROOT_LINK     := $(NDK_PLATFORMS_ROOT)/$(TARGET_PLATFORM)/arch-mips
    113 TARGET_GDBSERVER := $(NDK_ROOT)/prebuilt/android-mips/gdbserver/gdbserver
    114 TARGET_ARCH_ABI  := mips
    115 NDK_APP_DST_DIR  := $(NDK_APP_PROJECT_PATH)/libs/$(TARGET_ARCH_ABI)
    116 TARGET_LDLIBS    := $(NDK_ROOT)/sources/android/libportable/libs/mips/libportable.a $(TARGET_LDLIBS)
    117 TARGET_LDFLAGS   += -Wl,@$(NDK_ROOT)/sources/android/libportable/libs/mips/libportable.wrap
    118 include $(NDK_ROOT)/toolchains/mipsel-linux-android-clang3.3/setup.mk
    119 
    120 else
    121 
    122 TARGET_OBJ_EXTENSION := .bc
    123 TARGET_LIB_EXTENSION := .a
    124 TARGET_SONAME_EXTENSION := .bc
    125 
    126 include $(NDK_ROOT)/toolchains/llvm-3.3/setup-common.mk
    127 
    128 endif
    129 endif
    130 endif
    131 endif
    132 endif
    133 endif
    134 endif
    135 endif
    136