Merge "build: Load makefiles in the same order with Make 4.0"
diff --git a/core/definitions.mk b/core/definitions.mk
index 6bceee4..f20b2b7 100644
--- a/core/definitions.mk
+++ b/core/definitions.mk
@@ -139,7 +139,7 @@
 ###########################################################
 
 define all-makefiles-under
-$(wildcard $(1)/*/Android.mk)
+$(sort $(wildcard $(1)/*/Android.mk))
 endef
 
 ###########################################################
@@ -171,7 +171,7 @@
 
 # $(1): List of directories to look for under this directory
 define all-named-subdir-makefiles
-$(wildcard $(addsuffix /Android.mk, $(addprefix $(call my-dir)/,$(1))))
+$(sort $(wildcard $(addsuffix /Android.mk, $(addprefix $(call my-dir)/,$(1)))))
 endef
 
 ###########################################################