ANDROID.MK parsing

Source: Internet
Author: User

First, variable description:

1.local_path : = $ (call My-dir)

This line of code at the beginning of the android.mk is used to give the path to the current file

Local_path for locating source files in the development tree

Macro function ' My-dir ', provided by the compilation system, for returning the current path (that is, the directory containing the android.mk file)

2.local_package_name : = secsettings or local_module: = Secsettings

Identifies each module that is described in the Android.mk file. The name must be unique and contains no spaces.

Note that the compilation system will automatically generate the appropriate prefixes and suffixes:

Static libraries: Also known as document files (Archive file), a collection of multiple. o files, and the suffix for static library files in Linux is ". a"

Local_static_java_libraries: = Static-library

Local_static_java_libraries + = LIBSR

Shared libraries: A collection of multiple. o files, a shared library model named ' Foo ' will generate ' libfoo.so ' files.

Local_shared_libraries: = Libbmapapiengine_v1_3_5

Important NOTE: If you name the library ' Libhelloworld ', the compilation system will not add any lib prefixes, and will generate libhelloworld.so, This is to support the Android.mk file from the source code of the Android platform. If you really need to do this.

3.local_module_tags : = Optional/user/eng/tests Optional Definition

The module is compiled under all versions/the module is compiled only under the user version/the module is compiled only under the ENG Version/The module is only compiled under the tests version

4.Local_overrides_packages : = Settings

Overwrite all other apps with the same name

5.local_certificate : = Platform Optional Definition

Compile an apk that requires platform signature instead of share compilation

6.local_proguard_flag_files : = Proguard.flags

Specifies the proguard.flags file that does not need to confuse the native method with the variable

The main function of Proguard is to confuse: Java bytecode is generally very easy to decompile. In order to protect the Java source code very well, we often confuse the compiled class file.

7.local_proguard_enabled:= disabled

Develop a compiled project and do not use code obfuscation tools for code obfuscation:

8.local_classpath: = $ (local_path)/lib/maps.jar

9.local_src_files : = $ (call All-java-files-under, SRC)
Local_src_files + = Src/com/android/settings/nearby/imediaserver.aidl

The variable local_src_files must contain the source code file that will be compiled into the module

Do not list header files and include files here, because the compiling system will automatically find the dependent files for you; Just list the source code files that are passed directly to the compiler.

10.local_resource_overlay_dir : = $ (local_path)/tn_chn_open/res

Specify the resource file path

11.local_aapt_flags : = $ (sec_dev_app_local_aapt_flags)

Specify Packaging resource Files

Because the Android tool AAPT will compile and compress the files under res/by default when the APK file is generated, and some system files do not need to be compressed (otherwise it needs to be decompressed when the file is read), the android.mk file needs to specify the following options to tell the AAPT tool not to compress the files.

For example, the Android.mk file needs to specify the following options to tell the AAPT tool not to compress all. dat files:

Local_aapt_flags: =-0. dat

II. Interpretation of statements

1.include $ (clear_vars)

Clear_vars is provided by the build system (can see its definition in the Android installation directory/build/core/config.mk file for clear_vars:=$ (Build_system)/clear_vars.mk), Because all the compilation control files are in the same GNU make execution environment, all the variables are global, so the GNU makefile clears many local_xxx variables, for example: Local_module, Local_src_files, Local_ Static_libraries, wait ...

The meaning of this statement is to include the script file that the Clear_vars variable points to.

2. Include $ (build_package)

Specify compilation Build APK

3.include $ (build_static_library)

For compiling a static library, a file named lib$ (Local_module). A is generated.

Static libraries are not copied to the APK package, but can be used to compile shared libraries.

4.include $ (build_shared_library)

Point to the compilation script, compile the listed source code files into a shared library according to all the local_xxx variables, and generate a file named lib$ (local_module). So

Note: You must define Local_module and local_src_files at least before you include this file

5.$ (Info res_overlay tn_chn_open/res/)

Equivalent to the log information in the code

6.ifneq ($(filter santos10%,$ (target_product)),)

##############################################

endif

Determine if a string containing santos10***, if any, enters the IFNEQ condition

Filter has two parameters

7..ifneq ($ (Filter%wifi,$ (PROJECT_NAME)),)

###############################################

endif

Determine if a ***wifi is included, if there is a condition to enter IFNEQ

8. + =

Originally had the words not to cover

9.:=

The previous value is emptied, re-copied

10.local_resource_overlay_dir:=$ (LOCAL_PAHT)/tn_chn_open/res $ (local_resource_overlay_dir)

Equivalent

Local_resource_overlay_dir : = $ (local_paht)/tn_chn_open/res

Local_resource_overlay_dir + = Local_resource_overlay_dir ( original )

11.ifeq ($ (findstring santos3g,$ (project_name)),cantos3g)

###################################################

endif

If the PROJECT_NAME contains santos3g, enter the ifeq condition

How to find values for PROJECT_NAME and target_product

1. Search in the compiled log to get

2. Look in the script,

. In/buildscript/build

Export project_name=${_build_project_name%%_*}

And _build_project_name is $

Our input, if it's santos103g_chn_open, so project_name=santos103g.

Ifeq (true,$ (call Spf_check, Ec_product_feature_temp_region,chn))

Check area is not CHN, if yes, enter ifeq condition

Three ,Settings of the android.mk of the relevant introduction

1. Regional macro:sec_product_feature_temp_region

Ifeq (true,$ (call SPF_CHECK,SEC_PRODUCT_FEATURE_TEMP_REGION,HKTW))

Ifeq (true,$ (call Spf_check,sec_product_feature_temp_region,chn))

2. operator macro:sec_product_feature_temp_operator

Ifeq (true,$ (call SPF_CHECK,SEC_PRODUCT_FEATURE_TEMP_OPERATOR,CMCC))

Ifeq (true,$ (call SPF_CHECK,SEC_PRODUCT_FEATURE_TEMP_OPERATOR,CTC))

3. Double cajon:build_multisim_project

Sec_product_feature_common_dsds_support

Ifeq ($ (build_multisim_project), true)

The control card related file path is: tn_multisim/...

Ifeq (true,$ (call spf_check,sec_product_feature_common_dsds_support,true))

The control card related file path is: tn_dsds/...

The definition path of the above three macros:

Jbp_main/maple/jbp98x/model/vendor/wilcoxds/secproductfeature.wilcoxdszn

Opengrok/android/vendor/samsung/wilcoxds/secproductfeature.wilcoxdszn

# region, Operator feature

sec_product_feature_temp_region= "CHN"

Sec_product_feature_temp_operator= "CU"

#Common DSDS Feature

Sec_product_feature_common_dsds_support=true

# another micro for Multisim module

Sec_product_feature_common_use_multisim=true

4. Platform Control macro: build_ril_marvell_ril

Ifeq ($ (Build_ril_marvell_ril), true)

5. Project name control:target_product

IFNEQ ($ ($ (filter wilcoxds%, $ (target_product)),)

ANDROID.MK parsing

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.