Reprint to: http://blog.csdn.net/bmw7bmw7/article/details/45482599 app android.mk file analysis 2015-05-04 16:22 52 people Read reviews (0) Favorites Report Android App source code
[Plain] view plaincopyprint?
1. # Call Macro My-dir, this macro returns the path where the current Android.mk file is located
2. local_path:= $ (call My-dir)
3.
4. # contains the Clear_vars variable pointing to the Mk file Build/core/clear_vars.mk, which is mainly used to clear compile-time dependent compiler variables
5. Include $ (clear_vars)
6.
7. # Specify the tag tag for the current target, see the previous Android compilation system chapter for its effect
8. Local_module_tags: = user
9.
10. # The compilation target module of the current MK file
Local_package_name: = Leddemo
12.
13. # Compile the target depends on the source code, it called a macro All-java-files-under, the macro is defined in the BUILD/CORE/DEFINITIONS.MK
14. # indicates that all Java files are found in the current directory, and the Java files found are returned
Local_src_files: = $ (Callall-java-files-under, SRC)
16.
17. # When compiling an Android application, specify the API level, which is the version of the current program's build platform
18. # This means that the current source version is used
Local_sdk_version: = Current
20.
21. # The most important thing is this code, which contains a file build/core/package.mk, according to the previous set of compiled variables, compiled to build the Android package file, ie: apk file
. Include $ (build_package)
# Call Macro My-dir, this macro returns the path where the current Android.mk file is located
Local_path:= $ (call My-dir)
# contains the Clear_vars variable pointing to the Mk file Build/core/clear_vars.mk, which is mainly used to clear compile-time dependent compiler variables
Include $ (clear_vars)
# Specify the tag tag for the current target, see the previous Android compilation system chapter for its effect
Local_module_tags: = user
# the compilation target module of the current MK file
Local_package_name: = Leddemo
# Compile the target depends on the source code, it called a macro All-java-files-under, the macro is defined in the BUILD/CORE/DEFINITIONS.MK
# indicates that all Java files are found in the current directory, and the Java files found are returned
Local_src_files: = $ (Callall-java-files-under, SRC)
# when compiling an Android application, specify the API level, which is the build platform version of the current program
# This means that the current source version is used
Local_sdk_version: = Current
# The most important thing is this code, it contains a file build/core/package.mk, according to the previous set of compiled variables, compiled to build the Android package file, ie: apk file
Include $ (build_package)
Comments are added to the code above, and basically every compilation target has a declaration similar to the one above:
Local_module_tags
Local_package_name
Local_src_files
Since all android.mk are eventually included in the compiled system, each target module is compiled with local_path:= $ (call My-dir) to specify the current target directory and then the include $ (clear_vars) First, clear the important compilation variables that the compilation system relies on, and then generate a new compilation variable.
App android.mk file analysis