Merge "Improve ART_BUILD_ disabling" into dalvik-dev
diff --git a/Android.mk b/Android.mk
index 0700b6c..1f67f35 100644
--- a/Android.mk
+++ b/Android.mk
@@ -18,11 +18,31 @@
 
 # These can be overridden via the environment or by editing to
 # enable/disable certain build configuration.
+#
+# For example, to disable everything but the host debug build you use:
+#
+# (export ART_BUILD_TARGET_NDEBUG=false && export ART_BUILD_TARGET_DEBUG=false && export ART_BUILD_HOST_NDEBUG=false && ...)
+#
+# Beware that tests may use the non-debug build for performance, notable 055-enum-performance
+#
 ART_BUILD_TARGET_NDEBUG ?= true
 ART_BUILD_TARGET_DEBUG ?= true
 ART_BUILD_HOST_NDEBUG ?= true
 ART_BUILD_HOST_DEBUG ?= true
 
+ifeq ($(ART_BUILD_TARGET_NDEBUG),false)
+$(info Disabling ART_BUILD_TARGET_NDEBUG)
+endif
+ifeq ($(ART_BUILD_TARGET_DEBUG),false)
+$(info Disabling ART_BUILD_TARGET_DEBUG)
+endif
+ifeq ($(ART_BUILD_HOST_NDEBUG),false)
+$(info Disabling ART_BUILD_HOST_NDEBUG)
+endif
+ifeq ($(ART_BUILD_HOST_DEBUG),false)
+$(info Disabling ART_BUILD_HOST_DEBUG)
+endif
+
 ART_HOST_SHLIB_EXTENSION := $(HOST_SHLIB_SUFFIX)
 ART_HOST_SHLIB_EXTENSION ?= .so
 
diff --git a/build/Android.oat.mk b/build/Android.oat.mk
index 7868204..b4e1266 100644
--- a/build/Android.oat.mk
+++ b/build/Android.oat.mk
@@ -63,11 +63,13 @@
 
 $(TARGET_CORE_OAT_OUT): $(TARGET_CORE_IMG_OUT)
 
+ifeq ($(ART_BUILD_HOST),true)
 include $(CLEAR_VARS)
 LOCAL_MODULE := core.art-host
 LOCAL_MODULE_TAGS := optional
 LOCAL_ADDITIONAL_DEPENDENCIES := $(HOST_CORE_IMG_OUT)
 include $(BUILD_PHONY_PACKAGE)
+endif
 
 ########################################################################
 # The full system boot classpath
@@ -86,8 +88,10 @@
 
 $(TARGET_BOOT_OAT_OUT): $(TARGET_BOOT_IMG_OUT)
 
+ifeq ($(ART_BUILD_TARGET),true)
 include $(CLEAR_VARS)
 LOCAL_MODULE := boot.art
 LOCAL_MODULE_TAGS := optional
 LOCAL_ADDITIONAL_DEPENDENCIES := $(TARGET_BOOT_IMG_OUT)
 include $(BUILD_PHONY_PACKAGE)
+endif