Merge "Move emulator.mk out of full_base.mk" into jb-mr2-dev
diff --git a/core/Makefile b/core/Makefile
index 5928a7e..2f86fd7 100644
--- a/core/Makefile
+++ b/core/Makefile
@@ -760,12 +760,8 @@
.PHONY: installed-file-list
installed-file-list: $(INSTALLED_FILES_FILE)
-ifneq ($(filter sdk win_sdk,$(MAKECMDGOALS)),)
-$(call dist-for-goals, sdk win_sdk, $(INSTALLED_FILES_FILE))
-endif
-ifneq ($(filter sdk_addon,$(MAKECMDGOALS)),)
-$(call dist-for-goals, sdk_addon, $(INSTALLED_FILES_FILE))
-endif
+
+$(call dist-for-goals, sdk win_sdk sdk_addon, $(INSTALLED_FILES_FILE))
systemimage_intermediates := \
$(call intermediates-dir-for,PACKAGING,systemimage)
diff --git a/core/distdir.mk b/core/distdir.mk
index e04938b..51ec46e 100644
--- a/core/distdir.mk
+++ b/core/distdir.mk
@@ -41,6 +41,11 @@
$$(copy-file-to-new-target-with-cp)
endef
+# A global variable to remember all dist'ed src:dst pairs.
+# So if a src:dst is already dist'ed by another goal,
+# we should just establish the dependency and don't really call the
+# copy-one-dist-file to avoid multiple rules for the same target.
+_all_dist_src_dst_pairs :=
# Other parts of the system should use this function to associate
# certain files with certain goals. When those goals are built
# and "dist" is specified, the marked files will be copied to DIST_DIR.
@@ -56,14 +61,13 @@
$(eval src := $(word 1,$(fw))) \
$(eval dst := $(word 2,$(fw))) \
$(eval dst := $(if $(dst),$(dst),$(notdir $(src)))) \
- $(eval \
- $(call copy-one-dist-file, \
- $(src), \
- $(DIST_DIR)/$(dst), \
- $(1) \
- ) \
- ) \
- )
+ $(if $(filter $(_all_dist_src_dst_pairs),$(src):$(dst)),\
+ $(eval $(call add-dependency,$(1),$(DIST_DIR)/$(dst))),\
+ $(eval $(call copy-one-dist-file,\
+ $(src),$(DIST_DIR)/$(dst),$(1)))\
+ $(eval _all_dist_src_dst_pairs += $(src):$(dst))\
+ )\
+)
endef
else # !dist_goal
diff --git a/core/main.mk b/core/main.mk
index 75a75cc..7f3d706 100644
--- a/core/main.mk
+++ b/core/main.mk
@@ -779,9 +779,6 @@
# dist_files only for putting your library into the dist directory with a full build.
.PHONY: dist_files
-# Dist for droid if droid is among the cmd goals, or no cmd goal is given.
-ifneq ($(filter droid,$(MAKECMDGOALS))$(filter ||,|$(filter-out $(INTERNAL_MODIFIER_TARGETS),$(MAKECMDGOALS))|),)
-
ifneq ($(TARGET_BUILD_APPS),)
# If this build is just for apps, only build apps and not the full system by default.
@@ -840,9 +837,6 @@
droid: droidcore dist_files
endif # TARGET_BUILD_APPS
-endif # droid in $(MAKECMDGOALS)
-
-.PHONY: droid
.PHONY: docs
docs: $(ALL_DOCS)
@@ -850,13 +844,11 @@
.PHONY: sdk
ALL_SDK_TARGETS := $(INTERNAL_SDK_TARGET)
sdk: $(ALL_SDK_TARGETS)
-ifneq ($(filter sdk win_sdk,$(MAKECMDGOALS)),)
$(call dist-for-goals,sdk win_sdk, \
$(ALL_SDK_TARGETS) \
$(SYMBOLS_ZIP) \
$(INSTALLED_BUILD_PROP_TARGET) \
)
-endif
# umbrella targets to assit engineers in verifying builds
.PHONY: java native target host java-host java-target native-host native-target \
diff --git a/target/product/emulator.mk b/target/product/emulator.mk
index 582ca64..146a00a 100644
--- a/target/product/emulator.mk
+++ b/target/product/emulator.mk
@@ -34,3 +34,6 @@
lib64GLES_CM_translator \
lib64GLES_V2_translator \
lib64EGL_translator
+
+PRODUCT_COPY_FILES += \
+ device/generic/goldfish/fstab.goldfish:root/fstab.goldfish
diff --git a/target/product/languages_full.mk b/target/product/languages_full.mk
index 35ab1f1..0fc13c7 100644
--- a/target/product/languages_full.mk
+++ b/target/product/languages_full.mk
@@ -19,6 +19,6 @@
# mostly because screen densities interfere with the list of locales and
# the system misbehaves when a density is the first locale.
-# Those are all the locales that have translations and are displayable
+# These are all the locales that have translations and are displayable
# by TextView in this branch.
-PRODUCT_LOCALES := en_US fr_FR it_IT es_ES de_DE nl_NL cs_CZ pl_PL ja_JP zh_TW zh_CN ru_RU ko_KR nb_NO es_US da_DK el_GR tr_TR pt_PT pt_BR rm_CH sv_SE bg_BG ca_ES en_GB fi_FI hi_IN hr_HR hu_HU in_ID iw_IL lt_LT lv_LV ro_RO sk_SK sl_SI sr_RS uk_UA vi_VN tl_PH ar_EG fa_IR th_TH sw_TZ ms_MY af_ZA zu_ZA am_ET hi_IN
+PRODUCT_LOCALES := en_US fr_FR it_IT es_ES de_DE nl_NL cs_CZ pl_PL ja_JP zh_TW zh_CN ru_RU ko_KR nb_NO es_US da_DK el_GR tr_TR pt_PT pt_BR rm_CH sv_SE bg_BG ca_ES en_GB fi_FI hi_IN hr_HR hu_HU in_ID iw_IL lt_LT lv_LV ro_RO sk_SK sl_SI sr_RS uk_UA vi_VN tl_PH ar_EG fa_IR th_TH sw_TZ ms_MY af_ZA zu_ZA am_ET hi_IN en_XA ar_XB
diff --git a/target/product/sdk.mk b/target/product/sdk.mk
index 3226423..1918c33 100644
--- a/target/product/sdk.mk
+++ b/target/product/sdk.mk
@@ -68,8 +68,6 @@
rild \
LegacyCamera
-include $(SRC_TARGET_DIR)/product/emulator.mk
-
# Define the host tools and libs that are parts of the SDK.
-include sdk/build/product_sdk.mk
-include development/build/product_sdk.mk
@@ -83,7 +81,6 @@
PRODUCT_PACKAGE_OVERLAYS := development/sdk_overlay
PRODUCT_COPY_FILES := \
- device/generic/goldfish/fstab.goldfish:root/fstab.goldfish \
device/generic/goldfish/data/etc/apns-conf.xml:system/etc/apns-conf.xml \
system/core/rootdir/etc/vold.fstab:system/etc/vold.fstab \
frameworks/base/data/sounds/effects/camera_click.ogg:system/media/audio/ui/camera_click.ogg \
@@ -96,6 +93,8 @@
frameworks/av/media/libeffects/data/audio_effects.conf:system/etc/audio_effects.conf \
hardware/libhardware_legacy/audio/audio_policy.conf:system/etc/audio_policy.conf
+include $(SRC_TARGET_DIR)/product/emulator.mk
+
$(call inherit-product-if-exists, frameworks/base/data/fonts/fonts.mk)
$(call inherit-product-if-exists, frameworks/base/data/keyboards/keyboards.mk)
$(call inherit-product, $(SRC_TARGET_DIR)/product/core.mk)