定义了公共的编译系统变量ALL_*,
还定义了很多命令用来编译各种各样的目标,
其它地方用来构建最终目标,build/core/main.mk,build/core/Makefile将用到这些变量
所有文档的全路径
ALL_DOCS的赋值在droiddoc.mk里:
ALL_DOCS += $(full_target)
full_target := $(call doc-timestamp-for,$(LOCAL_MODULE))
ALL_DOCS示例:out/target/common/docs/api-stubs-timestamp out/target/common/docs/hidden-timestamp
如果某个模块要编译出文档,需要使用命令
include $(BUILD_DROIDDOC)
而BUILD_DROID_DOC变量的值是droiddoc.mk
系统的所有模块的简单名字集合
编译系统还为每一个模块还定义了其它两个变量
ALL_MODULES.$(LOCAL_MODULE).BUILT 所有模块的生成路径
ALL_MODULES.$(LOCAL_MODULE).INSTALLED 所有模块的各自安装路径
例如:手机中将安装在system/bin/recovery,那么ALL_MODULES.recovery.INSTALLED为out/target/product/find5/system/bin/recovery
每个模块都会定义该模块生成的目标类型,可能生成二进制文件,也可能生成java静态库
这是由这个模块include $(BUILD_)决定的
比如build type若是EXCECUTABLE,,那么将include $(BUILD_EXECUTABLE),那么将include build/core/executable.mk
而该makefile对应生成的目标类型是在手机上的可执行程序
executable.mk里包含了binary.mk,而binary.mk包含了base_rules.mk
base_rules.mk里为变量ALL_MODULES,ALL_MODULES.$(target).BUILT,ALL_MODULES.$(target).INSTALLED赋值
代码:
ALL_MODULES += $(LOCAL_MODULE)
ALL_MODULES.$(LOCAL_MODULE).BUILT := \
$(ALL_MODULES.$(LOCAL_MODULE).BUILT) $(LOCAL_BUILT_MODULE)
LOCAL_BUILT_MODULE := $(built_module_path)/$(LOCAL_BUILT_MODULE_STEM)
ALL_MODULES.$(LOCAL_MODULE).INSTALLED := \
$(strip $(ALL_MODULES.$(LOCAL_MODULE).INSTALLED) $(LOCAL_INSTALLED_MODULE))
ifneq (true,$(LOCAL_UNINSTALLABLE_MODULE))
LOCAL_INSTALLED_MODULE := $(LOCAL_MODULE_PATH)/$(LOCAL_INSTALLED_MODULE_STEM)
endif
LOCAL_MODULE_PATH := $(strip $(LOCAL_MODULE_PATH))
ifeq ($(LOCAL_MODULE_PATH),)
LOCAL_MODULE_PATH := $($(my_prefix)OUT$(partition_tag)_$(LOCAL_MODULE_CLASS))
ifeq ($(strip $(LOCAL_MODULE_PATH)),)
$(error $(LOCAL_PATH): unhandled LOCAL_MODULE_CLASS "$(LOCAL_MODULE_CLASS)")
endif
endif
LOCAL_MODULE_PATH:表示要安装的位置,可由编译系统推算,也可由某个模块显示指定
示例:
ALL_MODULES:recvery applypatch applypatch_static imgdiff
对应的
$(built_module_path) : out/target/product/find5/obj/EXECUTABLES/recovery_intermediates
$(LOCAL_BUILT_MODULE_STEM) : recovery
$(LOCAL_MODULE_PATH): out/target/product/find5/system/bin
$(LOCAL_INSTALLED_MODULE_STEM): recovery
$(my_prefix)OUT$(partition_tag)_$(LOCAL_MODULE_CLASS):TARGET_OUT_EXECUTABLES
$(ALL_MODULES.recovery.BUILT) :out/target/product/find5/obj/EXECUTABLES/recovery_intermediates/recovery
$(ALL_MODULES.recovery.INSTALLED):out/target/product/find5/system/bin/recovery
所有默认要安装的模块,在build/core/main.mk和build/core/makfile里设置
Full paths to targets that should be added to the "make droid" set of installed targets.
droid目标将安装的所有模块的集合
使用LOCAL_MODULE_TAGS定义的所有tag集合
每一个tag对应一个ALL_MODULE_TAGS.变量
例:
在recovery的Android.mk里定义了;
LOCAL_MODULE := recovery
LOCAL_MODULE_TAGS := eng
LOCAL_MODULE := nandroid-md5.sh
LOCAL_MODULE_TAGS := optional
那么:ALL_MODULE_TAGS 将包含 eng,optional,
ALL_MODULE_TAGS.eng:out/target/product/find5/system/bin/recovery
ALL_MODULE_TAGS.optional: out/target/product/find5/recovery/root/sbin/nandroid-md5.sh
类似于ALL_MODULE_TAGS,但是它的值是 某个tag的所有模块的名称
例:
包含bootable/recovery/Android.mk后,
ALL_MODULE_NAME_TAGS.eng: recovery libbmlutils libdedupe utility_dedupe libcrecovery libmmcutils updater libapplypatch applypatch_static su.recovery
ALL_MODULE_NAME_TAGS.optional: nandroid-md5.sh killrecovery.sh dedupe libflashutils flash_image dump_image erase_image libflash_image libdump_image liberase_image
utility_dump_image utility_flash_image utility_erase_image libminui libminelf libminzip libminadbd libmtdutils edify libedify applypatch
imgdiff parted sdparted libminizip libmake_ext4fs install-su.sh run-su-daemon.sh
安装在pc上的程序集合
例:
包含bootable/recovery/Android.mk后,
ALL_HOST_INSTALLED_FILES:
/home/cloud/android/Cyanogenmod/out/host/linux-x86/bin/dedupe
/home/cloud/android/Cyanogenmod/out/host/linux-x86/bin/edify
/home/cloud/android/Cyanogenmod/out/host/linux-x86/bin/imgdiff
将会被拷贝的预编译文件的安装全路径的集合
Full paths to all prebuilt files that will be copied (used to make the dependency on acp)
在system/core/Android.mk里大量使用了ALL_PREBUILT
ALL_PREBUILT += $(file)
ALL_PREBUILT += $(DIRS)
示例:
ALL_PREBUILT: out/target/product/find5/system/etc/dbus.conf out/target/product/find5/system/etc/hosts out/target/product/find5/system/etc/init.goldfish.sh
某些工具生成的源代码文件的集合,比如aidl会生成java源代码文件
Full path to all files that are made by some tool
./build/core/binary.mk:273:ALL_GENERATED_SOURCES += $(LOCAL_GENERATED_SOURCES)
./bionic/libc/Android.mk:735:ALL_GENERATED_SOURCES += $(GEN)
例:
ALL_GENERATED_SOURCES: out/target/product/find5/obj/SHARED_LIBRARIES/libRS_intermediates/rsgApiStructs.h
out/target/product/find5/obj/SHARED_LIBRARIES/libRS_intermediates/rsgApiFuncDecl.h
out/target/product/find5/obj/SHARED_LIBRARIES/libbt-vendor_intermediates/vnd_buildcfg.h
所有asm,c,c++,以及lex和yacc生成的c代码文件的全路径
这些都对拷贝的头文件有一个按序的依赖关系
没有被优化,也没有被压缩的动态链接库
The list of dynamic binaries that haven't been stripped/compressed/etc
dynamic_binary.mk: ALL_ORIGINAL_DYNAMIC_BINARIES += $(linked_module)
例:
ALL_ORIGINAL_DYNAMIC_BINARIES:out/target/product/find5/obj/EXECUTABLES/vold_intermediates/LINKED/vold
out/target/product/find5/obj/SHARED_LIBRARIES/libkeystore_intermediates/LINKED/libkeystore.so
将会放在sdk的文件
These files go into the SDK
主要赋值:development/build/Android.mk
dalvik虚拟机需要的文件
Files for dalvik. This is often build without building the rest of the OS
在dalvik/dx/src/Android.mk dalvik/dx/Android.mk中有赋值
所有findbugs程序用的xml文件
build/core/java.mk:400:ALL_FINDBUGS_FILES += $(findbugs_xml)
All findbugs xml files
GPL module license files
GPL 模块的 许可文件
在build/core/base_rules.mk里有赋值
gpl_license_file := $(call find-parent-file,$(LOCAL_PATH),MODULE_LICENSE*_GPL* MODULE_LICENSE*_MPL*)
ifneq ($(gpl_license_file),)
LOCAL_MODULE_TAGS += gnu
ALL_GPL_MODULE_LICENSE_FILES := $(sort $(ALL_GPL_MODULE_LICENSE_FILES) $(gpl_license_file))
endif
Android 资源文件生成的java代码编译后的类的类型
ANDROID_RESOURCE_GENERATED_CLASSES := 'R.class' 'R
∗.class′′Manifest.class′′Manifest∗.class″Manifest.class″Manifest
*.class'
在build/core/static_java_library.mk中有用到,用于排除某些文件,使其不被打包至lib文件
Debugging; prints a variable list to stdout
用于打印变量的值
$(1): variable name list, not variable values
如果参数含有true,则返回true,否则返回空
$(1) 要测试的变量
返回当前makefile所在目录
获取某个目录下及子目录的所有Android.mk
$(1):需要提取Android.mk的目录
在某个目录下的所有子目录中查找Android.mk,不包括当前目录
$(1):要搜索的目录
查找当前目录及子目录下的所有Android.mk
在当前目录下的一组子目录下查找Android.mk
$(1): List of directories to look for under this directory
找出当前makefile所在目录的指定子目录里的所有java文件
$(1) 指定子目录
使用范例:SRC_FILES := $(call all-java-files-under,src tests)
从当前目录查找所有java文件
使用范例: SRC_FILES := $(call all-subdir-java-files)
在指定子目录下找C代码
Find all of the c files under the named directories.
Meant to be used like:
SRC_FILES := $(call all-c-files-under,src tests)
$1: 指定子目录名称
查找当前目录所有子目录的c代码文件
Find all of the c files from here. Meant to be used like:
SRC_FILES := $(call all-subdir-c-files)
在指定子目录下查找所有类似I*.aidl代码文件
Find all files named "I*.aidl" under the named directories,
which must be relative to $(LOCAL_PATH). The returned list
is relative to $(LOCAL_PATH).
$1: 指定子目录名称
在$(LOCAL_PATH)下查找所有I*.aidl代码文件
Find all of the "I*.aidl" files under $(LOCAL_PATH).
在指定子目录下查找所有logtags文件
Find all of the logtags files under the named directories.
Meant to be used like:
SRC_FILES := $(call all-logtags-files-under,src)
查找.logtag文件
$1:指定子目录名称
在指定子目录下查找所有.proto文件
Find all of the .proto files under the named directories.
Meant to be used like:
SRC_FILES := $(call all-proto-files-under,src)
查找.proto文件
$1:指定子目录名称
在指定子目录下查找所有.rs或者.fs文件
Find all of the RenderScript files under the named directories.
Meant to be used like:
SRC_FILES := $(call all-renderscript-files-under,src)
查找.rs .fs文件
$1:指定子目录名称
在指定子目录下查找所有html文件
Find all of the html files under the named directories.
Meant to be used like:
SRC_FILES := $(call all-html-files-under,src tests)
查找.html文件
$1:指定子目录名称
在当前目录的子目录里查找所有html文件
Find all of the html files from here. Meant to be used like:
SRC_FILES := $(call all-subdir-html-files)
根据find命令的规则查找所有文件
Find all of the files matching pattern
SRC_FILES := $(call find-subdir-files, )
$1 find命令的匹配规则
在指定子目录下根据find命令的规则查找文件
find the files in the subdirectory $1 of LOCAL_DIR
matching pattern $2, filtering out files $3
e.g.
SRC_FILES += $(call find-subdir-subdir-files, \
css, *.cpp, DontWantThis.cpp)
$1 LOCAL_DIR的子目录
$2 find命令的匹配规则
$3 过滤的文件
查找所有不是软链且文件名不带后缀的文件
SRC_FILES := $(call find-subdir-assets)
$1 要进入并查找的目录
在$(LOCAL_PATH)里根据find命令的匹配规则查找java文件
$1 find命令的匹配规则
在$(LOCAL_PATH)里根据find命令的匹配规则查找html文件
$1 find命令的匹配规则
在$1给出的目录及这个目录的父目录里查找$2,若找到返回该路径
Scan through each directory of $(1) looking for files
that match $(2) using $(wildcard). Useful for seeing if
a given directory or one of its parents contains
a particular file. Returns the first match found,
starting furthest from the root.
$1 要查找的目录集合
$2 要查找的文件
添加依赖关系
Function we can evaluate to introduce a dynamic dependency
$1 需要依赖其它东东的目标
$2 被依赖的东东
Set up the dependencies for a prebuilt target
$(call add-prebuilt-file, srcfile, [targetclass])
$(1): srcfile
$(2): target class
domultipleprebuilts
$(calltargetclass,files...)
$(1)targetclass
$(2)srcfiles
使用举例:
gdbserver/Android.mk:$(calladd-prebuilt-files,EXECUTABLES,$(prebuilt_files))
查找中间目录并返回
The intermediates directory. Where object files go for
a given target. We could technically get away without
the "_intermediates" suffix on the directory, but it's
nice to be able to grep for that string to find out if
anyone's abusing the system.
# $(1): target class, like "APPS"
# $(2): target name, like "NotePad"
# $(3): if non-empty, this is a HOST target.
# $(4): if non-empty, force the intermediates to be COMMON 如果是host的common,则是out/host/common,如果是target的common,则是out/target/common
使用举例:
./development/build/Android.mk framework_res_package := $(call intermediates-dir-for,APPS,framework-res,,COMMON)/package-export.apk
./frameworks/base/core/res/Android.mk:37:framework_GENERATED_SOURCE_DIR := $(call intermediates-dir-for,JAVA_LIBRARIES,framework,,COMMON)/src
值: out/target/product/find5/obj/STATIC_LIBRARIES/libstdc++_intermediates
out/target/common/obj/JAVA_LIBRARIES/core_intermediates
out/target/common/obj/APPS/framework-res_intermediates
out/target/common/obj/JAVA_LIBRARIES/framework_intermediates
利用LOCAL_MODULE_CLASS, LOCAL_MODULE, and LOCAL_IS_HOST_MODULE决定中间目录
$(1): if non-empty, force the intermediates to be COMMON
例: LOCAL_MODULE_CLASS:EXECUTABLES
LOCAL_MODULE: recovery
LOCAL_IS_HOST_MODULE empty
$1 为空
那么返回out/target/product/find5/obj/EXECUTABLES/recovery_intermediates
将"path/to/libXXX.so"转为 -lXXX
Convert "path/to/libXXX.so" to "-lXXX".
Any "path/to/libXXX.a" elements pass through unchanged.
参见normalize-libraries,和之类似
参见normalize-libraries,和之类似
将模块名字转为它们对应的编译生成路径
Convert a list of short module names (e.g., "framework", "Browser")
into the list of files that are built for those modules.
NOTE: this won't return reliable results until after all
sub-makefiles have been included.
$(1): target list
将模块名字转为它们对应的安装路径
Convert a list of short modules names (e.g., "framework", "Browser")
into the list of files that are installed for those modules.
NOTE: this won't return reliable results until after all
sub-makefiles have been included.
$(1): target list
将模块名字转为它们要作为公共API时链接的文件路径
Convert a list of short modules names (e.g., "framework", "Browser")
into the list of files that should be used when linking
against that module as a public API.
TODO: Allow this for more than JAVA_LIBRARIES modules
NOTE: this won't return reliable results until after all
sub-makefiles have been included.
$(1): target list
define module-stubs-files
$(foreach module,$(1),$(ALL_MODULES.$(module).STUBS))
endef
为文档模块转为timestamp为文件,这个文件是添加依赖时会用到的
Evaluates to the timestamp file for a doc module, which
is the dependency that should be used.
$(1): doc module
Convert "core ext framework" to "out/.../javalib.jar ..."
out/target/common/JAVA_LIBRARIES/libname_indeterminates/classes.jar
out/host/common/JAVA_LIBRARIES/libname_indeterminates/classes.jar
$(1): library name list
$(2): Non-empty if IS_HOST_MODULE
多个javalib.jar
$(1): library name list
$(2): Non-empty if IS_HOST_MODULE
Run rot13 on a string rot13 是一种简易的置换暗码
$(1): the string. Must be one line.
Returns true if $(1) and $(2) are equal. Returns
the empty string if they are not equal.
Convert "a b c" into "a:b:c"
Read the word out of a colon-separated list of words.
This has the same behavior as the built-in function
$(word n,str).
The individual words may not contain spaces.
将用":"分隔的字符串转化为词数组
$(1): 1 based index
$(2): value of the form a:b:c...
Convert "a=b c= d e = f" into "a=b c=d e=f" ,注意空格
$(1): list to collapse
$(2): if set, separator word; usually "=", ":", or ":="
Defaults to "=" if not set.
Given a list of pairs, if multiple pairs have the same
first components, keep only the first pair.
$(1): list of pairs
$(2): the separator word, such as ":", "=", etc.
Given a list of pairs, if multiple pairs have the same
first components, keep only the first pair.
$(1): list of pairs
$(2): the separator word, such as ":", "=", etc.
ALL_MODULE_TAGS.eng:out/target/product/find5/system/bin/recovery
Given a list of tags, return the targets that specify
any of those tags.
$(1): tag list
ALL_MODULE_NAME_TAGS.eng: recovery libbmlutils libdedupe utility_dedupe libcrecovery libmmcutils updater libapplypatch applypatch_static su.recovery
Given an accept and reject list, find the matching set of targets. If a target has multiple tags and
any of them are rejected, the target is rejected.
Reject overrides accept.
$(1): list of tags to accept
$(2): list of tags to reject
Append a leaf to a base path. Properly deals with
base paths ending in /.
$(1): base path
$(2): leaf path
Packagefiltering
#Givenalistofinstalledmodules(shortorlongnames)
#returnalistofthepackages(yes,.apkpackages,not
#modulesingeneral)thatareoverriddenbythislistand,
#therefore,shouldnotbeinstalled.
#$(1):mixedlistofinstalledmodules
#TODO:Thisisfragile;findareliablewaytogetthisinformation.
Output the command lines, or not
如果编译时传递了添加了showcommands参数,调用pretty会打印正在执行的命令
如果没有传递showcommand参数,则不会打印正在执行的命令
Dump the variables that are associated with targets
打印编译时的一些参数
主要是一些PRIVATE变量,例如PRIVATE_YACCFLAGS
Commands for using sed to replace given variable values
CommandsformungingthedependencyfilesGCCgenerates
$(1):theinput.dfile
$(2):theoutput.Pfile
参见 transform-d-to-p-args
Commands for running lex
举例:
ifneq ($(strip $(lex_cpps)),)
$(lex_cpps): $(intermediates)/%$(LOCAL_CPP_EXTENSION): \
$(TOPDIR)$(LOCAL_PATH)/%.l
$(transform-l-to-cpp)
Commands for running yacc
Because the extension of c++ files can change, the
extension must be specified in $1.
E.g, "$(call transform-y-to-cpp,.cpp)"
Commands to compile RenderScript
Commands for running aidl
Commands for running java-event-log-tags.py
Commands for running protoc to compile .proto into .java
Commands for running protoc to compile .proto into .pb.cc and .pb.h
Commands for running gcc to compile a C++ file
Commands for running gcc to compile a C file
# $(1): extra flags
编译c文件至目标文件,无依赖的编译
# $(1): extra flags
编译汇编文件至目标文件,无依赖的编译
$(1): extra flags
编译c文件至目标文件
# $(1): extra flags 编译参数
编译汇编文件至目标文件
$(1): extra flags,编译参数
Commands for running gcc to compile an Objective-C file
This should never happen for target builds but this
will error at build time.
编译objet c文件至目标文件
$(1): extra flags,编译参数
Commands for running gcc to compile a host C++ file
编译cpp文件,目标代码将在主机上运行
$(1): extra flags
Commands for running gcc to compile a host C file
编译c代码或者汇编代码,目标代码将在主机上运行,无依赖的编译
$(1): extra flags
Commands for running gcc to compile a host C file
编译c代码,目标代码将在主机上运行,无依赖的编译
$(1): extra flags
编译汇编代码,目标代码将在主机上运行,无依赖的编译
$(1): extra flags
编译c代码,目标代码将在主机上运行
$(1): extra flags
编译汇编代码,目标代码将在主机上运行
$(1): extra flags
Commands for running gcc to compile a host Objective-C file
编译object c代码,目标代码将在主机上运行,无依赖编译
$(1): extra flags
Commands for running gcc to compile a host Objective-C file
编译object c代码,目标代码将在主机上运行,
$(1): extra flags
Commands for running ar
Split long argument list into smaller groups and call the command repeatedly
Call the command at least once even if there are no arguments, as otherwise
the output file won't be created.
$(1): the command without arguments
$(2): the arguments
$(1): the full path of the source static library.
Explicitly delete the archive first so that ar doesn't
try to add to an existing archive.
将目标代码打包成静态库
Commands for running host ar
$(1): the full path of the source static library.
静态库将在主机上运行
将目标代码打包成在主机上运行的静态库
静态库将在主机上运行
Commands for running gcc to link a shared library or package
ld just seems to be so finicky with command order that we allow
it to be overriden en-masse see combo/linux-arm.make for an example.
将目标代码打包成在主机上运行的动态库或者包
参见transform-host-o-to-shared-lib-inner
参见transform-host-o-to-shared-lib-inner
Commands for running gcc to link a shared library or package
ld just seems to be so finicky with command order that we allow
it to be overriden en-masse see combo/linux-arm.make for an example.
将目标代码打包成在目标机上运行的动态库
参见transform-o-to-shared-lib-inner
参见transform-o-to-shared-lib-inner
Commands for filtering a target executable or library
Commandsforrunninggcctolinkanexecutable
编译成可执行文件
参见transform-o-to-executable-inner
Commandsforrunninggcctolinkastaticallylinked
executable.Inpractice,weonlyusethisonarm,so
theotherplatformsdon'thavethe
transform-o-to-static-executabledefined
参见transform-o-to-static-executable-inner
Commands for running gcc to link a host executable
参见transform-host-o-to-executable-inner
Commandsforrunningjavactomake.classfiles
@echo"Sourceintermediatesdir:$(PRIVATE_SOURCE_INTERMEDIATES_DIR)"
@echo"Sourceintermediates:$$(find$(PRIVATE_SOURCE_INTERMEDIATES_DIR)-name'*.java')"
ThisrulecreatestheR.javaandManifest.javafiles,bothofwhich
arePRODUCT-neutral.Don'tpassPRIVATE_PRODUCT_AAPT_CONFIGtothisinvocation.
emit-line
dump-words-to-file
For a list of jar files, unzip them to a specified directory,
but make sure that no META-INF files come along for the ride.
$(1): files to unzip
$(2): destination directory
Common definition to invoke javac on the host and target.
Some historical notes:
- below we write the list of java files to java-source-list to avoid argument
list length problems with Cygwin
- we filter out duplicate java file names because eclipse's compiler
doesn't like them.
$(1): javac
$(2): bootclasspath
将java编译并打包成classes.jar
emma代码覆盖率测试
将classes.jar转化为dex
Create a mostly-empty .jar file that we'll add to later.
The MacOS jar tool doesn't like creating empty jar files,
so we need to give it something.
TODO: we kinda want to build different asset packages for
different configurations, then combine them later (or something).
Per-locale, etc.
A list of dynamic and static parameters;build layers for
dynamic params that lay over the static ones.
TODO: update the manifest to point to the package file
Note that the version numbers are given to aapt as simple default
values; applications can override these by explicitly stating
them in their manifest.
将资源文件打包到package
将jni 动态库打包到package
将dex打包到package
Add java resources added by the current module.
Add java resources carried by static Java libraries.
Sign a package using the specified key/cert.
Align STORED entries of a package on 4-byte boundaries
to make them easier to mmap.
安装debug版本的dex文件
TODO(joeo):Ifwecaneverupgradetopost3.81makeandgetthe
newprebuiltrulestowork,weshouldchangethistocopythe
resourcestotheoutdirectoryandthencopytheresources.
Note:weintentionallydon'tcleanPRIVATE_CLASS_INTERMEDIATES_DIR
intransform-java-to-classesforthesakeofvm-tests.
Obfuscate a jar file
PRIVATE_KEEP_FILE is a file containing a list of classes
PRIVATE_INTERMEDIATES_DIR is a directory we can use for temporary files
The module using this must depend on
$(HOST_OUT_JAVA_LIBRARIES)/proguard-4.0.1.jar
混淆代码
Commands for copying files
Define a rule to copy a header. Used via $(eval) by copy_headers.make.
$(1): source header
$(2): destination header
Define a rule to copy a file. For use via $(eval).
$(1): source file
$(2): destination file
Copies many files.
$(1): The files to copy. Each entry is a ':' separated src:dst pair
Evaluates to the list of the dst files (ie suitable for a dependency list)
Copy the file only if it's a well-formed xml file. For use via $(eval).
$(1): source file
$(2): destination file, must end with .xml.
The -t option to acp and the -p option to cp is
required for OSX. OSX has a ridiculous restriction
where it's an error for a .a file's modification time
to disagree with an internal timestamp, and this
macro is used to install .a files (among other things).
Copy a single file from one place to another,
preserving permissions and overwriting any existing
file.
We disable the "-t" option for acp cannot handle
high resolution timestamp correctly on file systems like ext4.
Therefore copy-file-to-target is the same as copy-file-to-new-target.
The same as copy-file-to-target, but use the local
cp command instead of acp.
The same as copy-file-to-target, but use the zipalign tool to do so.
The same as copy-file-to-target, but strip out "# comment"-style
comments (for config files and such).
The same as copy-file-to-target, but don't preserve
the old modification time.
The same as copy-file-to-new-target, but use the local
cp command instead of acp.
Copy a prebuilt file to a target location.
Copyaprebuiltfiletoatargetlocation,usingzipalignonit.
Copy a prebuilt file to a target location, stripping "# comment" comments.
Onsomeplatforms(MacOS),aftercopyingastatic
library,ranlibmustberuntoupdateaninternal
timestamp!?!?!
Commands to call Proguard
Command to copy the file with acp, if proguard is disabled.
Command to copy the file with acp, if proguard is disabled.
Figure out the proguard dictionary file of the module that is instrumentationed for.
将jar混淆
Stuffsourcegeneratedfromone-offtools
将data分区大小(在/proc/mtd里存储)转为能够刷入该分区的img文件大小
Convert a partition data size (eg, as reported in /proc/mtd) to the
size of the image used to flash that partition (which includes a
spare area for each page).
$(1): the partition data size
确保文件大小不超过某个数值
$(1): The file(s) to check (often $@)
$(2): The maximum total image size, in decimal bytes
$(3): the type of filesystem "yaffs" or "raw"
If $(2) is empty, evaluates to "true"
Reserve bad blocks. Make sure that MAX(1% of partition size, 2 blocks)
is left over after the image has been flashed. Round the 1% up to the
next whole flash block size.
确保image大小不超过某个数值
Like assert-max-file-size, but the second argument is a partition
size, which we'll convert to a max image size before checking it
against the files.
$(1): The file(s) to check (often $@)
$(2): The partition size.
添加radio包
Define device-specific radio files
Copy a radio image file to the output location, and add it to
INSTALLED_RADIOIMAGE_TARGET.
$(1): filename
Version of add-radio-file that also arranges for the version of the
file to be checked against the contents of
$(TARGET_BOARD_INFO_FILE).
$(1): filename
$(2): name of version variable in board-info (eg, "version-baseband")
Override the package defined in $(1), setting the
variables listed below differently.
$(1): The makefile to override (relative to the source
tree root)
$(2): Old LOCAL_PACKAGE_NAME value.
$(3): New LOCAL_PACKAGE_NAME value.
$(4): New LOCAL_MANIFEST_PACKAGE_NAME value.
$(5): New LOCAL_CERTIFICATE value.
$(6): New LOCAL_INSTRUMENTATION_FOR value.
$(7): New LOCAL_MANIFEST_INSTRUMENTATION_FOR value.
Note that LOCAL_PACKAGE_OVERRIDES is NOT cleared in
clear_vars.mk.
To be used with inherit-package above
Evalutes to true if the package was overridden
参见inherit-package
Expand a module name list with REQUIRED modules
$(1): The variable name that holds the initial module name list.
the variable will be modified to hold the expanded results.
$(2): The initial module name list.
Returns empty string (maybe with some whitespaces).
API Check
eval this to define a rule that runs apicheck.
Args:
$(1) target
$(2) stable api file
$(3) api file to be tested
$(4) arguments for apicheck
$(5) command to run if apicheck failed
$(6) target dependent on this api check
$(7) additional dependencies