- #MAKEFILE CROSS COMPILE C STATIC LIBRARY LINUX MAC OS CGO INSTALL#
- #MAKEFILE CROSS COMPILE C STATIC LIBRARY LINUX MAC OS CGO ANDROID#
For Linux and OS X one need to customize the above command accordingly.
#MAKEFILE CROSS COMPILE C STATIC LIBRARY LINUX MAC OS CGO INSTALL#
Note: As I am extracting the toolchain on Windows Box, so I passed the /cygwin/e/android/standalone-14 in my install directory path.
The above script creates a directory name “ standalone-14” in “ E:\android\” directory of my Window box $NDK/build/tools/make-standalone-toolchain.sh –platform=android-14 –install-dir = /cygdrive/e/android/standalone-14
#MAKEFILE CROSS COMPILE C STATIC LIBRARY LINUX MAC OS CGO ANDROID#
Step 1: Extract the standalone cross-compiler toolchain. I will explain how we can use the standalone cross-compilers for creating ARM binary (a static library) from C++ source files. Hopefully this will help you to save a lot of time and efforts.Īndroid NDK provides set of tools for compiling and using C and/or C++ source files and generate the native ARM binaries (static, shared and executable) on Linux, OS X and Windows, which can be further used in Android application through Java Native Interface (JNI) calls. The idea came into my mind after putting time and effort for compiling and using an open source library CS-MAP in Android application. This post is intended for those who wants to compile and reuse their existing C/C++ code or who wants to compile an open source code for their Android applications.