


Android ndk toolchain android#
1 # Change this to whereever you keep NDKĥ DBG ?= 0 6 7 # Debug/Release configurationĨ ifeq ( $( DBG ) ,1) 9 MODE_FLAGS = -DDEBUG -g -O0ġ0 else 11 MODE_FLAGS = -Os -fdata-sections -ffunction-sectionsġ2 endif 13 14 # NDK configuration (clang)ġ7 NDK_TARGETVER = 27 18 19 # Target arch - here aarch64 for androidĢ0 NDK_TARGETARCH = aarch64-linux-androidĢ7 28 # Architecture of a machine that does cross compilationģ2 NDK_TOOLS = $(NDK )/toolchains/llvm/prebuilt/ $(NDK_HOSTARCH )/binģ5 NDK_LIBS = $(NDK )/toolchains/ $(NDK_TARGETARCH )- $(NDK_TOOLVER )/prebuilt/linux-x86_64/lib/gcc/ $(NDK_TARGETARCH )/4.9.xģ6 NDK_INCLUDES = -I $(NDK )/sysroot/usr/include \ģ7 -I $(NDK )/sysroot/usr/include/ $(NDK_TARGETARCH ) 38 NDK_SYSROOT = $(NDK )/platforms/android- $(NDK_TARGETVER )/arch- $(NDK_TARGETSHORTARCH ) 39 40 # Options common to compiler and linkerĤ5 -target $(NDK_TARGETARCH ) 46 47 # Compiler optionsĤ9 $(NDK_INCLUDES ) 50 51 # Linker optionsĥ6 -B $(ANDROID_NDK )/toolchains/ $(NDK_TARGETARCH )- $(NDK_TOOLVER )/prebuilt/linux-x86_64/ $(NDK_TARGETARCH )/bin \ĥ7 -L $(NDK_LIBS ) 58 59 all : 60 $(NDK_TOOL ) -c $(SRCDIR )/main.c -o $(OBJDIR )/main.o $(CFLAGS ) 61 $(NDK_TOOL ) -o main $(OBJDIR )/main.o $(LDFLAGS ) 62 63 adb-prepare : 64 adb rootĬopy this file to same directory as main. Keywords: Android NDK Toolchains LLVM is an umbrela project now, and it contains multiple modular and reusable compiler and toolchain technologies. The Android NDK toolchain and Xcode IDE are based on the GCC compiler. The NDK includes a set of cross-toolchains (compilers, linkers, etc.) that can generate native ARM binaries on Linux, OS X, and Windows (with Cygwin) platforms.
