Ninja doesn't like dependencies on directories.

Also ensure target directory cleanup before copying the i18n data file
there.

Test: art/tools/buildbot-build.sh --host
Test: art/test/testrunner/run_build_test_target.py art-test
Bug: 157734636
Bug: 129332183
Change-Id: I6d9ac8f353e1c78ac6247bd75d7c7598d57fb56d
diff --git a/Android.mk b/Android.mk
index 776906d..b50af78 100644
--- a/Android.mk
+++ b/Android.mk
@@ -469,14 +469,16 @@
 build-art: build-art-host build-art-target
 
 # For host, we extract the ICU data from the apex and install it to HOST_OUT/I18N_APEX.
-host-i18n-data-file := $(HOST_OUT)/$(I18N_APEX)/etc
-$(host-i18n-data-file): $(TARGET_OUT)/apex/$(I18N_APEX).apex $(HOST_OUT)/bin/deapexer
+host-i18n-data-timestamp := $(HOST_OUT)/$(I18N_APEX)/timestamp
+$(host-i18n-data-timestamp): $(TARGET_OUT)/apex/$(I18N_APEX).apex $(HOST_OUT)/bin/deapexer
 	$(call extract-from-apex,$(I18N_APEX))
+	rm -rf $(HOST_OUT)/$(I18N_APEX)
 	mkdir -p $(HOST_OUT)/$(I18N_APEX)/
 	cp -R $(TARGET_OUT)/apex/$(I18N_APEX)/etc/ $(HOST_OUT)/$(I18N_APEX)/
+	touch $@
 
 .PHONY: build-art-host
-build-art-host:   $(HOST_OUT_EXECUTABLES)/art $(ART_HOST_DEPENDENCIES) $(HOST_CORE_IMG_OUTS) $(host-i18n-data-file)
+build-art-host:   $(HOST_OUT_EXECUTABLES)/art $(ART_HOST_DEPENDENCIES) $(HOST_CORE_IMG_OUTS) $(host-i18n-data-timestamp)
 
 .PHONY: build-art-target
 build-art-target: $(TARGET_OUT_EXECUTABLES)/art $(ART_TARGET_DEPENDENCIES) $(TARGET_CORE_IMG_OUTS)