ANDROIDNDK Study Notes

Source: Internet
Author: User
Tags types of extensions

NDK Detailed system Parameters :

Local_path: = $ (call My-dir)

Specifies the Local_path variable, which is used to find the source file, meaning that the Local_path variable is defined as the directory path where the current file is located, and My-dir is a compiler-provided macro function that is used to obtain the current directory.

$ (call import-add-path,$ (Local_path)/. /.. /.. /.. /)

Import-add-path is used to add the path to the NDK_MODULE_PATH environment variable.

Include $ (clear_vars)

Clear_vars is provided by the build system, specifying that the GNU makefile for you to clear all local_xxx variables except Local_path, such as Local_module,local_src_files,local_shared_ Libraries and so on. Multiple compilation modules can be defined in a android.mk, with each compiled module starting with the include $ (clear_vars) and ending with the include $ (build_xxx).

Local_module: = cocos2dcpp_shared

Each android.mk file must define a module labeled Local_module, the name must be unique and does not contain any spaces, the compilation system will automatically modify the generated file prefix and suffix, If a module for the Foo Shared library will be changed to libfoo.so, if your module name is Libfoo, the compiled system generates a file for libfoo.so, and does not add the prefix, when you use the Android platform will automatically recognize

Local_module_filename: = Libcocos2dcpp

Local_module_filename specifying the module file name

Local_src_files: = hellocpp/main.cpp \

.. /.. /classes/appdelegate.cpp \

.. /.. /classes/helloworldscene.cpp

Local_src_files Specifies that the module is a C + + source file (. C. cpp. cc), separated by spaces between the files, and \ is a continuation character.

local_cpp_extension: = . cc. cpp

The default C + + file name extension is. cpp, local_cpp_extension can be used to specify different types of extensions, and do not forget the previous point

Local_c_includes + = $ (local_path)/. /.. /classes

Local_c_includes + = $ (local_path)/. /.. /classes/game

Local_c_includes + = $ (local_path)/. /.. /classes/lobby

The Local_c_includes parameter specifies the header file path that this module contains, separated by spaces between multiple paths

Local_whole_static_libraries + = Cocos2dx_static

Local_whole_static_libraries + = Cocosdenshion_static

The local_whole_static_libraries parameter is used to specify all the static library modules that are dependent on this module (connecting to a static connection library does not remove "Daed code", What is Dead code, which is a snippet and variable that the caller module will never use)

Local_static_libraries + = Cocos2dx_static

Local_static_libraries + = Cocosdenshion_static

The Local_ static_libraries parameter is used to specify all static library modules that are dependent on this module (when connecting to a static connection library, the "Daed code" is removed, which is what dead is, which is a snippet and variable that the caller module will never use)

include $ (build_static_library) represents the compilation into a static library.

include $ (build_shared_library) means to compile into a dynamic library ( i.e. shared library ) .

include $ (build_executable) represents a compilation into an executable program.

include $ (prebuilt_static_library) represents the definition of a precompiled static library module.

include $ (prebuilt_shared_library) represents the definition of a precompiled Dynamic library module.

$ (call import-module,cocos2dx) Import the External module (this indicates the import COCOS2DX Module , Cocos2dx is the module name Local_module , note that the command searches the path of the external module in the Ndk_module_path specified in or through $ (call import-add-path,$ (Local_path)/. /.. /) command import ).

Writing precompiled static libraries android.mk

Local_path: = $ (call My-dir)

Include $ (clear_vars)

Local_module: = libxml2_static

Local_src_files: = $ (Local_path)/lib/android/libxml2.a

Local_export_c_includes: = $ (Local_path)/include

Include $ (prebuilt_static_library)

Writing precompiled dynamic Libraries android.mk

Local_path: = $ (call My-dir)

Include $ (clear_vars)

Local_module: = Libyvimsdk

Local_src_files: = $ (Local_path)/libs/$ (Target_arch_abi)/libyvimsdk.so

Local_export_c_includes: = $ (Local_path)/include

Include $ (prebuilt_shared_library)

ANDROIDNDK Study Notes

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.