Android.mk and Application.mk – these are the two important files which are used in android ndk project build lifecycle. Those who got to work with android ndk projects are better familiar with these two.
I first encounter with these at my office for a project. To build ndk application I needed to add necessary configurations to those files. There are two help file for Android.mk and Application.mk . The help files are located into the “NDK_ROOT/docs/ANDROID-MK.html” and “NDK_ROOT/docs/APPLICATION-MK.html” where NDK_ROOT is the directory where your ndk files are located in.
To be master on android ndk build toolchain one first need to read the two help files. Here are some highlights about what we can do with this files-
Application.mk file
1. APP_PROJECT_PATH – configure the c/cpp source file directory
2. APP_OPTIM – mode debug or release
3. APP_CFLAGS / APP_CPPFLAGS – settings for compiler flags
4. APP_ABI – configure machine code generation for different CPU architechture, like MIPS, x86, armeabi etc.
5. APP_STL – choose C++ runtime library, needed to configure using C++ stl classes
Android.mk file:
1. Including source files, ony by one or using regular expression to recursively choose files
2. How to include prebuilt static or shared library files ?
3. What kind of target the project will be built with, like – share library or static library or machine executable file ?
4. How to build different modules from the codebase ?
5. LOCAL_CPP_FEATURES for using rtti ( Run time type information ) and/or cpp exceptions.
6. and some other important things included in the build toolchain.