Merge "Make a full list of locales available, and use it for the sim build."
diff --git a/core/Makefile b/core/Makefile
index a048506..361d190 100644
--- a/core/Makefile
+++ b/core/Makefile
@@ -1238,6 +1238,15 @@
cd $(dir $@) && zip -rq $(notdir $@) $(PRIVATE_NAME) \
) || ( rm -rf $(PRIVATE_DIR) $@ && exit 44 )
+
+# Is a Windows SDK requested? If so, we need some definitions from here
+# in order to find the Linux SDK used to create the Windows one.
+ifneq ($(filter win_sdk,$(MAKECMDGOALS)),)
+LINUX_SDK_NAME := $(sdk_name)
+LINUX_SDK_DIR := $(sdk_dir)
+include $(TOPDIR)development/build/tools/windows_sdk.mk
+endif
+
endif # !simulator
# -----------------------------------------------------------------
diff --git a/core/config.mk b/core/config.mk
index 3eddc13..a4d3154 100644
--- a/core/config.mk
+++ b/core/config.mk
@@ -195,7 +195,6 @@
YACC:= bison -d
DOXYGEN:= doxygen
AAPT := $(HOST_OUT_EXECUTABLES)/aapt$(HOST_EXECUTABLE_SUFFIX)
-ACP := $(HOST_OUT_EXECUTABLES)/acp$(HOST_EXECUTABLE_SUFFIX)
AIDL := $(HOST_OUT_EXECUTABLES)/aidl$(HOST_EXECUTABLE_SUFFIX)
ICUDATA := $(HOST_OUT_EXECUTABLES)/icudata$(HOST_EXECUTABLE_SUFFIX)
SIGNAPK_JAR := $(HOST_OUT_JAVA_LIBRARIES)/signapk$(COMMON_JAVA_PACKAGE_SUFFIX)
@@ -214,6 +213,9 @@
PROGUARD := external/proguard/bin/proguard.sh
JAVATAGS := build/tools/java-event-log-tags.py
+# ACP is always for the build OS, not for the host OS
+ACP := $(BUILD_OUT_EXECUTABLES)/acp$(BUILD_EXECUTABLE_SUFFIX)
+
# dx is java behind a shell script; no .exe necessary.
DX := $(HOST_OUT_EXECUTABLES)/dx
KCM := $(HOST_OUT_EXECUTABLES)/kcm$(HOST_EXECUTABLE_SUFFIX)
diff --git a/core/envsetup.mk b/core/envsetup.mk
index 6d14753..f8a2027 100644
--- a/core/envsetup.mk
+++ b/core/envsetup.mk
@@ -68,9 +68,17 @@
ifneq (,$(findstring CYGWIN,$(UNAME)))
HOST_OS := windows
endif
+
+# BUILD_OS is the real host doing the build.
+BUILD_OS := $(HOST_OS)
+
+# Under Linux, if USE_MINGW is set, we change HOST_OS to Windows to build the
+# Windows SDK. Only a subset of tools and SDK will manage to build properly.
+ifeq ($(HOST_OS),linux)
ifneq ($(USE_MINGW),)
HOST_OS := windows
endif
+endif
ifeq ($(HOST_OS),)
$(error Unable to determine HOST_OS from uname -sm: $(UNAME)!)
@@ -86,6 +94,8 @@
HOST_ARCH := ppc
endif
+BUILD_ARCH := $(HOST_ARCH)
+
ifeq ($(HOST_ARCH),)
$(error Unable to determine HOST_ARCH from uname -sm: $(UNAME)!)
endif
@@ -168,6 +178,8 @@
HOST_OUT_debug := $(HOST_OUT_ROOT_debug)/$(HOST_OS)-$(HOST_ARCH)
HOST_OUT := $(HOST_OUT_$(HOST_BUILD_TYPE))
+BUILD_OUT := $(OUT_DIR)/host/$(BUILD_OS)-$(BUILD_ARCH)
+
ifeq ($(TARGET_SIMULATOR),true)
# Any arch- or os-specific parts of the simulator (everything
# under product/) are actually host-dependent.
@@ -185,6 +197,8 @@
OUT_DOCS := $(TARGET_COMMON_OUT_ROOT)/docs
+BUILD_OUT_EXECUTABLES:= $(BUILD_OUT)/bin
+
HOST_OUT_EXECUTABLES:= $(HOST_OUT)/bin
HOST_OUT_SHARED_LIBRARIES:= $(HOST_OUT)/lib
HOST_OUT_JAVA_LIBRARIES:= $(HOST_OUT)/framework
diff --git a/core/main.mk b/core/main.mk
index 014c050..3ffb084 100644
--- a/core/main.mk
+++ b/core/main.mk
@@ -179,6 +179,9 @@
ifneq ($(filter sdk,$(MAKECMDGOALS)),)
is_sdk_build := true
endif
+ifneq ($(filter win_sdk,$(MAKECMDGOALS)),)
+is_sdk_build := true
+endif
ifneq ($(filter sdk_addon,$(MAKECMDGOALS)),)
is_sdk_build := true
endif
@@ -254,6 +257,7 @@
ifneq ($(words $(filter-out $(INTERNAL_MODIFIER_TARGETS),$(MAKECMDGOALS))),1)
$(error The 'sdk' target may not be specified with any other targets)
endif
+
# TODO: this should be eng I think. Since the sdk is built from the eng
# variant.
tags_to_install := user debug eng
@@ -698,6 +702,7 @@
$(INSTALLED_BUILD_PROP_TARGET) \
$(BUILT_TARGET_FILES_PACKAGE) \
$(INSTALLED_ANDROID_INFO_TXT_TARGET) \
+ $(INSTALLED_RAMDISK_TARGET) \
)
# Tests are installed in userdata.img. If we're building the tests
@@ -722,6 +727,20 @@
$(SYMBOLS_ZIP) \
)
+.PHONY: samplecode
+sample_MODULES := $(sort $(call get-tagged-modules,samples))
+sample_APKS_DEST_PATH := $(TARGET_COMMON_OUT_ROOT)/samples
+sample_APKS_COLLECTION := \
+ $(foreach module,$(sample_MODULES),$(sample_APKS_DEST_PATH)/$(notdir $(module)))
+$(foreach module,$(sample_MODULES),$(eval $(call \
+ copy-one-file,$(module),$(sample_APKS_DEST_PATH)/$(notdir $(module)))))
+sample_ADDITIONAL_INSTALLED := \
+ $(filter-out $(modules_to_install) $(modules_to_check) $(ALL_PREBUILT),$(sample_MODULES))
+samplecode: $(sample_APKS_COLLECTION)
+ @echo "Collect sample code apks: $^"
+ # remove apks that are not intended to be installed.
+ rm -f $(sample_ADDITIONAL_INSTALLED)
+
.PHONY: findbugs
findbugs: $(INTERNAL_FINDBUGS_HTML_TARGET) $(INTERNAL_FINDBUGS_XML_TARGET)