Guo Xiaoxing
Weibo: Guo Xiaoxing's Sina Weibo
Email:[email protected]
Blog: http://blog.csdn.net/allenwells
Github:https://github.com/allenwells
The role and characteristics of a application.mk file
Function: Describes the modules (static or dynamic) that are required in the application.
Location: Application.mk usually placed in P ROJ E C T /JNI/APPLICaTIo.mk, Project refers to the path to the item.
Variable 2.1 app_project_path for two application.mk files
A required variable, and gives an absolute path to the root directory of the application project.
2.2 App_modules
Optional variable, if not defined, the module name is defined in the local_module of the Android.mk file, The NDK is compiled with the default module declared in Android.mk and contains all the sub-files (makefile files), and the NDK automatically calculates the module dependencies. If defined, it must be a space-delimited list of modules.
2.3 App_optm
Optional variable, used to define release or debug, can be used to change the priority when compiling the application module. The release mode is default and generates highly optimized binary code. Debug mode generates binary code that is not optimized, can detect many bugs, and can be debugged.
Note : You can debug release and debug binaries, but release builds tend to provide less information in debug reply, some variables are optimized and cannot be detected, code reordering can make code stepping difficult, and stack traces may not be reliable.
2.4 App_cflags
A set of C compiler switches that are passed when compiling any C or C + + source code for any module. It can be used to change the build of a module that a given application needs to rely on, rather than modifying its own android.mk file.
2.5 App_build_script
By default, the NDK build system will (AP Pp ROJ E C TP AT H )/JNIunderFindFindaanameto beANd RoId .mkof thetextpieces. that,theinitatextpieces (App_project_path)/jni/android.mk
If you want to reload this behavior, you can define app_build_script to point to a different build script. A non-absolute path will always be resolved to a path relative to the NDK top-level directory.
2.6 App_abi
By default, the NDK's compilation system generates machine code based on the "Armeabi" ABI. You can use App_abi to select a different ABI.
Example
Hardware FPU instructions are supported on ARMV7 devices. You can use the App_abi: = armeabi-v7 support IA-32 instruction set, you can use App_abi: = x86 support These three kinds, you can use App_abi: = Armeabi armeabi-v7a x86.
2.7 App_stl
By default, the NDK build system provides a C + + header file for the smallest C + + Runtime library (/system/lib/libstdc++.so) given by the Android system. However, the NDK comes with another C + + implementation that you can use or link to in your own application. Define APP_STL to make the following choices:
APP_STL := stlport_static staticlibraryAPP_STL := stlport_shared libraryAPP_STL := system defaultlibrary
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Android Local Development technology: Compile script application.mk