Syntax parsing for Android. mk Files

Source: Internet
Author: User

Below is the MTK-ANDROIDFM module Android. MK Code content:


1Ifeq ($ (mtk_fm_support), yes)
2Local_path:= $ (call My-dir)
3Include $ (clear_vars)
4Local_module_tags: = Optional
5Local_certificate: = Media
6Local_src_files: = $ (call All-java-files-under, SRC)
7Local_src_files + = Src/com/mediatek/fmradio/ifmradioservice.aidl
8Local_package_name: = Fmradio
9Local_jni_shared_libraries: = Libfmjni
TenInclude $ (build_package)
One
A# ============================================================
-Include $ (call all-makefiles-under,$ (Local_path))
-endif

The first line is the switch defined in the Projectconfig.mk file.

Second, Local_path
This variable is used to give the path to the current file. You must define at the beginning of the android.mk that the variable will not be cleared by $ (clear_vars), so each android.mk needs to be defined only once (even if you have several modules defined in one file).

Third, include $ (clear_vars)
Clear_vars is provided by the build system, specifying that GNU makefile clears many local_xxx variables for you (such as Local_module, Local_src_files, Local_static_ LIBRARIES, et cetera ...), except Local_path. This is necessary because all the compilation control files are in the same GNU make execution environment, and all the variables are global.

Four, local_module_tags: = optional
Local_module_tags: =user eng tests optional
User: The module is compiled only under the user version
ENG: This module is only compiled under the ENG version
Tests: The module is compiled only under the tests version
Optional: Refers to the module compiled under all versions

V. Local_certificate: = Media
The key used to specify the signature, if not specified, the default value to use Testkey,local_certificate can be set as follows:

Local_certificate: = Platform Local_certificate: = Shared local_certificate: = Media

In android.mk these configurations, you need to add the following to the manifest node in the APK source Androidmanifest.xml file:

Android:shareduserid= "Android.uid.system" android:shareduserid= "android.uid.shared" android:shareduserid= " Android.media "These exactly correspond to the configuration in the Mk file above.
In the Android source build/target/product/security/directory has the following 4 pairs of key:1, Media.pk8 and MEDIA.X509.PEM; 2, Platform.pk8 and Platform.x509.pem; 3, Shared.pk8 and SHARED.X509.PEM; 4, Testkey.pk8 and Testkey.x509.pem; where the "*.pk8" file is the private key, "*." X509.pem "File is a public key, which requires an understanding of asymmetric encryption.

Liu, Local_src_files
Lists all the source files that need to be compiled, and the macro all-java-files-under is defined in BUILD/CORE/DEFINITIONS.MK.

Seven, local_package_name the name of the package.

Eight, local_jni_shared_libraries
put the libfmjni.so file into the APK package.

Nine, include $ (build_package)
Represents the current Java code build into apk

10.include $ (call all-makefiles-under,$ (Local_path))
Represents a file that needs to build subdirectories in the directory so that the compilation system will look for android.mk in subdirectories under the current directory to compile other programs such as so.

Syntax parsing for Android. mk Files

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.