add new gen/ directory for generated sources

Allow modules to generate source into $OUT/gen, which will then
be copied into $OUT/obj and $OUT/obj_$(TARGET_2ND_ARCH) as
necessary.  This allows a single build rule invocation that includes
generated source to build for the first and second architectures.

Modules will need to change calls to local-intermediates-dir into
local-generated-sources-dir.

Change-Id: I62504bad9454b3d9fde7b84ab9f0a487a2ecf0bf
diff --git a/core/build-system.html b/core/build-system.html
index 182580c..caade58 100644
--- a/core/build-system.html
+++ b/core/build-system.html
@@ -409,8 +409,8 @@
 need to change.</p>
 
 <p>You need to put this after you have declared <code>LOCAL_PATH</code> and
-<code>LOCAL_MODULE</code>, because the <code>$(local-intermediates-dir)</code>
-and <code>$(local-host-intermediates-dir)</code> macros use these variables
+<code>LOCAL_MODULE</code>, because the <code>$(local-generated-sources-dir)</code>
+and <code>$(local-host-generated-sources-dir)</code> macros use these variables
 to determine where to put the files.
 
 <h5>Example 1</h5>
@@ -419,7 +419,7 @@
 built to $(HOST_OUT_EXECUTABLES)/dftables.  Note on the second to last line
 that a dependency is created on the tool.</p>
 <pre>
-intermediates:= $(local-intermediates-dir)
+intermediates:= $(local-generated-sources-dir)
 GEN := $(intermediates)/<font color=red>chartables.c</font>
 $(GEN): PRIVATE_CUSTOM_TOOL = <font color=red>$(HOST_OUT_EXECUTABLES)/dftables $@</font>
 $(GEN): <font color=red>$(HOST_OUT_EXECUTABLES)/dftables</font>
@@ -433,7 +433,7 @@
 target-specific variable called PRIVATE_INPUT_FILE to store the name of the
 input file.</p>
 <pre>
-intermediates:= $(local-intermediates-dir)
+intermediates:= $(local-generated-sources-dir)
 GEN := $(intermediates)/<font color=red>file.c</font>
 $(GEN): PRIVATE_INPUT_FILE := $(LOCAL_PATH)/<font color=red>input.file</font>
 $(GEN): PRIVATE_CUSTOM_TOOL = <font color=red>cat $(PRIVATE_INPUT_FILE) &gt; $@</font>
@@ -447,7 +447,7 @@
 name, and use the same tool, you can combine them.  (here the *.lut.h files are
 the generated ones, and the *.cpp files are the input files)</p>
 <pre>
-intermediates:= $(local-intermediates-dir)
+intermediates:= $(local-generated-sources-dir)
 GEN := $(addprefix $(intermediates)<font color=red>/kjs/, \
             array_object.lut.h \
             bool_object.lut.h \</font>