In the previous android--compilation system initialization setting , there is the configuration and basic difference of the target_build_variant of parsing and compiling,
Some of these compile controls are right but the local_module_tags control in the module's android.mk does not apply to the current android4.2, which records my control of the module.
Writing is not easy, reproduced please specify the source: http://blog.csdn.net/jscese/article/details/39209341
A.
Local_module_tags:
The first is the variable placed in the ANDROID.MK, which is defaulted in/BUILD/CORE/BASE_RULES.MK:
Local_module_tags: = $ (sort $ (local_module_tags)) ifeq (, $ (local_module_tags)) local_module_tags: = Optionalendif
And not local_module_tags: =optional will all be installed into SYSTEM.IMG!
The values that local_module_tags can take on Android 4.2 are:
# only the tags mentioned in this test is expected to is set by module# makefiles. Anything else is either a typo or a source of unexpected# Behaviors.ifneq ($ (filter-out debug ENG tests Optional Samples S Hell_ash shell_mksh,$ (Local_module_tags)),) $ (warning unusual TAGS $ (local_module_tags) on $ (local_module) at $ (local_ PATH)) endif
Debug ENG Tests optional samples Shell_ash Shell_mkshThese few values, no user, this is a difference from the previous one!
Where target_build_variant is still the corresponding:
Eng:
Default type, the type of local_module_tags installed is/build/core/main.mk:
Ifeq ($ (target_build_variant), eng) Tags_to_install: = Debug Eng
Installing the module defined in the product_packages
User:
For distribution, like the previously described shutdown log,shel,rootl, compiled Odex android--compile Odex protection
the value of local_module_tags cannot be a user
Installing those module only depends on the product_packages
Userdebug:
For debugging, the type of installation Local_module_tags is/build/core/main.mk:
Ifeq ($ (user_variant), Userdebug) # Pick up some extra useful tools Tags_to_install + = Debug
Installing the module defined in the product_packages
Symbols directory:
Here a phenomenon, regardless of the Module is the apk or LIB, sometimes in a separate mmm compile, it can be installed to/out in the system corresponding location, and finally can be packaged into the system.img
However, if the overall make-j* compilation system, then the corresponding apk. Lib will be generated in/out under the symbols/system corresponding location, and finally will not be packaged into the system system.img!
This is because the module's local_module_tags and the current compilation of Target_build_variant did not meet the above-mentioned rules, module does not identify the need to install!
Can follow the above rules, modify the module's local_module_tags or see the following in the product_packages Add module!
This only distinguishes the module installation control, you can see that in 4.2 The control level of the module is the product_packages this variable!
Two.
product_packages:
This variable is assigned in many. MK, such as in device Device.mk, and is similar to this:
# Jscese Add Libusb and Compat lib, usb-modeswitch execute binary for 3G product_packages + = rild libusb Libus B-compat Usb_modeswitch #end
's All
+=Cumulative operation!
This means that the module will be compiled and installed into the system anyway.
Simply record the process of product_packages :
First, in the MAIN.MK,
Product_modulesAnd
Product_files:
# The base list of modules to build for this product are specified # by the appropriate product definition file, which was included # by Product_config.make. Product_modules: = $ (products.$ (internal_product). product_packages) # Filter out the overridden PACKAGES before doing expansion product_modules: = $ (Filter-out $ (f Oreach p, $ (product_modules), $ (packages.$ (p). OVERRIDES)), $ (product_modules)) $ (call expand-required-modules,product_modules,$ (product_modules) ) Product_files: = $ (Call Module-installed-files, $ (product_modules))
Modules_to_install:
Modules_to_install: = $ (sort $ (all_default_installed_modules) $ (product_files) $ (foreach tag,$ (tags_ To_install), $ ($ (tag) _modules)) $ (Call Get-tagged-modules, shell_$ (Target_shell)) $ (custom_modules) )
This is a variable that needs to be installed, useful to the variables mentioned above
Tags_to_installAnd also
Product_files
Modules_to_installThere will also be some filtering processing, specifically to see the MAIN.MK
All_default_installed_modules:
# Build/core/makefile contains extra stuff that we don ' t want to pollute this# top-level Makefile with. It expects that all_default_installed_modules# contains everything that's built during the current make but it also furth er# extends All_default_installed_modules. All_default_installed_modules: = $ (Modules_to_install) include $ (build_system)/makefilemodules_to_install: = $ (Sort $ (All_default_installed_modules)) All_default_installed_modules: =
Reload into Android's Makefile file, which is based on
All_default_installed_modulesTo install! There is no depth here.
Make compiles with the following dependencies:
Droid
# Building A full system--the default was to build Droidcoredroid:droidcore dist_files .... Phony:droid
Droidcore:
# Build files and then package it into the ROM formats. PHONY:droidcoredroidcore:files systemimage $ (installed_bootimage_target) $ (installed_recoveryimage _target) $ ( installed_userdataimage_target) $ ( installed_cacheimage_target) $ ( installed_files_file)
Files:
# All of the droid stuff, in directories. PHONY:filesfiles:prebuilt $ (modules_to_install) $ (Modules_to_check) $ (installed_android_info_txt_ TARGET)
You can see the dependency on the above analysis to the modules_to_install !
android--control factors for compiling and installing module