从我的理解来看,
. build/eventsetup.h 初始化了编译需要的函数。 如:
Invoke ". build/envsetup.sh" from your shell to add the following functions to your environment:
- lunch: lunch <product_name>-<build_variant>
- tapas: tapas [<App1> <App2> ...] [arm|x86|mips] [eng|userdebug|user]
- croot: Changes directory to the top of the tree.
- m: Makes from the top of the tree.
- mm: Builds all of the modules in the current directory.
- mmm: Builds all of the modules in the supplied directories.
- cgrep: Greps on all local C/C++ files.
- jgrep: Greps on all local Java files.
- resgrep: Greps on all local res/*.xml files.
- godir: Go to the directory containing a file.
lunch X-eng
X 是TARGET_PRODUCT
eng是TARGET_BUILD_VARIANT
/build/envsetup.sh中使用
# Execute the contents of any vendorsetup.sh files we can find.
for f in `test -d device && find device -maxdepth 6 -name 'vendorsetup.sh' 2> /dev/null` \
`test -d vendor && find vendor -maxdepth 6 -name 'vendorsetup.sh' 2> /dev/null`
do
echo "including $f"
. $f
done
unset f
将vendor/和device下的envsetup.sh引入。
我们在Vendor/*/vendorsetup.sh中
add_lunch_combo X-eng
add_lunch_combo X-userdebug
将以上build 名称添加到envsetup.sh中。
在make X的时候,
X_base.mk中会引入build下的mk文件执行。
# Superclass
$(call inherit-product, build/target/product/full_base_tablet.mk)
# To get support Location Service
$(call inherit-product, build/target/product/generic_no_telephony.mk)
# product locales configuration
$(call inherit-product, build/target/product/locales_full.mk)
# Include Dalvik Heap Size Configuration
$(call inherit-product, vendor/intel/common/dalvik/tablet-mdpi-1024-dalvik-heap.mk)