Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 95ebfddd authored by Colin Cross's avatar Colin Cross Committed by android-build-merger
Browse files

Merge \\"Remove Android.bp logic from makefiles\\" am: 8bc18d35

am: 7dc26e8a

Change-Id: Iad45e3fd9b172c94df46d20425e51ae7477b5a2d
parents 245b0249 7dc26e8a
Loading
Loading
Loading
Loading
+4 −35
Original line number Diff line number Diff line
@@ -138,40 +138,12 @@ $(strip \
endef


define _filter-soong-makefile
$(if $(wildcard $(patsubst %/Android.mk,%/Android.bp,$(1))),\
  $(info skipping $(1) ...)\
    $(call _filter-soong-bpfile $(patsubst %/Android.mk,%/Android.bp,$(1))),\
  $(1))
endef

define _filter-soong-bpfile
$(if $(wildcard $(patsubst %/Android.bp,%/Android.soong.mk,$(1))),\
  $(patsubst %/Android.bp,%/Android.soong.mk,$(1)))
endef

###########################################################
## Remove any makefiles that are being handled by soong
##
## If passed an Android.mk file, returns the Android.mk file
## if no Android.bp file exists and the same path.  If an
## Android.bp file exists, or if passed an Android.bp file,
## returns the Android.soong.mk file at the same path if it
## exists, or nothing if it does not.
###########################################################
define filter-soong-makefiles
$(sort $(foreach mk,$(1),\
  $(if $(filter %/Android.bp,$(mk)),\
    $(call _filter-soong-bpfile,$(mk)),\
    $(call _filter-soong-makefile,$(mk)))))
endef

###########################################################
## Retrieve a list of all makefiles immediately below some directory
###########################################################

define all-makefiles-under
$(call filter-soong-makefiles,$(wildcard $(1)/*/Android.mk $(1)/*/Android.bp))
$(wildcard $(1)/*/Android.mk)
endef

###########################################################
@@ -182,9 +154,8 @@ endef
# $(1): directory to search under
# Ignores $(1)/Android.mk
define first-makefiles-under
$(call filter-soong-makefiles,\
$(shell build/tools/findleaves.py $(FIND_LEAVES_EXCLUDES) \
        --mindepth=2 $(addprefix --dir=,$(1)) Android.bp Android.mk))
        --mindepth=2 $(addprefix --dir=,$(1)) Android.mk)
endef

###########################################################
@@ -204,9 +175,7 @@ endef

# $(1): List of directories to look for under this directory
define all-named-subdir-makefiles
$(call filter-soong-makefiles,\
  $(wildcard $(addsuffix /Android.mk, $(addprefix $(call my-dir)/,$(1))))\
  $(wildcard $(addsuffix /Android.bp, $(addprefix $(call my-dir)/,$(1)))))
$(wildcard $(addsuffix /Android.mk, $(addprefix $(call my-dir)/,$(1))))
endef

###########################################################
+1 −1
Original line number Diff line number Diff line
@@ -510,7 +510,7 @@ endif
ifneq ($(ONE_SHOT_MAKEFILE),)
# We've probably been invoked by the "mm" shell function
# with a subdirectory's makefile.
include  $(SOONG_ANDROID_MK) $(call filter-soong-makefiles,$(ONE_SHOT_MAKEFILE))
include $(SOONG_ANDROID_MK) $(wildcard $(ONE_SHOT_MAKEFILE))
# Change CUSTOM_MODULES to include only modules that were
# defined by this makefile; this will install all of those
# modules as a side-effect.  Do this after including ONE_SHOT_MAKEFILE