Ignore Android.mk files with USE_SOONG=true
When USE_SOONG=true, ignore any Android.mk file that has an Android.bp
file in the same directory.
Change-Id: Id79bd90c2aed5dafc2f8ad2c5b7eb0aa6e81dc18
diff --git a/core/main.mk b/core/main.mk
index d2f8414..32b0b39 100644
--- a/core/main.mk
+++ b/core/main.mk
@@ -534,11 +534,12 @@
# --mindepth=2 makes the prunes not work.
subdir_makefiles := \
$(shell build/tools/findleaves.py $(FIND_LEAVES_EXCLUDES) $(subdirs) Android.mk)
+
ifeq ($(USE_SOONG),true)
-subdir_makefiles := $(SOONG_ANDROID_MK) $(subdir_makefiles)
+subdir_makefiles := $(SOONG_ANDROID_MK) $(call filter-soong-makefiles,$(subdir_makefiles))
endif
-$(foreach mk, $(subdir_makefiles), $(info including $(mk) ...)$(eval include $(mk)))
+$(foreach mk, $(subdir_makefiles),$(info including $(mk) ...)$(eval include $(mk)))
endif # dont_bother