Remove auto-generated executable list

Keep a list of the useful executables, and use the -host and -target
phony targets to depend on them for build-art-host and build-art-target.

Relanding I8ff4da32a03c219924be7990963e0c3ba90ef316 with fixes to build
the debug versions of executables, which are needed by the tests.

Change-Id: Id941cf5d1a638763cf4cf2bc0412b0782ae21694
diff --git a/build/Android.common_path.mk b/build/Android.common_path.mk
index 86bb475..3f25ae1 100644
--- a/build/Android.common_path.mk
+++ b/build/Android.common_path.mk
@@ -18,6 +18,7 @@
 ART_ANDROID_COMMON_PATH_MK := true
 
 include art/build/Android.common.mk
+include art/build/Android.common_build.mk
 
 # Directory used for dalvik-cache on device.
 ART_TARGET_DALVIK_CACHE_DIR := /data/dalvik-cache
@@ -113,4 +114,29 @@
 ART_TARGET_SHARED_LIBRARY_DEPENDENCIES += $(foreach lib,$(ART_CORE_SHARED_LIBRARIES), $(2ND_TARGET_OUT_SHARED_LIBRARIES)/$(lib).so)
 endif
 
+ART_CORE_EXECUTABLES := \
+    dex2oat \
+    imgdiag \
+    oatdump \
+    patchoat \
+    profman \
+
+# Depend on the -target or -host phony targets generated by the build system
+# for each module
+ART_TARGET_EXECUTABLES :=
+ifneq ($(ART_BUILD_TARGET_NDEBUG),false)
+ART_TARGET_EXECUTABLES += $(foreach name,$(ART_CORE_EXECUTABLES),$(name)-target)
+endif
+ifneq ($(ART_BUILD_TARGET_DEBUG),false)
+ART_TARGET_EXECUTABLES += $(foreach name,$(ART_CORE_EXECUTABLES),$(name)d-target)
+endif
+
+ART_HOST_EXECUTABLES :=
+ifneq ($(ART_BUILD_HOST_NDEBUG),false)
+ART_HOST_EXECUTABLES += $(foreach name,$(ART_CORE_EXECUTABLES),$(name)-host)
+endif
+ifneq ($(ART_BUILD_HOST_DEBUG),false)
+ART_HOST_EXECUTABLES += $(foreach name,$(ART_CORE_EXECUTABLES),$(name)d-host)
+endif
+
 endif # ART_ANDROID_COMMON_PATH_MK