Application. mk for Android ndk Development

Source: Internet
Author: User

From: http://blog.csdn.net/weidawei0609/article/details/6561280

Application. mk:

Application. mk describes the dynamic and static libraries required by the application.

 

Storage location:

Files are usually stored in the JNI folder of the project directory.

 

Variable definition:

Since application. mk is only a part of GNU makefile, some variables need to be defined.

 

-App_project_path

This variable should be assigned the project root directory address, which is optional.

-App_modules

This option is optional. If this option is not available, ndk automatically compiles all modules defined in the Android. mk file and its sub-modules.

 

When this option is available, it must be a list of modules, separated by spaces or listed in Android. mk.

 

-App_optim

This option can be defined as release or debug. This option is used to change the optimization level when compiling the program module.

The default option is release, which is optimized at a higher level. In debug, too much optimization is not performed to facilitate debugging.

You can set Android: debuggable to true in the <Application> tag in the manifest file to change the default value to debug.

In fact, both Debug and release allow users to debug, but more information is provided in debug mode.

 

-APP_BUILD_SCRIPT
By default, the ndk compiling system searches for the Android. mk file in the JNI folder of the project directory. If you want to overwrite this behavior
You can define this variable. If you specify a non-absolute path, this path is always considered as a path relative to the top-level directory of ndk.
 
-APP_ABI
The default condition is armeabi. You can use this option to modify it. For example, to support the hardware FPU command on armv7, you can modify it as follows:
APP_ABI := armeabi-v7a
Or a device that supports armv5te and armv7
APP_ABI := armeabi armeabi-v7a
-APP_STL
By default, the ndk compilation system uses the lightweight C ++ Runtime Library provided by the Android system.
/system/lib/libstdc++.so
Ndk itself provides users with a selectable C ++ library, which can be used or linked to their own applications.
For example:
APP_STL := stlport_static    --> static STLport library       APP_STL := stlport_shared    --> shared STLport library       APP_STL := system            --> default C++ runtime library

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.