aboutsummaryrefslogtreecommitdiff
path: root/APEX_1.4/compiler/android16/Makedefs.ANDROID.mk
blob: 2e918ab137fa89164eb5a2c2b50e42860f0ece69 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
TARGET_OS   ?= android-16
TARGET_ARCH ?= arm

ifeq ($(TARGET_ARCH),arm)
  TARGET_ABI = arm-linux-androideabi
  GCC_ARCH   = arm-linux-androideabi
  GCC_ABI    = armv7-a
  STL_ABI    = armeabi-v7a
endif
ifeq ($(TARGET_ARCH),x86)
  TARGET_ABI = i686-android-linux
  GCC_ARCH   = x86
  GCC_ABI    = 
  STL_ABI    = x86
endif

# we try and pick the latest available.
ifneq ($(wildcard $(NDKROOT)/toolchains/$(GCC_ARCH)-4.4.3/*),)
  GCC_VERS      = 4.4.3
endif
ifneq ($(wildcard $(NDKROOT)/toolchains/$(GCC_ARCH)-4.6.3/*),)
  GCC_VERS      = 4.6.3
endif
# GCC 4.6 on NDK appears requires slightly different pathing for some libs and object files.
ifneq ($(wildcard $(NDKROOT)/toolchains/$(GCC_ARCH)-4.6/*),)
  GCC_VERS      = 4.6
  GCC_LIB_VERS  = 4.6.x-google
endif
ifneq ($(wildcard $(NDKROOT)/toolchains/$(GCC_ARCH)-4.7.2/*),)
  GCC_VERS      = 4.7.2
endif
ifneq ($(wildcard $(NDKROOT)/toolchains/$(GCC_ARCH)-4.8/*),)
  GCC_VERS      = 4.8
endif
GCC_LIB_VERS ?= $(GCC_VERS)


HOST_OS:=$(shell uname | tr A-Z a-z)
ifneq ($(HOST_OS),darwin)
  HOST_OS:=$(shell uname -o | tr A-Z a-z)
endif


ifeq ($(HOST_OS),cygwin)
  TOOLCHAIN_DIR      = $(NDKROOT)/toolchains/$(GCC_ARCH)-$(GCC_VERS)/prebuilt/windows
else
  ifneq (,$(findstring msys,$(HOST_OS)))
    TOOLCHAIN_DIR      = $(NDKROOT)/toolchains/$(GCC_ARCH)-$(GCC_VERS)/prebuilt/windows
  else
    ifeq ($(HOST_OS),darwin)
      TOOLCHAIN_DIR    = $(NDKROOT)/toolchains/$(GCC_ARCH)-$(GCC_VERS)/prebuilt/darwin-x86
    else
      TOOLCHAIN_DIR    = $(NDKROOT)/toolchains/$(GCC_ARCH)-$(GCC_VERS)/prebuilt/linux-x86
    endif
  endif
endif

ifeq ($(wildcard $(TOOLCHAIN_DIR)),)
    TOOLCHAIN_DIR = UNDEFINED_TOOLCHAIN
endif

NDKPREFIX    = $(TOOLCHAIN_DIR)/bin/$(TARGET_ABI)
PLATFORM_DIR = $(NDKROOT)/platforms/$(TARGET_OS)
SYSROOT      = $(PLATFORM_DIR)/arch-$(TARGET_ARCH)
STLROOT      = UNDEFINED_STL

ifneq ($(wildcard $(NDKROOT)/sources/cxx-stl/gnu-libstdc++/include),)
    STLROOT = $(NDKROOT)/sources/cxx-stl/gnu-libstdc++
endif
# NDK r8b requires the GCC version number in the path here, but older versions don't.
ifneq ($(wildcard $(NDKROOT)/sources/cxx-stl/gnu-libstdc++/$(GCC_VERS)/include),)
    STLROOT = $(NDKROOT)/sources/cxx-stl/gnu-libstdc++/$(GCC_VERS)
endif

CC          = $(NDKPREFIX)-gcc
CXX         = $(NDKPREFIX)-g++
CCLD        = $(NDKPREFIX)-g++
CC_NOCACHE    = $(CC)
CXX_NOCACHE   = $(CXX)
CCLD_NOCACHE  = $(CCLD)
AR          = $(NDKPREFIX)-ar
RANLIB      = $(NDKPREFIX)-ranlib
PRASEDEPEND = parsedepend
ECHO        = echo
RMDIR       = rm -rf
MKDIR       = mkdir
CAT         = cat
CP          = cp
STRIP       = $(NDK_PREFIX)strip
OBJDUMP     = $(NDK_PREFIX)objdump
OBJCOPY     = $(NDK_PREFIX)objcopy