1.在调试realv210开发板时在build_android.sh中发现执行编译的命令是make PRODUCT-full_smdkv210-eng。于是就分析了一下PRODUCT-full_smdkv210-eng目标
的执行步骤,最终发现在product_config.mk中存在一下代码
# Provide "PRODUCT-<prodname>-<goal>" targets, which lets you build
# a particular configuration without needing to set up the environment.
#
product_goals := $(strip $(filter PRODUCT-%,$(MAKECMDGOALS)))
ifdef product_goals
# Scrape the product and build names out of the goal,
# which should be of the form PRODUCT-<productname>-<buildname>.
#
ifneq ($(words $(product_goals)),1)
$(error Only one PRODUCT-* goal may be specified; saw "$(product_goals)")
endif
goal_name := $(product_goals)
product_goals := $(patsubst PRODUCT-%,%,$(product_goals))
product_goals := $(subst -, ,$(product_goals))
ifneq ($(words $(product_goals)),2)
$(error Bad PRODUCT-* goal "$(goal_name)")
endif
# The product they want
TARGET_PRODUCT := $(word 1,$(product_goals))
# The variant they want
TARGET_BUILD_VARIANT := $(word 2,$(product_goals))
# The build server wants to do make PRODUCT-dream-installclean
# which really means TARGET_PRODUCT=dream make installclean.
ifneq ($(filter-out $(INTERNAL_VALID_VARIANTS),$(TARGET_BUILD_VARIANT)),)
MAKECMDGOALS := $(MAKECMDGOALS) $(TARGET_BUILD_VARIANT)
TARGET_BUILD_VARIANT := eng
default_goal_substitution :=
else
default_goal_substitution := $(DEFAULT_GOAL)
endif
# For tests build, only build tests-build-target
ifeq (tests,$(TARGET_BUILD_VARIANT))
default_goal_substitution := tests-build-target
endif
# Hack to make the linux build servers use dexpreopt (emulator-based
# preoptimization). Most engineers don't use this type of target
# ("make PRODUCT-blah-user"), so this should only tend to happen when
# using buildbot.
# TODO: Remove this once host Dalvik preoptimization is working.
ifeq ($(TARGET_BUILD_VARIANT),user)
WITH_DEXPREOPT_buildbot := true
endif
# Replace the PRODUCT-* goal with the build goal that it refers to.
# Note that this will ensure that it appears in the same relative
# position, in case it matters.
#
# Note that modifying this will not affect the goals that make will
# attempt to build, but it's important because we inspect this value
# in certain situations (like for "make sdk").
#
MAKECMDGOALS := $(patsubst $(goal_name),$(default_goal_substitution),$(MAKECMDGOALS))
# Define a rule for the PRODUCT-* goal, and make it depend on the
# patched-up command-line goals as well as any other goals that we
# want to force.
#
.PHONY: $(goal_name)
$(goal_name): $(MAKECMDGOALS)
endif
以上代码分析会分析目标PRODUCT-full_smdkv210-eng并提取full_smdkv210赋值给TARGET_PRODUCT,提取eng赋值给TARGET_BUILD_VARIANT。最终执行规则
$(goal_name): $(MAKECMDGOALS)此规则展开后就是PRODUCT-full_smdkv210-eng:droid。
2.device/samsung/smdkv210/BoardConfig.mk中的TARGET_NO_KERNEL开关影响recovery.img的生成, TARGET_NO_KERNEL := false时生成recovery.img。
参考网址:http://blog.csdn.net/zjujoe/article/details/6230575