Simplify and speed up makefile.
No need to shell out just to find 2 makefiles that very rarely change.
As an added bonus, this fixes a bug that appears when the cd command
actually prints some output, which it does when certain
environment variables are set.
Change-Id: Iab7a738c2ca62f3c591c3bf1f47b70407b90e99a
diff --git a/NativeCode.mk b/NativeCode.mk
index 1e7c4f4..62ef803 100644
--- a/NativeCode.mk
+++ b/NativeCode.mk
@@ -21,13 +21,6 @@
# Common definitions for host and target.
#
-# Get the list of all native directories that contain sub.mk files.
-# We're using "sub.mk" to make it clear that these are not typical
-# android makefiles.
-define all-core-native-dirs
-$(patsubst %/sub.mk,%,$(shell cd $(LOCAL_PATH) && ls -d */src/$(1)/native/sub.mk 2> /dev/null))
-endef
-
# These two definitions are used to help sanity check what's put in
# sub.mk. See, the "error" directives immediately below.
core_magic_local_target := ...//::default:://...
@@ -54,12 +47,6 @@
LOCAL_SRC_FILES :=
endef
-# Find any native directories containing sub.mk files.
-core_native_dirs := $(strip $(call all-core-native-dirs,main))
-ifeq ($(core_native_dirs),)
- $(error No native code defined for libcore)
-endif
-
# Set up the default state. Note: We use CLEAR_VARS here, even though
# we aren't quite defining a new rule yet, to make sure that the
# sub.mk files don't see anything stray from the last rule that was
@@ -70,7 +57,7 @@
# Include the sub.mk files.
$(foreach dir, \
- $(core_native_dirs), \
+ dalvik/src/main/native luni/src/main/native, \
$(eval $(call include-core-native-dir,$(dir))))
# Extract out the allowed LOCAL_* variables. Note: $(sort) also