Parsing the syntax of the Android. mk File
This is the Android. mk file of the Browser module of RDA8810 (Android4.2.2 ).
LOCAL_PATH: = $ (call my-dir)
Include $ (CLEAR_VARS)
LOCAL_MODULE_TAGS: = optional
LOCAL_STATIC_JAVA_LIBRARIES: = \
Android-common \
Guava \
Android-support-v13 \
Android-support-v4 \
LOCAL_SRC_FILES: = \
$ (Call all-java-files-under, src )\
Src/com/android/browser/EventLogTags. logtags
LOCAL_PACKAGE_NAME: = Browser
LOCAL_PROGUARD_FLAG_FILES: = proguard. flags
LOCAL_EMMA_COVERAGE_FILTER: = *,-com. android. common .*
# We need the sound recorder for the Media Capture API.
LOCAL_REQUIRED_MODULES: = SoundRecorder
Include $ (BUILD_PACKAGE)
# Additionally, build tests in sub-folders in a separate. apk
Include $ (call all-makefiles-under, $ (LOCAL_PATH ))
The first line, LOCAL_PATH:
This variable is used to give the path of the current file. You must go to Android. the START definition of the mk file. This variable is not cleared by $ (CLEAR_VARS), so every Android. mk only needs to be defined once (even if you have defined several modules in a file );
Row 2, include $ (CLEAR_VARS)
CLEAR_VARS is provided by the compilation system, specifying that GNU_MAKEFILE clears many LOCAL_XXX variables for you. This is necessary except LOCAL_PATH, because all compilation control is in the same gnu make execution environment, all variables are global;
Line 3: LOCAL_MODULE_TAGS
This variable has four options to choose from:
1. user: This module is compiled only in the user version;
2. eng: This module is compiled only in the eng version;
3. tests: This module is compiled only in the tests version;
4. optional: This module is compiled in all versions.
Line 4: LOCAL_STATIC_JAVA_LIBRARIES
The alias of The. jar library.
The fifth line, LOCAL_SRC_FILES
Lists all source files to be compiled. The macro all-java-files-under is defined in build/core/definitions. mk.
Line 6: LOCAL_PACKAGE_NAME
Indicates the package name, which is generally the same as the folder name.
Line 7: LOCAL_PROGUARD_FLAG_FILES
Configuration related to obfuscation code
Row 8: LOCAL_EMMA_COVERAGE_FILTER
This is not understandable for the time being. If you have understood it, please help me to answer it.
Line 9: LOCAL_REQUIRED_MODULES
Recording configuration interface
Row 10, include $ (BUILD_PACKAGE)
Indicates that the current JAVA code is built into APK
Row 11th, include $ (call all-makefiles-under, $ (LOCAL_PATH ))
Indicates the files that need to build sub-directories under this directory. In this way, the compilation system will search for Android. mk in the sub-directories under the current directory to compile other programs such as so.
OVER