Application. mk introduction:
0. Basic Knowledge:
Application. mk is used to describe the modules required by the application. Application. mk is usually placed in: $ Project/JNI/application. mk.
2. Application. mk variable:
Application. mk is a small part of GNU makefile. It can define the following variables.
App_project_path:
Point to the project root directory in an absolute path.
App_modules:
Optional. If not defined, ndk compiles all modules in Android. mk.
If so, only the modules specified by app_modules in Android. mk and their dependent modules are compiled.
App_optim:
Optional. Set to 'release' or 'debug '. The ndk build system determines the optimization level based on this option.
Release is the default mode and uses high-level optimization. Debug uses a low-level optimization project.
NOTE: If Android: debuggable = "true" is set in androidmanifest. XML ". The default value is debug.
App_cflags:
C/C ++ cflags. This cflags will replace the specified module in Android. mk.
App_cppflags:
Cppflags that are only valid for C ++ code
App_build_script:
Generally, the ndk build system looks for Android. mk from $ (app_project_path)/JNI/
That is, $ (app_project_path)/JNI/Android. mk
If you want to change this behavior, modify: app_build_script.
App_abi:
By default, the ndk build system generates 'armeabi 'Abi. It is an armv5te Instruction Set and uses soft floating point.
You can modify this variable.
The armeabi of the SAM machine can be used on both armv5te and ARMv7-a.
If you want to use hard floating point. FPU.
App_abi: = armeabi-v7a
Or both of them support:
App_abi: = armeabi armeabi-v7a
App_stl:
By default, ndk build system provides the minimum C ++ support (/system/lib/libstdc ++. So ).
You can modify it as follows:
APP_STL := stlport_static --> static STLport library
APP_STL := stlport_shared --> shared STLport library
APP_STL := system --> default C++ runtime library
App_cxxflags:
App_cflags.
App_platform:
This entry is very important, because Sam often needs to compile executable programs under some ndk, but it is found that include directly points to Android-3.
-I/opt/Android-ndk/android-ndk-r8b/platforms/Android-3/arch-arm/usr/include
It's strange. I have always thought it was a bug of Android ndk-build.
Later, I accidentally found that this option can be modified normally.
App_platform = Android-8
Note: The ndk version is ndk r7c. (The makefile generated by ndk-build is not identical for different ndk versions)