Don't build dx if it's an app-only build.

Change-Id: I609f21e78b7bbac9af25ac1bc6bd5d3941ea462a
diff --git a/dx/Android.mk b/dx/Android.mk
index 7ae0039..deb84c9 100644
--- a/dx/Android.mk
+++ b/dx/Android.mk
@@ -6,6 +6,9 @@
 # script files' timestamps are at least as new as the
 # .jar files they wrap.
 
+# This tool is prebuilt if we're doing an app-only build.
+ifeq ($(TARGET_BUILD_APPS),)
+
 # the dx script
 # ============================================================
 include $(CLEAR_VARS)
@@ -23,6 +26,8 @@
 
 INTERNAL_DALVIK_MODULES += $(LOCAL_INSTALLED_MODULE)
 
+endif # TARGET_BUILD_APPS
+
 # the jasmin script
 # ============================================================
 include $(CLEAR_VARS)
diff --git a/dx/src/Android.mk b/dx/src/Android.mk
index ef3d32d..7ab32b2 100644
--- a/dx/src/Android.mk
+++ b/dx/src/Android.mk
@@ -2,6 +2,8 @@
 #
 LOCAL_PATH := $(call my-dir)
 
+# This tool is prebuilt if we're doing an app-only build.
+ifeq ($(TARGET_BUILD_APPS),)
 
 # dx java library
 # ============================================================
@@ -16,6 +18,8 @@
 
 INTERNAL_DALVIK_MODULES += $(LOCAL_INSTALLED_MODULE)
 
+endif # TARGET_BUILD_APPS
+
 # the documentation
 # ============================================================
 include $(CLEAR_VARS)
@@ -28,4 +32,3 @@
 LOCAL_IS_HOST_MODULE := true
 
 include $(BUILD_DROIDDOC)
-