http://android.cloudchou.com/build/core/Makefile.php
build/core/Makefile.mk
在main.mk里定义了许多目标,而Makefile定义了各个目标的生成规则
编译输出用的颜色,类似的还有 CL_GRN CL_YLW CL_BLU CL_MAG CL_CYN CL_RST
CL_RED表示用echo输出时使用红色作为前景色
输出的文件名的tag,文件名中会含有该Tag,比如ota包的名字
Pick a reasonable string to use to identify files.
ifneq "" "$(filter eng.%,$(BUILD_NUMBER))"
# BUILD_NUMBER has a timestamp in it, which means that
# it will change every time. Pick a stable value.
FILE_NAME_TAG := eng.$(USER)
else
FILE_NAME_TAG := $(BUILD_NUMBER)
endif
示例:
eng.cloud
编译目标类型是不是tests
如果编译目标里含有tests则该值为true
检验需要拷贝的产品文件集合里是否含有apk文件,如果有apk,会提示出错,并告诉用户需要使用BUILD_PREBUILT代替
$(1):需要检验的文件集合
过滤重复的 sourcefile:detstfile 对
在devcie配置时,将使用PRODUCT_COPY_FILES,表示需要拷贝到目标机上的文件
格式为:
PRODCUT_COPY_FILES += \
sourcefile : destfile
INSTALLED_DEFAULT_PROP_TARGET := $(TARGET_ROOT_OUT)/default.prop
示例:out/target/product/i9100/root/default.prop
所有默认将安装的模块
ALL_DEFAULT_INSTALLED_MODULES += $(INSTALLED_DEFAULT_PROP_TARGET)
ALL_DEFAULT_INSTALLED_MODULES += $(INSTALLED_BUILD_PROP_TARGET)
default.prop里要用到的属性集合
ADDITIONAL_DEFAULT_PROPERTIES := \
$(call collapse-pairs, $(ADDITIONAL_DEFAULT_PROPERTIES))
ADDITIONAL_DEFAULT_PROPERTIES += \
$(call collapse-pairs, $(PRODUCT_DEFAULT_PROPERTY_OVERRIDES))
ADDITIONAL_DEFAULT_PROPERTIES := $(call uniq-pairs-by-first-component, \
$(ADDITIONAL_DEFAULT_PROPERTIES),=)
该目标就是将ADDITIONAL_DEFAULT_PROPERTIES的属性集合输出到default.prop文件里
然后调用build/tools/post_process_prps.py脚本对default.prop文件做去重处理
并且如果ro.debuggable为1,将设置persist.sys.usb.config的属性为adb
INSTALLED_BUILD_PROP_TARGET := $(TARGET_OUT)/build.prop
示例:out/target/product/i9100/system/build.prop
ifeq ($(DEFAULT_SYSTEM_DEV_CERTIFICATE),build/target/product/security/testkey)
BUILD_VERSION_TAGS += test-keys
else
BUILD_VERSION_TAGS += dev-keys
endif
BUILD_VERSION_TAGS := $(subst $(space),$(comma),$(sort $(BUILD_VERSION_TAGS)))
一个约定的tag列表用于描述编译配置,将用来生成build_desc,和BUILD_FINGERPRINT
示例: debug,dev-keys
一个可读的字符串用于描述编译细节
build_desc := $(TARGET_PRODUCT)-$(TARGET_BUILD_VARIANT) $(PLATFORM_VERSION) $(BUILD_ID) $(BUILD_NUMBER) $(BUILD_VERSION_TAGS)
对应BUILD_DISPLAY_ID
用于唯一标志某次BUILD的字符串,被ota server使用
示例:OPPO/oppo_12069/FIND5:4.1.1/JRO03L/1362469752:user/release-keys
ifeq (,$(strip $(BUILD_FINGERPRINT)))
BUILD_FINGERPRINT := $(PRODUCT_BRAND)/$(TARGET_PRODUCT)/$(TARGET_DEVICE):$(PLATFORM_VERSION)/$(BUILD_ID)/$(BUILD_NUMBER):$(TARGET_BUILD_VARIANT)/$(BUILD_VERSION_TAGS)
endif
ifneq ($(words $(BUILD_FINGERPRINT)),1)
$(error BUILD_FINGERPRINT cannot contain spaces: "$(BUILD_FINGERPRINT)")
endif
当用户打开设置 关于手机时 显示的 参数
示例:cm_find5-userdebug 4.2.2 JDQ39E eng.cloud.20130814.132653 test-keys
ifeq ($(TARGET_BUILD_VARIANT),user)
# User builds should show:
# release build number or branch.buld_number non-release builds
# Dev. branches should have DISPLAY_BUILD_NUMBER set
ifeq "true" "$(DISPLAY_BUILD_NUMBER)"
BUILD_DISPLAY_ID := $(BUILD_ID).$(BUILD_NUMBER)
else
BUILD_DISPLAY_ID := $(BUILD_ID)
endif
else
# Non-user builds should show detailed build information
BUILD_DISPLAY_ID := $(build_desc)
endif
如果产品配置在 PRODUCT_PROPERTY_OVERRIDES变量里添加ro.product.locale.language
那么product_property_override_locale_language将使用该语言
如果产品配置在 PRODUCT_PROPERTY_OVERRIDES变量里添加ro.product.locale.region
那么product_property_overrides_locale_region将使用该区域
从列表里选择第一个locale作为参数, 并且把它分割为lanague和区域
获取默认语言,默认语言设置通过在 PRODUCT_PROPERTY_OVERRIDES变量里添加ro.product.locale.language
获取默认区域 默认区域设置通过在 PRODUCT_PROPERTY_OVERRIDES变量里添加ro.product.locale.locale
生成build.prop的工具
BUILDINFO_SH := build/tools/buildinfo.sh
生成步骤:
1)设置好TARGET_BUILD_TYPE,TARGET_DEVICE 等变量后,调用buildinfo.sh生成build.prop文件
2)如果有system.prop,则将system.prop的属性追加到build.prop文件
3)如果还有额外的$(ADDITIONAL_BUILD_PROPERTIES),将其追加到build.prop文件
4)调用build/tools/post_process_props.py对build.prop做去重处理
需要充build.prop里移除的属性集合,生成sdk-build.prop并不需要这些属性
INSTALLED_SDK_BUILD_PROP_TARGET := $(PRODUCT_OUT)/sdk/sdk-build.prop
示例:out/target/product/i9100/sdk/sdk-build.prop
从build.prop里移除sdk_build_prop_remove所指的属性集,便得到sdk-build.prop文件
安装包 统计文件
PACKAGE_STATS_FILE := $(PRODUCT_OUT)/package-stats.txt
示例:out/target/product/i9100/package-stats.txt
从$(ALL_DEFAULT_INSTALLED_MODULES)获取%.jar %.apk之类的文件
便得到需要统计的package
调用build/tools/dump-package-stats脚本对所有的jar和apk文件进行统计
包和给包签名的密钥之间的映射. 将被post-build 签名工具所用
只是给输入参数添加了一个回车符
$(1) 包和签名的密钥之间的映射
示例:
out/target/product/find5/obj/PACKAGING/apkcerts_intermediates/cm_find5-apkcerts-eng.cloud.txt
内容示例:
name="ThemeManagerTests.apk" certificate="build/target/product/security/testkey.x509.pem" private_key="build/target/product/security/testkey.pk8"
生成规则:
每个PACKAGE会被添加至$(PACKAGES)
如果为某个PACKAGE设置了key,那么$(PACKAGES.$(p).EXTERNAL_KEY将为true),
将所有package的签名密钥输出到$(APKCERTS_FILE)里
伪目标,如果是用该目标将生成$(APKCERTS_FILE)
是否生成模块信息
若定义了该变量,可输出所有模块的信息
MODULE_INFO_FILE := $(PRODUCT_OUT)/module-info.txt
示例: out/target/product/find5/module-info.txt
里面的内容有:
"NAME=\"$(m)\""
"PATH=\"$(strip $(ALL_MODULES.$(m).PATH))\""
"TAGS=\"$(strip $(filter-out _%,$(ALL_MODULES.$(m).TAGS)))\"" \
"BUILT=\"$(strip $(ALL_MODULES.$(m).BUILT))\"" \
"INSTALLED=\"$(strip $(ALL_MODULES.$(m).INSTALLED))\"" >> $(MODULE_INFO_FILE)))
dev key 用于给package以及Ota包签名
产品交付时将被重新签名,我们希望签名用的密钥文件的后缀是.pk8和.x509.pem
DEFAULT_KEY_CERT_PAIR := $(DEFAULT_SYSTEM_DEV_CERTIFICATE)
在Device配置文件里可定义该变量,变量值为给包签名的密钥的名称
ifneq ($(OTA_PACKAGE_SIGNING_KEY),)
DEFAULT_KEY_CERT_PAIR := $(OTA_PACKAGE_SIGNING_KEY)
endif
为我们知道的一切生成一个event log tags文件
all_event_log_tags_file := $(TARGET_OUT_COMMON_INTERMEDIATES)/all-event-log-tags.txt
示例:out/target/common/obj/all-event-log-tags.txt
为我们知道的要安装的东西生成一个event log tags文件
event_log_tags_file := $(TARGET_OUT)/etc/event-log-tags
示例:
out/target/product/i9100/etc/event-log-tags
Include tags from all packages that we know about
all_event_log_tags_src := \
$(sort $(foreach m, $(ALL_MODULES), $(ALL_MODULES.$(m).EVENT_LOG_TAGS)))
PDK builds will already have a full list of tags that needs to get merged
in with the ones from source
pdk_fusion_log_tags_file := $(patsubst $(PRODUCT_OUT)/%,$(_pdk_fusion_intermediates)/%,$(filter $(event_log_tags_file),$(ALL_PDK_FUSION_FILES)))
调用build/tools/merge-event-log-tags.py对$(all_event_log_tags_src)进行处理得到
文件内容示例:
205011 google_mail_switch (direction|1)
调用build/tools/merge-event-log-tags.py对$(event_log_tags_src)等文件进行处理得到
生成ramdisk的文件集合,这些文件都位于out/target/product/i9100/root
INTERNAL_RAMDISK_FILES := $(filter $(TARGET_ROOT_OUT)/%, \
$(ALL_PREBUILT) \
$(ALL_COPIED_HEADERS) \
$(ALL_GENERATED_SOURCES) \
$(ALL_DEFAULT_INSTALLED_MODULES))
BUILT_RAMDISK_TARGET := $(PRODUCT_OUT)/ramdisk.img
示例:out/target/product/i9100/ramdisk.img
INSTALLED_RAMDISK_TARGET := $(BUILT_RAMDISK_TARGET)
调用mkbootfs程序对out/target/product/i9100/root处理然后再调用minigzip程序处理即得到ramdisk.img
调用mkbootimg程序时传递的参数,需特别小心,在Device配置文件可直接为该变量添加参数
INTERNAL_BOOTIMAGE_ARGS := \
$(addprefix --second ,$(INSTALLED_2NDBOOTLOADER_TARGET)) \
--kernel $(INSTALLED_KERNEL_TARGET) \
--ramdisk $(INSTALLED_RAMDISK_TARGET)
ifdef BOARD_KERNEL_CMDLINE
INTERNAL_BOOTIMAGE_ARGS += --cmdline "$(BOARD_KERNEL_CMDLINE)"
endif
ifdef BOARD_KERNEL_BASE
INTERNAL_BOOTIMAGE_ARGS += --base $(BOARD_KERNEL_BASE)
endif
BOARD_KERNEL_PAGESIZE := $(strip $(BOARD_KERNEL_PAGESIZE))
ifdef BOARD_KERNEL_PAGESIZE
INTERNAL_BOOTIMAGE_ARGS += --pagesize $(BOARD_KERNEL_PAGESIZE)
endif
内核启动参数,这个在Devcie配置文件BoardConfig.mk里配置
内核基址,这个在Devcie配置文件BoardConfig.mk里配置
现在需要使用BOARD_MKBOOTIMG_ARGS添加制作boot.img的参数
BOARD_MKBOOTIMG_ARGS := --ramdisk_offset 0x02000000
INSTALLED_BOOTIMAGE_TARGET := $(PRODUCT_OUT)/boot.img
out/target/product/i9100/boot.img
tmp_dir_for_image := $(call intermediates-dir-for,EXECUTABLES,boot_img)/bootimg
示例:
out/target/product/find5/obj/EXECUTABLES/boot_img_indeterminates
如果定义TARGET_BOOTIMAGE_USE_EXT2为true
那么使用external/genext2fs/mkbootimg_ext2.sh 程序 并传递参数$(INTERNAL_BOOTIMAGE_ARGS) 生成boot.img
否则
调用mkbootimg程序并传递参数$(INTERNAL_BOOTIMAGE_ARGS) 生成boot.img
Create the rule to combine the files into text and html forms
$(1) - Plain text output file
$(2) - HTML output file
$(3) - File title
$(4) - Directory to use. Notice files are all $(4)/src. Other
directories in there will be used for scratch
$(5) - Dependencies for the output files
The algorithm here is that we go collect a hash for each of the notice
files and write the names of the files that match that hash. Then
to generate the real files, we go print out all of the files and their
hashes.
These rules are fairly complex, so they depend on this makefile so if
it changes, they'll run again.
target_notice_file_txt := $(TARGET_OUT_INTERMEDIATES)/NOTICE.txt
示例:out/target/product/i9100/obj/NOTICE.txt
target_notice_file_html := $(TARGET_OUT_INTERMEDIATES)/NOTICE.html
示例:out/target/product/i9100/obj/NOTICE.html
target_notice_file_html_gz := $(TARGET_OUT_INTERMEDIATES)/NOTICE.html.gz
示例:out/target/product/i9100/obj/NOTICE.html.gz
tools_notice_file_txt := $(HOST_OUT_INTERMEDIATES)/NOTICE.txt
示例::out/host/linux-x86/obj/NOTICE.txt
tools_notice_file_html := $(HOST_OUT_INTERMEDIATES)/NOTICE.html
示例:out/host/linux-x86/obj/NOTICE.html
kernel_notice_file := $(TARGET_OUT_NOTICE_FILES)/src/kernel.txt
示例:out/target/product/i9100/obj/NOTICE_FILES/src/kernel.txt
pdk_fusion_notice_files := $(filter $(TARGET_OUT_NOTICE_FILES)/%, $(ALL_PDK_FUSION_FILES))
ALL_PDK_FUSION_FILES里得到符合$(TARGET_OUT_NOTICE_FILES)/%的文件
利用minigzip将$(target_notice_file_html)压缩生成out/target/product/i9100/obj/NOTICE.html.gz
installed_notice_html_gz := $(TARGET_OUT)/etc/NOTICE.html.gz
示例:out/target/product/i9100/system/etc/NOTICE.html.gz
生成规则:
将$(target_notice_file_html_gz)拷贝至system/etc/NOTICE.html.gz
The kernel isn't really a module, so to get its module file in there, we
make the target NOTICE files depend on this particular file too, which will
then be in the right directory for the find in combine-notice-files to work.
生成规则:
将prebuilts/qemu-kernel/arm/LINUX_KERNEL_COPYING拷贝生成$(kernel_notice_file)
伪目标,用于生成在out/target/product/i9100/system/etc/otacerts.zip
生成规则:
将$(DEFAULT_KEY_CERT_PAIR).x509.pem打包为otacerts.zip
生成的img文件用的格式,可能为空,也可能为ext2, ext3,ext4
是否使用ext2格式的镜像类型,
示例(在devcie目录的BoardConfig.mk里设置):
TARGET_USERIMAGES_USE_EXT2 := true
如果设置为true,那么
INTERNAL_USERIMAGES_USE_EXT := true
INTERNAL_USERIMAGES_EXT_VARIANT := ext2
是否使用ext3格式的镜像类型,
示例(在devcie目录的BoardConfig.mk里设置):
TARGET_USERIMAGES_USE_EXT3 := true
如果设置为true,那么
INTERNAL_USERIMAGES_USE_EXT := true
INTERNAL_USERIMAGES_EXT_VARIANT := ext3
是否使用ext4格式的镜像类型,
示例(在devcie目录的BoardConfig.mk里设置):
TARGET_USERIMAGES_USE_EXT4 := true
如果设置为true,那么
INTERNAL_USERIMAGES_USE_EXT := true
INTERNAL_USERIMAGES_EXT_VARIANT := ext4
是否关闭稀疏的ext格式
在BoardConfig.mk里设置,
TARGET_USERIMAGES_SPARSE_EXT_DISABLED := true
如果设置了TARGET_USERIMAGES_SPARSE_EXT_DISABLED为true
那么
INTERNAL_USERIMAGES_SPARSE_EXT_FLAG := -s
生成userimage依赖的文件
ifeq ($(INTERNAL_USERIMAGES_USE_EXT),true)
INTERNAL_USERIMAGES_DEPS := $(MKEXTUSERIMG) $(MAKE_EXT4FS) $(SIMG2IMG) $(E2FSCK)
else
INTERNAL_USERIMAGES_DEPS := $(MKYAFFS2)
endif
$(INTERNAL_USERIMAGES_DEPS)所指的文件 所在的 目录 集合
生成词典文件
$(1): the path of the output dictionary file
词典的词有:
fs_type=$(INTERNAL_USERIMAGES_EXT_VARIANT)
system_size=$(BOARD_SYSTEMIMAGE_PARTITION_SIZE)
userdata_size=$(BOARD_USERDATAIMAGE_PARTITION_SIZE)
cache_fs_type=$(BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE)
cache_size=$(BOARD_CACHEIMAGE_PARTITION_SIZE)
extfs_sparse_flag=$(INTERNAL_USERIMAGES_SPARSE_EXT_FLAG)
mkyaffs2_extra_flags=$(mkyaffs2_extra_flags)
selinux_fc=$(TARGET_ROOT_OUT)/file_contexts
从所有要安装的模块里选出安装在$(PRODUCT_OUT)/utilities的文件
生成所有安装在$(PRODUCT)/utitility目录的文件
INSTALLED_RECOVERYIMAGE_TARGET := $(PRODUCT_OUT)/recovery.img
使用mka recoveryimage生成的文件
示例:
out/target/product/i9100/recovery.img
recovery镜像根文件系统使用的init.rc文件
在BoardConfig.mk文件里设置
示例:
TARGET_RECOVERY_INITRC := device/samsung/i9100g/rootdir/recovery.rc
recovery镜像根文件系统是的init.rc文件,
如果设置了TARGET_RECOVERY_INITRC,那么使用TARGET_RECOVERY_INITRC作为根文件系统的init.rc
否则使用bootable/recovery/etc/init.rc作为根文件系统的init.rc
是否用recovery模式做充电模式,该宏在cm10.1已经被取消了,
预制的内核,适配设备时,常拿不到内核源码,可使用该宏设置已经编译好的内核
示例:
TARGET_PREBUILT_RECOVERY_KERNEL := device/samsung/i9100g/kernel
编译Recovery使用的内核
ifneq ($(TARGET_PREBUILT_RECOVERY_KERNEL),)
recovery_kernel := $(TARGET_PREBUILT_RECOVERY_KERNEL) # Use prebuilt recovery kernel
else
recovery_kernel := $(INSTALLED_KERNEL_TARGET) # same as a non-recovery system
endif
recovery_uncompressed_ramdisk := $(PRODUCT_OUT)/ramdisk-recovery.cpio
示例:
out/target/product/i9100/ramdisk-recovery.cpio
recovery使用的根文件系统
recovery_ramdisk := $(PRODUCT_OUT)/ramdisk-recovery.img
示例:
out/target/product/i9100/ramdisk-recovery.img
recovery_build_prop := $(INSTALLED_BUILD_PROP_TARGET)
示例:
out/target/product/i9100/system/build.prop
recovery_binary := $(call intermediates-dir-for,EXECUTABLES,recovery)/recovery
示例:
out/target/common/obj/EXECUTABLES/recovery_intermediates/recovery
recovery_resources_common := $(call include-path-for, recovery)/res
示例:
bootable/recovery/res
recovery_resources_private := $(strip $(wildcard $(TARGET_DEVICE_DIR)/recovery/res))
示例:
device/htc/pyramid/recovery/res
recovery_root_private := $(strip $(wildcard $(TARGET_DEVICE_DIR)/recovery/root))
示例:
device/htc/pyramid/recovery/root
编译recovery依赖的资源文件,包括bootable/recovery/res下的图片文件,device配置目录recovery/res下的文件
,device配置目录recovery/root下的文件
recovery_resource_deps := $(shell find $(recovery_resources_common) \
$(recovery_resources_private) $(recovery_root_private) -type f)
可通过TARGET_RECOVERY_FSTAB设置recovery使用的分区表文件
在BoardConfig.mk里设置
示例:
TARGET_RECOVERY_FSTAB := device/samsung/i9100g/recovery.fstab
recovery使用的分区表文件,
如果未设置TARGET_RECOVERY_FSTAB,那么使用
$(TARGET_DEVICE_DIR)/recovery.fstab 如 device/samsung/i9100g/recovery.fstab
否则使用$(TARGET_RECOVERY_FSTAB)的值
recovery资源的记录:
RECOVERY_RESOURCE_ZIP := $(TARGET_OUT)/etc/recovery-resource.dat
示例:
out/target/product/i9100/system/etc/recovery-resource.dat
调用mkboot程序使用的参数
其中的参数有:
--second ,$(INSTALLED_2NDBOOTLOADER_TARGET)
--kernel $(recovery_kernel)
--ramdisk $(recovery_ramdisk)
--cmdline "$(BOARD_KERNEL_CMDLINE)"
--base $(BOARD_KERNEL_BASE)
--pagesize $(BOARD_KERNEL_PAGESIZE)
--ramdiskaddr $(BOARD_FORCE_RAMDISK_ADDRESS)
在BoardConfig.mk里设置启动内核参数
示例:
BOARD_KERNEL_CMDLINE := console=ttyHSL0,115200,n8 androidboot.hardware=find5 lpj=67677
在BoardConfig.mk里设置kernel基址
BOARD_KERNEL_BASE := 0x40000000
在BoardConfig.mk里设置页大小
BOARD_KERNEL_PAGESIZE := 4096
在BoardConfig.mk里设置ramdisk地址
BOARD_FORCE_RAMDISK_ADDRESS :=
从所有安装模块$(ALL_MODULES.$(module).INSTALLED) $(ALL_DEFAULT_INSTALLED_MODULES)
得到安装在out/target/product/i9100/recovery下的文件
用于给ota包签名用的公钥. 用dev-keys来签名
OTA_PUBLIC_KEYS := $(DEFAULT_SYSTEM_DEV_CERTIFICATE).x509.pem
ifneq ($(OTA_PACKAGE_SIGNING_KEY),)
OTA_PUBLIC_KEYS := $(OTA_PACKAGE_SIGNING_KEY).x509.pem
PRODUCT_EXTRA_RECOVERY_KEYS := $(DEFAULT_SYSTEM_DEV_CERTIFICATE)
endif
示例:
build/target/product/security/testkey.x509.pem
PRODUCT_EXTRA_RECOVERY_KEYS := $(DEFAULT_SYSTEM_DEV_CERTIFICATE)
PRODUCT_EXTRA_RECOVERY_KEYS += build/target/product/security/cm
包含签名公钥的key文件,recovery 程序将用该公钥来验证是否
RECOVERY_INSTALL_OTA_KEYS := \
$(call intermediates-dir-for,PACKAGING,ota_keys)/keys
示例:
out/target/product/find5/obj/PACKAGING/ota_keys_intermediates/keys
DUMPKEY_JAR := $(HOST_OUT_JAVA_LIBRARIES)/dumpkey.jar
示例:out/host/linux-x86/framework/dumpkey.jar
生成规则:
使用dumpkey.jar程序将公钥文件转为keys,并保存为$(RECOVERY_INSTALL_OTA_KEYS)
root.ts文件只是一个标志文件,表示recoery根文件系统文件是否都已经生成
TARGET_RECOVERY_ROOT_TIMESTAMP := $(TARGET_RECOVERY_OUT)/root.ts
示例:
out/target/product/find5/recovery/root.ts
生成规则:
1. 新建目录 $(TARGET_RECOVERY_OUT)
2. 建立目录 $(TARGET_RECOVERY_ROOT_OUT)/etc $(TARGET_RECOVERY_ROOT_OUT)/tmp
3. 拷贝root目录下的文件到recovery/root,做recovery根文件系统的底包
4. 删除 $(TARGET_RECOVERY_ROOT_OUT)/init*.rc
5. 拷贝init.rc 为 recovery/root/init.rc
6. 拷贝init.recovery.*rc文件 -cp $(TARGET_ROOT_OUT)/init.recovery.*.rc $(TARGET_RECOVERY_ROOT_OUT)/
7. 拷贝recovery程序放到recovery/root/sbin目录
8. 拷贝资源文件 cp -rf $(recovery_resources_common) $(TARGET_RECOVERY_ROOT_OUT)/
9. 拷贝私有的资源文件 $(recovery_resources_private)
10.拷贝私有的根目录文件 $(recovery_root_private)
11. 拷贝recovery.fstab文件至recovery/root/etc/recovery.fstab
12. 拷贝公钥导出的key文件
13.利用build.prop和$(INSTALLED_DEFAULT_PROP_TARGET)生成 recovery/root/default.prop文件
14.处理default.prop文件ro.build.date.utc设置为0,ro.adb.secure=1取消
15. touch $(TARGET_RECOVERY_ROOT_TIMESTAMP),便生成了recovery镜像的根文件系统
利用mkbootfs程序将recovery/root生成根文件系统未压缩的镜像
利用minigzip将$(recovery_uncompressed_ramdisk)生成根文件系统镜像ramdisk-recovery.img
在BoardConfig.mk里设置用于生成镜像的makfile,象索尼的机器生成boot.img比较特殊,会设置该值
指向一个makefile文件,会用该文件生成boot.img和recovery.img
利用mkbootimg程序将内核 根文件系统镜像 以及设置的参数$(INTERNAL_RECOVERYIMAGE_ARGS)
生成recovery镜像
并检验生成的镜像是否超过预设值
将recoery/root/res下的文件打包生成 out/target/product/i9100/system/etc/recovery-resource.dat
生成recovery镜像 recovery.img
INSTALLED_RECOVERYZIP_TARGET := $(PRODUCT_OUT)/utilities/update.zip
示例:
out/target/product/i9100/utilities/update.zip
伪目标 依赖 $(INSTALLED_RECOVERYZIP_TARGET)
生成用于更新recovery的ota包
在BoardConfig.mk里设置BOARD_NAND_PAGE_SIZE nand的page size
yaffs文件系统有该选项
在BoardConfig.mk里设置BOARD_NAND_PAGE_SIZE nand的spare size
yaffs文件系统有该选项
编译yaffs文件系统的选项
mkyaffs2_extra_flags := -c $(BOARD_NAND_PAGE_SIZE)
mkyaffs2_extra_flags += -s $(BOARD_NAND_SPARE_SIZE)
从$(ALL_PDK_FUSION_FILES)里剔除被覆盖的apk模块得到PDK_FUSION_SYSIMG_FILES
从out/target/product/i9100/system/里取出ALL_PREBUILT, ALL_COPIED_HEADERS,ALL_GENERATED_SOURCES,ALL_DEFAULT_INSTALLED_MODULES,
ALL_DEFAULT_INSTALLED_MODULES,PDK_FUSION_SYSIMG_FILES,RECOVERY_RESOURCE_ZIP等类型的模块生成的文件
INTERNAL_SYSTEMIMAGE_FILES := $(filter $(TARGET_OUT)/%, \
$(ALL_PREBUILT) \
$(ALL_COPIED_HEADERS) \
$(ALL_GENERATED_SOURCES) \
$(ALL_DEFAULT_INSTALLED_MODULES) \
$(PDK_FUSION_SYSIMG_FILES) \
$(RECOVERY_RESOURCE_ZIP))
编译systemimage需要依赖的文件
FULL_SYSTEMIMAGE_DEPS := $(INTERNAL_SYSTEMIMAGE_FILES) $(INTERNAL_USERIMAGES_DEPS)
INSTALLED_FILES_FILE := $(PRODUCT_OUT)/installed-files.txt
安装的文件列表
示例:out/target/product/i9100/installed-files.txt
生成out/target/product/i9100/installed-files.txt
installed-files.txt里将记录每个安装在system目录下的所有文件的大小
规则:
使用工具build/tools/fileslist.py 处理 $(TARGET_OUT) 生成installed-files.txt
伪目标 依赖目标 $(INSTALLED_FILES_FILE)
最终生成out/target/product/i9100/installed-files.txt
systemimage_intermediates := \
$(call intermediates-dir-for,PACKAGING,systemimage)
示例:
out/target/product/find5/obj/PACKAGING/systemimage_intermediates
BUILT_SYSTEMIMAGE := $(systemimage_intermediates)/system.img
示例:
out/target/product/find5/obj/PACKAGING/systemimage_intermediates/system.img
利用build/tools/releasetools/build_image.py 将 system目录下的文件打包成镜像,
并将镜像信息输出至system_image_info.txt
# $(1): output file 镜像文件路径
直接调用函数build-systemimage-target生成
out/target/product/find5/obj/PACKAGING/systemimage_intermediates/system.img
INSTALLED_SYSTEMIMAGE := $(PRODUCT_OUT)/system.img
示例:
out/target/product/find5/system.img
SYSTEMIMAGE_SOURCE_DIR := $(TARGET_OUT)
示例:
out/target/product/find5/system
RECOVERY_FROM_BOOT_PATCH := $(intermediates)/recovery_from_boot.p
示例:
out/target/product/find5/obj/PACKAGING/recovery_patch_intermediates/recovery_from_boot.p
目标:生成中间文件recovery_from_boot.p
规则:利用$(HOST_OUT_EXECUTABLES)/imgdiff工具将recovery.img和boot.img进行对比并生成补丁文件recovery_from_boot.p
目标:生成system.img
规则: 将中间文件$(BUILT_SYSTEMIMAGE)和$(RECOVERY_FROM_BOOT_PATCH)拷贝至目标目录
并检查文件大小
目标:生成产品目录下的system.img文件
规则: 它是一个伪目标,依赖$(INSTALLED_SYSTEMIMAGE)目标
伪目标:和伪目标snod一起使用
如果目标里同时含有伪目标systemimage-nodeps 和 snod
那么将不做全编译,直接将现有的system目录下的文件打包生成system.img
利用 build/tools/mktarball.sh 工具用于生成system.tar.bz2
build/tools/mktarball.sh 脚本的参数:
$1:path to fs_get_stats program
$2: start dir
$3: subdir to tar up (from $2)
$4: target tar name
$5: target tarball name (usually $(3).bz2)
调用方式:
$(MKTARBALL) $(FS_GET_STATS) $(PRODUCT_OUT) system $(PRIVATE_SYSTEM_TAR) $(INSTALLED_SYSTEMTARBALL_TARGET)
system_tar := $(PRODUCT_OUT)/system.tar
示例:
out/target/product/find5/system.tar
INSTALLED_SYSTEMTARBALL_TARGET := $(system_tar).$(SYSTEM_TARBALL_FORMAT)
示例:
out/target/product/find5/system.tar
利用函数build-systemtarball-target生成system.tar.bz2
伪目标:和伪目标snod一起使用
如果目标里同时含有伪目标systemtarball-nodeps 和 snod
直接将现有的system目录下的文件打包生成system.tar.bz2
如果单独使用stnod
将生成system.tar.bz2
platform.zip里是否添加java资源,
如果时目标为platform-java,
则会添加java内容至platform.zip
ifneq (,$(filter platform-java, $(MAKECMDGOALS)))
PLATFORM_ZIP_ADD_JAVA := true
endif
INSTALLED_PLATFORM_ZIP := $(PRODUCT_OUT)/platform.zip
示例:
out/target/product/find5/platform.zip
伪目标,依赖于目标$(INSTALLED_PLATFORM_ZIP)
生成规则:
将system目录,notice文件 $(PDK_SYMBOL_FILES_LIST) 打包成platform.zip
如果时目标为platform-java,
则会添加java内容至platform.zip
伪目标: 依赖于目标platform,
生成platform.zip时,会添加java内容
生成boot.tar.bz2
规则:
1.创建目录$(PRODUCT_OUT)/boot
2.拷贝文件 包括 内核,根文件系统,第二阶段的bootloader至boot目录
3.拷贝cmdline至boot目录
4.利用build/tools/mktarball.sh 将boot目录下的内容生成boot.tar.bz2
boot_tar := $(PRODUCT_OUT)/boot.tar
INSTALLED_BOOTTARBALL_TARGET := $(boot_tar).$(BOOT_TARBALL_FORMAT)
示例:
out/target/product/find5/boot.tar.bz2
利用函数build-boottarball-target生成boot.tar.bz2
生成boot.tar.bz2,某些依赖没生成,也会继续生成boot.tar.bz2
和boottarball-nodeps一样, 生成boot.tar.bz2
安装在data目录的文件,一般只有test类型的模块才会安装在该模块
INTERNAL_USERDATAIMAGE_FILES := \
$(filter $(TARGET_OUT_DATA)/%,$(ALL_DEFAULT_INSTALLED_MODULES))
userdataimage_intermediates := \
$(call intermediates-dir-for,PACKAGING,userdata)
示例:
out/target/product/find5/obj/PACKAGING/userdata_intermediates
BUILT_USERDATAIMAGE_TARGET := $(PRODUCT_OUT)/userdata.img
示例:
out/target/product/find5/userdata.img
生成userdata.img
以及userdata_image_info.txt
利用的工具:
build/tools/releasetools/build_image.py
INSTALLED_USERDATAIMAGE_TARGET := $(BUILT_USERDATAIMAGE_TARGET)
示例:
out/target/product/find5/userdata.img
利用函数build-userdataimage-target生成userdata.img
伪目标,依赖于$(INSTALLED_USERDATAIMAGE_TARGET)
生成userdata.img
生成userdata.tar.bz2
规则:
利用build/tools/mktarball.sh 将data目录下的内容生成userdata.tar.bz2
userdata_tar := $(PRODUCT_OUT)/userdata.tar
示例:
out/target/product/find5/userdata.tar
INSTALLED_USERDATATARBALL_TARGET := $(userdata_tar).bz2
示例:
out/target/product/find5/userdata.tar.bz2
利用 build-userdatatarball-target 函数生成userdata.tar.bz2
利用 build-userdatatarball-target 函数生成userdata.tar.bz2
在BoardConfig.mk里配置,只有配置了该项 才可生成cache.img
安装在cache目录下的文件 集合
INTERNAL_CACHEIMAGE_FILES := \
$(filter $(TARGET_OUT_CACHE)/%,$(ALL_DEFAULT_INSTALLED_MODULES))
cacheimage_intermediates := \
$(call intermediates-dir-for,PACKAGING,cache)
示例:
out/target/product/find5/obj/PACKAGING/cache_intermediates
BUILT_CACHEIMAGE_TARGET := $(PRODUCT_OUT)/cache.img
示例:
out/target/product/find5/cache.img
生成cache.img和cache_image_info.txt
并会检验cache的大小
利用工具:build/tools/releasetools/build_image.py
是否使用diskingtall,在BoardConfig.mk里设置,
如果启用了该宏,那么将包含:
include bootable/diskinstaller/config.mk
host tools needed to build dist and OTA packages
DISTTOOLS := $(HOST_OUT_EXECUTABLES)/minigzip \
$(HOST_OUT_EXECUTABLES)/adb \
$(HOST_OUT_EXECUTABLES)/mkbootfs \
$(HOST_OUT_EXECUTABLES)/mkbootimg \
$(HOST_OUT_EXECUTABLES)/unpackbootimg \
$(HOST_OUT_EXECUTABLES)/fs_config \
$(HOST_OUT_EXECUTABLES)/mkyaffs2image \
$(HOST_OUT_EXECUTABLES)/zipalign \
$(HOST_OUT_EXECUTABLES)/bsdiff \
$(HOST_OUT_EXECUTABLES)/imgdiff \
$(HOST_OUT_JAVA_LIBRARIES)/dumpkey.jar \
$(HOST_OUT_JAVA_LIBRARIES)/signapk.jar \
$(HOST_OUT_EXECUTABLES)/mkuserimg.sh \
$(HOST_OUT_EXECUTABLES)/make_ext4fs \
$(HOST_OUT_EXECUTABLES)/simg2img \
$(HOST_OUT_EXECUTABLES)/e2fsck
生成ota包需要的工具集
OTATOOLS := $(DISTTOOLS) \
$(HOST_OUT_EXECUTABLES)/aapt
UNPACKBOOTIMG := $(HOST_OUT_EXECUTABLES)/unpackbootimg
示例:
out/host/linux-x86/bin/unpackbootimg
示例:
out/target/product/find5/obj/PACKAGING/target_files_intermediates/cm_find5-target_files-eng.cloud.zip
拷贝文件
$(1): Directory to copy
$(2): Location to copy it to
编译ota包需要的工具
built_ota_tools := \
$(call intermediates-dir-for,EXECUTABLES,applypatch)/applypatch \
$(call intermediates-dir-for,EXECUTABLES,applypatch_static)/applypatch_static \
$(call intermediates-dir-for,EXECUTABLES,check_prereq)/check_prereq \
$(call intermediates-dir-for,EXECUTABLES,sqlite3)/sqlite3 \
$(call intermediates-dir-for,EXECUTABLES,updater)/updater
在BoardConfig.mk里设置,用于指定扩展的 RELEASE TOOLS 所在的目录
如果不设置该项,默认扩展的release tools所在目录是
$(TARGET_DEVICE_DIR)/../common
生成中间ota包,示例: out/target/product/find5/obj/PACKAGING/target_files_intermediates/cm_find5-target_files-eng.cloud.zip
依赖:$(INSTALLED_BOOTIMAGE_TARGET) $(INSTALLED_RADIOIMAGE_TARGET) $(INSTALLED_RECOVERYIMAGE_TARGET)
$(INSTALLED_SYSTEMIMAGE) $(INSTALLED_USERDATAIMAGE_TARGET) $(INSTALLED_CACHEIMAGE_TARGET)
$(INSTALLED_ANDROID_INFO_TXT_TARGET) $(built_ota_tools) $(APKCERTS_FILE)
$(HOST_OUT_EXECUTABLES)/fs_config
为方便起见,称out/target/product/find5/obj/PACKAGING/target_files_intermediates/eng.cloud为$(zip_root)
生成规则:
1)删除中间目录下的所有文件
2)创建目录 $(zip_root)
3)创建目录 $(zip_root)/RECOVERY
4)拷贝recovery用的根文件系统至$(zip_root) /RECOVERY/RAMDISK
5)如果有内核 ,拷贝内核至$(zip_root) /RECOVERY
6)如果有第二阶段的bootloader,拷贝至$(zip_root)/RECOVERY
7)输出$(BOARD_KERNEL_CMDLINE)至 $(zip_root)/RECOVERY/cmdline
8)输出$(BOARD_KERNEL_BASE)至 $(zip_root)/RECOVERY/base
9)输出$(BOARD_KERNEL_PAGESIZE)至 $(zip_root)/RECOVERY/pagesize
10)创建目录 $(zip_root)/BOOT
11)如果有内核 ,拷贝内核至$(zip_root)/BOOT
12)如果有第二阶段的bootloader,拷贝至$(zip_root)/BOOT
13)输出$(BOARD_KERNEL_CMDLINE)至 $(zip_root)/BOOT/cmdline
14)输出$(BOARD_KERNEL_BASE)至 $(zip_root)/BOOT/base
15)输出$(BOARD_KERNEL_PAGESIZE)至 $(zip_root)/BOOT/pagesize
16)输出$(ZIP_SAVE_UBOOTIMG_ARGS)至 $(zip_root)/BOOT/ubootargs
17)拷贝radio.img至$(zip_root)/RADIO
18)拷贝产品目录子目录system的所有资源至$(zip_root)/SYSTEM
19)拷贝产品目录子目录data的所有资源至$(zip_root)/DATA
20)创建目录$(zip_root) /OTA/bin
21)创建目录$(zip_root) /META
22)拷贝app签名密钥文件$(APKCERTS_FILE)至$(zip_root)/META/apkcerts.txt
23)输出$(PRODUCT_OTA_PUBLIC_KEYS)至$(zip_root)/META/otakeys.txt
24)输出 recovery_api_version=$(PRIVATE_RECOVERY_API_VERSION)至$(zip_root)/META/misc_info.txt
25)如果定义了 BOARD_FLASH_BLOCK_SIZE,输出block_size=$(BOARD_FLASH_BLOCK_SIZE)至$(zip_root)/META/misc_info.txt
26)如果定义了BOARD_BOOTIMAGE_PARTITION_SIZE,输出boot_size=$(BOARD_BOOTIMAGE_PARTITION_SIZE)至$(zip_root)/META/misc_info.txt
27)如果定义了BOARD_RECOVERYIMAGE_PARTITION_SIZE,输出recovery_size=$(BOARD_RECOVERYIMAGE_PARTITION_SIZE)至$(zip_root)/META/misc_info.txt
28)输出tool_extensions=$(tool_extensions)至$(zip_root)/META/misc_info.txt
29)输出default_system_dev_certificate=$(DEFAULT_SYSTEM_DEV_CERTIFICATE) 至$(zip_root)/META/misc_info.txt
30) 如果定义了PRODUCT_EXTRA_RECOVERY_KEYS,则输出extra_recovery_keys=$(PRODUCT_EXTRA_RECOVERY_KEYS)至$(zip_root)/META/misc_info.txt
32)输出mkbootimg_args=$(BOARD_MKBOOTIMG_ARGS)至$(zip_root)/META/misc_info.txt
33)调用generate-userimage-prop-dictionary函数生成属性字典
34)将$(zip_root下的所有文件打包生成$(BUILT_TARGET_FILES_PACKAGE)
35)利用fsconfig程序对zip包里的SYSTEM,BOOT/RAMDISK,RAMDISK各自统计,并生成相应的filesystem_config.txt文件
36)把所有的filesystem_config.txt打包添加至$(BUILT_TARGET_FILES_PACKAGE)里
依赖于$(BUILT_TARGET_FILES_PACKAGE)目标
示例:
out/target/product/find5/cm_find5-ota-eng.cloud.zip
将中间ota包生成最终ota包的python脚本
默认为build/tools/releasetools/ota_from_target_files
在BoardConfig.mk里设置,
用于定义将中间ota包生成最终ota包的python脚本文件
在BoardConfig.mk里设置,如果定义了该宏,那么在ota包的updater-script脚本里会添加assert语句用的device,
避免将ota包刷至不能用的机型
示例:
TARGET_OTA_ASSERT_DEVICE := pyramid
生成最终的ota包
规则:
利用$(OTA_FROM_TARGET_SCRIPT)脚本处理$(BUILT_TARGET_FILES_PACKAGE),得到$(INTERNAL_OTA_PACKAGE_TARGET)
CM_TARGET_PACKAGE := $(PRODUCT_OUT)/cm-$(CM_VERSION).zip
示例:
out/target/product/find5/cm-10.1.zip
伪目标 生成最终ota包, 即out/target/product/find5/cm_find5-ota-eng.cloud.zip
依赖目标$(INTERNAL_OTA_PACKAGE_TARGET)
生成$(CM_TARGET_PACKAGE) 示例:out/target/product/find5/cm-10.1.zip
规则:
将$(INTERNAL_OTA_PACKAGE_TARGET)做硬链接,并删掉先前的文件,
最后计算md5
示例:
out/target/product/find5/cm_find5-img-eng.cloud.zip
默认为build/tools/releasetools/img_from_target_files
否则设置为TARGET_RELEASETOOL_IMG_FROM_TARGET_SCRIPT
在BoardConfig.mk里设置
用于定义将中间ota包生成最终img包的python脚本文件
生成$(INTERNAL_UPDATE_PACKAGE_TARGET),示例:out/target/product/find5/cm_find5-img-eng.cloud.zip
这个zip包里包含的都是img文件,一般用fastboot flash zip包的方式更新ROM
依赖$(INTERNAL_UPDATE_PACKAGE_TARGET)
生成$(INTERNAL_UPDATE_PACKAGE_TARGET),示例:out/target/product/find5/cm_find5-img-eng.cloud.zip
这个zip包里包含的都是img文件,一般用fastboot flash zip包的方式更新ROM
示例:
out/target/product/find5/obj/PACKAGING/tests_zip_intermediates/cm_find5-tests-eng.cloud.zip
生成$(BUILT_TESTS_ZIP_PACKAGE),示例:out/target/product/find5/obj/PACKAGING/tests_zip_intermediates/cm_find5-tests-eng.cloud.zip
zip_root为out/target/product/find5/obj/PACKAGING/tests_zip_intermediates
规则:
将$(TARGET_OUT_DATA)下的所有文件拷贝至$(zip_root)/DATA
然后将$(zip_root)/DATA下的文件打包成为$(BUILT_TESTS_ZIP_PACKAGE)
伪目标tests-zip-package
依赖$(BUILT_TESTS_ZIP_PACKAGE)
伪目标tests-build-target
依赖$(BUILT_TESTS_ZIP_PACKAGE)
伪目标tests
依赖$(BUILT_TESTS_ZIP_PACKAGE)
示例:
out/target/product/find5/cm_find5-symbols-eng.cloud.zip
生成$(SYSMBOLS_ZIP)即out/target/product/find5/obj/PACKAGING/tests_zip_intermediates/cm_find5-symbols-eng.cloud.zip
TARGET_OUT_UNSTRIPPED为 out/target/product/i9100/system/symbols
规则:
将$(TARGET_OUT_UNSTRIPPED)打包生成out/target/product/find5/obj/PACKAGING/tests_zip_intermediates/cm_find5-symbols-eng.cloud.zip
示例:out/target/product/find5/cm_find5-apps-eng.cloud.zip
目标: 生成$(APPS_ZIP) 示例:out/target/product/find5/cm_find5-apps-eng.cloud.zip
TARGET_OUT_APPS 示例: out/target/product/i9100/system/app
将$(TARGET_OUT_APPS)下的app打包生成$(APPS_ZIP)
EMMA_META_ZIP := $(PRODUCT_OUT)/emma_meta.zip
示例:
out/target/product/find5/emma_meta.zip
将$(TARGET_COMMON_OUT_ROOT)目录下的所有coverage.em打包成emma_meta.zip
伪目标
依赖于$(INTERNAL_DALVIK_MODULES),即dalvik的所有模块
INSTALLED_QEMU_KERNEL_TARGET := $(PRODUCT_OUT)/kernel-qemu
示例:
out/target/product/find5/kernel-qemu
模拟器用的文件
$(HOST_OUT_EXECUTABLES)/emulator$(HOST_EXECUTABLE_SUFFIX) \
$(INSTALLED_QEMU_KERNEL_TARGET) \
$(INSTALLED_RAMDISK_TARGET) \
$(recovery_ramdisk) \
$(INSTALLED_SYSTEMIMAGE) \
$(INSTALLED_USERDATAIMAGE_TARGET)
示例:out/target/product/find5/cm_find5-emulator-eng.cloud.zip
将$(INTERNAL_EMULATOR_PACKAGE_TARGET)打包成cm_find5-emulator-eng.cloud.zip
伪目标,生成模拟器包,依赖于$(INTERNAL_EMULATOR_PACKAGE_TARGET)
sdk_dir := $(HOST_OUT)/sdk
示例:
out/host/linux-x86/sdk
sdk_name := android-sdk_$(FILE_NAME_TAG)
sdk_name := $(sdk_name)_$(INTERNAL_SDK_HOST_OS_NAME)
示例:
sdk_name := android-sdk_eng.cloud.windows
host os name
ifeq ($(HOST_OS),darwin)
INTERNAL_SDK_HOST_OS_NAME := mac
else
INTERNAL_SDK_HOST_OS_NAME := $(HOST_OS)
endif
ifneq ($(HOST_OS),windows)
INTERNAL_SDK_HOST_OS_NAME := $(INTERNAL_SDK_HOST_OS_NAME)-$(HOST_ARCH)
endif
示例:
linux-x86 或者 mac-x86 或者 windows
编译sdk需要依赖的文件
sdk_dep_file := $(sdk_dir)/sdk_deps.mk
android tree files
ifeq ($(strip $(ATREE_FILES)),)
ATREE_FILES := \
$(ALL_PREBUILT) \
$(ALL_COPIED_HEADERS) \
$(ALL_GENERATED_SOURCES) \
$(ALL_DEFAULT_INSTALLED_MODULES) \
$(INSTALLED_RAMDISK_TARGET) \
$(ALL_DOCS) \
$(ALL_SDK_FILES)
endif
sdk tree dir
atree_dir := development/build
sdk/build/tools.atree contains the generic rules, while
sdk/build/tools.$(TARGET_ARCH).atree contains target-specific rules
the latter is optional.
sdk_tools_atree_files := sdk/build/tools.atree
ifneq (,$(strip $(wildcard sdk/build/tools.$(TARGET_ARCH).atree)))
sdk_tools_atree_files += sdk/build/tools.$(TARGET_ARCH).atree
endif
ifneq (,$(strip $(wildcard sdk/build/tools.$(HOST_OS).atree)))
sdk_tools_atree_files += sdk/build/tools.$(HOST_OS).atree
endif
ifneq (,$(strip $(wildcard sdk/build/tools.$(HOST_OS)-$(HOST_ARCH).atree)))
sdk_tools_atree_files += sdk/build/tools.$(HOST_OS)-$(HOST_ARCH).atree
endif
development/build/sdk-android-.atree is used to differentiate
between architecture models (e.g. ARMv5TE versus ARMv7) when copying
files like the kernel image. We use TARGET_CPU_ABI because we don't
have a better way to distinguish between CPU models.
sdk_atree_files := \
$(atree_dir)/sdk.exclude.atree \
$(atree_dir)/sdk.atree \
$(atree_dir)/sdk-$(HOST_OS)-$(HOST_ARCH).atree \
$(sdk_tools_atree_files)
ifneq (,$(strip $(wildcard $(atree_dir)/sdk-android-$(TARGET_CPU_ABI).atree)))
sdk_atree_files += $(atree_dir)/sdk-android-$(TARGET_CPU_ABI).atree
endif
INTERNAL_SDK_TARGET := $(sdk_dir)/$(sdk_name).zip
示例:
out/host/linux-x86/sdk/android-sdk_eng.cloud.windows.zip
用atree程序将依赖的文件拷贝至 out/host/linux-x86/sdk/android-sdk_eng.cloud.windows
然后打包成zip包
MAIN_SDK_NAME := $(sdk_name)
MAIN_SDK_DIR := $(sdk_dir)
MAIN_SDK_ZIP := $(INTERNAL_SDK_TARGET)
INTERNAL_FINDBUGS_XML_TARGET := $(PRODUCT_OUT)/findbugs.xml
示例:
out/target/product/i9100/findbugs.xml
INTERNAL_FINDBUGS_HTML_TARGET := $(PRODUCT_OUT)/findbugs.html
示例:
out/target/product/i9100/findbugs.html
使用工具prebuilt/common/findbugs/bin/unionBugs
处理$(ALL_FINDBUGS_FILES)得到findbugs.xml
使用工具prebuilt/common/findbugs/bin/convertXmlToText
将$(INTERNAL_FINDBUGS_XML_TARGET)处理
得到findbugs.html