Android. mk Template

Source: Internet
Author: User

Multiple executable programs, dynamic libraries, and static libraries can be generated in an android. mk file.

1. Compile the Application Template:

# Test exe

Local_path: = $ (call my-DIR)

# Include $ (clear_vars)

Local_src_files: = Main. c

Local_module: = test_exe

# Local_c_includes: =

# Local_static_libraries: =

# Local_shared_libraries: =

Include $ (build_executable)

(Cainiao-level explanation: = is the meaning of the value assignment, $ is to reference the value of a variable.) Add the source file path to local_src_files and add the header file path to local_c_pair des, local_static_libraries is added to the static library to be linked (*. a) Name: add the dynamic library to be linked in local_shared_libraries (*. so) name. local_module indicates the final name of the module, and build_executable indicates compiling in an executable program.

2. Compile the static library template:

# Test static lib

Local_path: = $ (call my-DIR)

Include $ (clear_vars)

Local_src_files: =/

Helloworld. c

Local_module: = libtest_static

# Local_c_includes: =

# Local_static_libraries: =

# Local_shared_libraries: =

Include $ (build_static_library)

In general, it is similar to the above. build_static_library indicates compiling a static library.

3. Compile the dynamic library template:

# Test shared lib

Local_path: = $ (call my-DIR)

Include $ (clear_vars)

Local_src_files: =/

Helloworld. c

Local_module: = libtest_shared

Target_prelink_modules: = false

# Local_c_includes: =

# Local_static_libraries: =

# Local_shared_libraries: =

Include $ (build_shared_library)

In general, it is similar to the above. build_shared_library indicates compiling a shared 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.