[PowerPC] Collect some CallLowering arguments into a struct. [NFC]
[llvm-project.git] / lldb / packages / Python / lldbsuite / test / make / Android.rules
blob7339c22d2e4c468af0666c17d9630f77dc0eeca5
1 NDK_ROOT := $(shell dirname $(CC))/../../../../..
3 ifeq "$(findstring 64, $(ARCH))" "64"
4         # lowest 64-bit API level
5         API_LEVEL := 21
6 else ifeq "$(ARCH)" "i386"
7         # clone(2) declaration is present only since this api level
8         API_LEVEL := 17
9 else
10         # lowest supported 32-bit API level
11         API_LEVEL := 16
12 endif
14 ifeq "$(ARCH)" "arm"
15         SYSROOT_ARCH := arm
16         STL_ARCH := armeabi-v7a
17         TRIPLE := armv7-none-linux-androideabi
18         ARCH_CFLAGS += -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -marm
19 else ifeq "$(ARCH)" "aarch64"
20         SYSROOT_ARCH := arm64
21         STL_ARCH := arm64-v8a
22         TRIPLE := aarch64-none-linux-android
23 else ifeq "$(ARCH)" "i386"
24         SYSROOT_ARCH := x86
25         STL_ARCH := x86
26         TRIPLE := i686-none-linux-android
27 else ifeq "$(ARCH)" "mips64r6"
28         SYSROOT_ARCH := mips64
29         STL_ARCH := mips64
30         TRIPLE := mips64el-none-linux-android
31 else ifeq "$(ARCH)" "mips32"
32         SYSROOT_ARCH := mips
33         STL_ARCH := mips
34         TRIPLE := mipsel-none-linux-android
35 else
36         SYSROOT_ARCH := $(ARCH)
37         STL_ARCH := $(ARCH)
38         TRIPLE := $(ARCH)-none-linux-android
39 endif
41 ifeq "$(findstring 86,$(ARCH))" "86"
42         TOOLCHAIN_DIR := $(STL_ARCH)-4.9
43 else ifeq "$(ARCH)" "arm"
44         TOOLCHAIN_DIR := arm-linux-androideabi-4.9
45 else
46         TOOLCHAIN_DIR := $(subst -none,,$(TRIPLE))-4.9
47 endif
49 ifeq "$(ARCH)" "arm"
50         TOOL_PREFIX := arm-linux-androideabi
51 else
52         TOOL_PREFIX := $(subst -none,,$(TRIPLE))
53 endif
55 ifeq "$(HOST_OS)" "Linux"
56         HOST_TAG := linux-x86_64
57 else ifeq "$(HOST_OS)" "Darwin"
58         HOST_TAG := darwin-x86_64
59 else
60         HOST_TAG := windows-x86_64
61 endif
63 GCC_TOOLCHAIN = $(NDK_ROOT)/toolchains/$(TOOLCHAIN_DIR)/prebuilt/$(HOST_TAG)
65 OBJCOPY ?= $(GCC_TOOLCHAIN)/bin/$(TOOL_PREFIX)-objcopy
66 ARCHIVER ?= $(GCC_TOOLCHAIN)/bin/$(TOOL_PREFIX)-ar
68 ifeq "$(findstring clang,$(CC))" "clang"
69         ARCH_CFLAGS += -target $(TRIPLE) -gcc-toolchain $(GCC_TOOLCHAIN)
70         ARCH_LDFLAGS += -target $(TRIPLE) -gcc-toolchain $(GCC_TOOLCHAIN)
71 endif
73 ARCH_CFLAGS += --sysroot=$(NDK_ROOT)/sysroot \
74         -isystem $(NDK_ROOT)/sysroot/usr/include/$(TOOL_PREFIX) \
75         -D__ANDROID_API__=$(API_LEVEL) \
76         -isystem $(NDK_ROOT)/platforms/android-$(API_LEVEL)/arch-$(SYSROOT_ARCH)/usr/include
78 ARCH_LDFLAGS += --sysroot=$(NDK_ROOT)/platforms/android-$(API_LEVEL)/arch-$(SYSROOT_ARCH) -lm
80 ARCH_CXXFLAGS += \
81         -isystem $(NDK_ROOT)/sources/cxx-stl/llvm-libc++/include \
82         -isystem $(NDK_ROOT)/sources/android/support/include \
83         -isystem $(NDK_ROOT)/sources/cxx-stl/llvm-libc++abi/include
85 ARCH_LDFLAGS += \
86         -L$(NDK_ROOT)/sources/cxx-stl/llvm-libc++/libs/$(STL_ARCH) \
87         $(NDK_ROOT)/sources/cxx-stl/llvm-libc++/libs/$(STL_ARCH)/libc++_static.a \
88         -lc++abi \
89         -nostdlib++