Update Android.mk finder to work with Android.bp files
The Android.mk finder should stop traversing when it finds an Android.bp
file, and any Android.soong.mk file at the same path should be included.
Update filter-soong-makefiles to accept a mixed list of Android.bp files
and Android.mk files, convert Android.bp files to Android.soong.mk files
if they exist, and ignore Android.mk files that have an Android.bp file.
Update first-makefiles-under to use the new --dir syntax for
findleaves.py and search for both Android.bp and Android.mk files.
Update all-makefiles-under and all-named-subdir-makefiles to search for
both Android.bp and Android.mk files.
Change-Id: Iddc51bf84593d5de3add02f2b2c065da08962af4
diff --git a/core/main.mk b/core/main.mk
index 9866dff..c25be7f 100644
--- a/core/main.mk
+++ b/core/main.mk
@@ -501,7 +501,6 @@
#
# Typical build; include any Android.mk files we can find.
#
-subdirs := $(TOP)
FULL_BUILD := true
@@ -542,14 +541,9 @@
# Include all of the makefiles in the system
#
-# Can't use first-makefiles-under here because
-# --mindepth=2 makes the prunes not work.
-subdir_makefiles := \
- $(shell build/tools/findleaves.py $(FIND_LEAVES_EXCLUDES) $(subdirs) Android.mk)
+subdir_makefiles := $(SOONG_ANDROID_MK) $(call first-makefiles-under,$(TOP))
-subdir_makefiles := $(SOONG_ANDROID_MK) $(call filter-soong-makefiles,$(subdir_makefiles))
-
-$(foreach mk, $(subdir_makefiles),$(info including $(mk) ...)$(eval include $(mk)))
+$(foreach mk,$(subdir_makefiles),$(info including $(mk) ...)$(eval include $(mk)))
ifdef PDK_FUSION_PLATFORM_ZIP
# Bring in the PDK platform.zip modules.