Remove $(DEX2OAT) from DEX2OAT_DEPENDENCY when USE_DEX2OAT_DEBUG is set.
Currently, DEX2OATD_DEPENDENCY is created by appending $(DEX2OATD) to
the value of DEX2OAT_DEPENDENCY and then if USE_DEX2OAT_DEBUG is set,
DEX2OAT_DEPENDENCY is set to DEX2OATD_DEPENDENCY, adding a dependency
on $(DEX2OAT) even in configurations where this will not be built.
This change removes DEX2OATD and DEX2OATD_DEPENDENCY entirely to instead
assign dex2oat or dex2oatd to DEX2OAT depending on USE_DEX2OAT_DEBUG,
making it possible to build with these flags set:
USE_DEX2OAT_DEBUG=true
ART_BUILD_HOST_NDEBUG=false
ART_BUILD_HOST_DEBUG=true
ART_BUILD_TARGET_NDEBUG=false
ART_BUILD_TARGET_DEBUG=true
make build-art-host
Change-Id: I4fa75d1b7e9751c73c43ec943fd8446cc231a070
diff --git a/core/dex_preopt_libart.mk b/core/dex_preopt_libart.mk
index 1de72b7..1bd0bd7 100644
--- a/core/dex_preopt_libart.mk
+++ b/core/dex_preopt_libart.mk
@@ -3,8 +3,13 @@
#
####################################
+# Default to debug version to help find bugs.
+# Set USE_DEX2OAT_DEBUG to false for only building non-debug versions.
+ifeq ($(USE_DEX2OAT_DEBUG),false)
DEX2OAT := $(HOST_OUT_EXECUTABLES)/dex2oat$(HOST_EXECUTABLE_SUFFIX)
-DEX2OATD := $(HOST_OUT_EXECUTABLES)/dex2oatd$(HOST_EXECUTABLE_SUFFIX)
+else
+DEX2OAT := $(HOST_OUT_EXECUTABLES)/dex2oatd$(HOST_EXECUTABLE_SUFFIX)
+endif
# By default, do not run rerun dex2oat if the tool changes.
# Comment out the | to force dex2oat to rerun on after all changes.
@@ -13,9 +18,6 @@
DEX2OAT_DEPENDENCY += |
DEX2OAT_DEPENDENCY += $(DEX2OAT)
-DEX2OATD_DEPENDENCY := $(DEX2OAT_DEPENDENCY)
-DEX2OATD_DEPENDENCY += $(DEX2OATD)
-
# Use the first preloaded-classes file in PRODUCT_COPY_FILES.
PRELOADED_CLASSES := $(call word-colon,1,$(firstword \
$(filter %system/etc/preloaded-classes,$(PRODUCT_COPY_FILES))))
@@ -24,13 +26,6 @@
COMPILED_CLASSES := $(call word-colon,1,$(firstword \
$(filter %system/etc/compiled-classes,$(PRODUCT_COPY_FILES))))
-# Default to debug version to help find bugs.
-# Set USE_DEX2OAT_DEBUG to false for only building non-debug versions.
-ifneq ($(USE_DEX2OAT_DEBUG), false)
-DEX2OAT = $(DEX2OATD)
-DEX2OAT_DEPENDENCY = $(DEX2OATD_DEPENDENCY)
-endif
-
# start of image reserved address space
LIBART_IMG_HOST_BASE_ADDRESS := 0x60000000
LIBART_IMG_TARGET_BASE_ADDRESS := 0x70000000