Home | History | Annotate | Download | only in x86-4.6
      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 x86 gcc-4.6
     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_NAME   := x86-4.6
     27 TOOLCHAIN_PREFIX := $(TOOLCHAIN_PREBUILT_ROOT)/bin/i686-linux-android-
     28 
     29 TARGET_CFLAGS := \
     30     -ffunction-sections \
     31     -funwind-tables \
     32     -no-canonical-prefixes
     33 
     34 TARGET_C_INCLUDES := \
     35     $(SYSROOT_INC)/usr/include
     36 
     37 # Add and LDFLAGS for the target here
     38 TARGET_LDFLAGS := -no-canonical-prefixes
     39 
     40 TARGET_CFLAGS += -fstack-protector
     41 
     42 TARGET_x86_release_CFLAGS := -O2 \
     43                              -g \
     44                              -DNDEBUG \
     45                              -fomit-frame-pointer \
     46                              -fstrict-aliasing    \
     47                              -funswitch-loops     \
     48                              -finline-limit=300
     49 
     50 # When building for debug, compile everything as x86.
     51 TARGET_x86_debug_CFLAGS := $(TARGET_x86_release_CFLAGS) \
     52                            -O0 \
     53                            -UNDEBUG \
     54                            -fno-omit-frame-pointer \
     55                            -fno-strict-aliasing
     56 
     57 # This function will be called to determine the target CFLAGS used to build
     58 # a C or Assembler source file, based on its tags.
     59 #
     60 TARGET-process-src-files-tags = \
     61 $(eval __debug_sources := $(call get-src-files-with-tag,debug)) \
     62 $(eval __release_sources := $(call get-src-files-without-tag,debug)) \
     63 $(call set-src-files-target-cflags, $(__debug_sources), $(TARGET_x86_debug_CFLAGS)) \
     64 $(call set-src-files-target-cflags, $(__release_sources),$(TARGET_x86_release_CFLAGS)) \
     65 $(call set-src-files-text,$(LOCAL_SRC_FILES),x86$(space)$(space)) \
     66 
     67 # The ABI-specific sub-directory that the SDK tools recognize for
     68 # this toolchain's generated binaries
     69 TARGET_ABI_SUBDIR := x86
     70