Avoid the .stamp dependency in build_generated_jni.mk

This is similar in spirit to commit 1b7fd9a7. This fixes the dependency
of the *_jni.h files so they don't race against the .o generation
anymore.

Bug: 36449525
Test: m -j32
Change-Id: Ia9eccc76a6b8f7e44f0e553fb9c7098358a1c751
diff --git a/build_generated_jni.mk b/build_generated_jni.mk
index a91d7ad..d6e83a4 100644
--- a/build_generated_jni.mk
+++ b/build_generated_jni.mk
@@ -41,10 +41,7 @@
 # Add the generated sources to the C includes.
 LOCAL_C_INCLUDES += $(generated_sources_dir)
 
-# Create a stamp file after all files have been generated.
-gen := $(generated_sources_dir)/.jni.stamp
-$(gen) : $(generated_files)
-	$(hide) echo $^ | sed -e 's/ /\n/g' > $@
-
-# Add the stamp file as a dependency to {import,export}_includes.
-$(local-intermediates-dir)/import_includes: | $(generated_sources_dir)/.jni.stamp
+# LOCAL_GENERATED_SOURCES will filter out anything that's not a C/C++ source
+# file, but still add the files as dependencies of the other files in the
+# module.
+LOCAL_GENERATED_SOURCES += $(generated_files)