AI 149502: - Adding sensors to PDK TOC

- Added initial table of Product Definition file parameters
  - Added initial table of Android.mk LOCAL_* parameters

Automated import of CL 149502
This commit is contained in:
Reena Lee
2009-06-02 15:00:28 -07:00
committed by The Android Open Source Project
parent e2f2e9fe59
commit c91e5f15ba
4 changed files with 628 additions and 44 deletions

View File

@@ -10,7 +10,6 @@ pdk.version=<current_PDK_version>
<a href="http://wiki.corp.google.com/twiki/bin/view/Main/AndroidBuildCookbook#Building_a_APK_that_should_be_si">Building a APK that should be signed with a specific vendor key</a><br> <a href="http://wiki.corp.google.com/twiki/bin/view/Main/AndroidBuildCookbook#Building_a_APK_that_should_be_si">Building a APK that should be signed with a specific vendor key</a><br>
<a href="http://wiki.corp.google.com/twiki/bin/view/Main/AndroidBuildCookbook#Adding_a_prebuilt_APK">Adding a prebuilt APK</a><br> <a href="http://wiki.corp.google.com/twiki/bin/view/Main/AndroidBuildCookbook#Adding_a_prebuilt_APK">Adding a prebuilt APK</a><br>
<a href="http://wiki.corp.google.com/twiki/bin/view/Main/AndroidBuildCookbook#Adding_a_Static_Java_Library">Adding a Static Java Library</a><br> <a href="http://wiki.corp.google.com/twiki/bin/view/Main/AndroidBuildCookbook#Adding_a_Static_Java_Library">Adding a Static Java Library</a><br>
<a href="http://wiki.corp.google.com/twiki/bin/view/Main/AndroidBuildCookbook#LOCAL_MODULE_TAGS">Using LOCAL_MODULE_TAGS</a><br>
</div> </div>
<p>The Android Build Cookbook offers code snippets to help you quickly implement some common build tasks. For additional instruction, please see the other build documents in this section.</p> <p>The Android Build Cookbook offers code snippets to help you quickly implement some common build tasks. For additional instruction, please see the other build documents in this section.</p>
@@ -107,12 +106,443 @@ pdk.version=<current_PDK_version>
# Build a static jar file. # Build a static jar file.
include $(BUILD_STATIC_JAVA_LIBRARY) include $(BUILD_STATIC_JAVA_LIBRARY)
</pre> </pre>
<h2><a name="Random_other_build_tidbits" id="Random_other_build_tidbits"></a>Random other build tidbits</h2> <h2><a name="Android_mk_variables" id="Android_mk_variables"></a>Android.mk Variables</h2>
<h3><a name="LOCAL_MODULE_TAGS" id="LOCAL_MODULE_TAGS"></a>LOCAL_MODULE_TAGS</h3>
<p>This variable controls what build flavors the package gets included in. For example:</p> <p>These are the variables that you'll commonly see in Android.mk files, listed
<ul type="disc"> alphabetically. First, a note on the variable naming: </p>
<li>user - means include this in user/userdebug builds</li>
<li>eng - means include this in eng builds</li> <ul>
<li>tests - means the target is a testing target and makes it available for tests</li> <li><b>LOCAL_</b> - These variables are set per-module. They are cleared
<li>optional - don't include this</li> by the <code>include $(CLEAR_VARS)</code> line, so you can rely on them
being empty after including that file. Most of the variables you'll use
in most modules are LOCAL_ variables.</li>
<li><b>PRIVATE_</b> - These variables are make-target-specific variables. That
means they're only usable within the commands for that module. It also
means that they're unlikely to change behind your back from modules that
are included after yours. This
<a href="http://www.gnu.org/software/make/manual/make.html#Target_002dspecific">link to the make documentation</a>
describes more about target-specific variables.
</li>
<li><b>HOST_</b> and <b>TARGET_</b> - These contain the directories
and definitions that are specific to either the host or the target builds.
Do not set variables that start with HOST_ or TARGET_ in your makefiles.
</li>
<li><b>BUILD_</b> and <b>CLEAR_VARS</b> - These contain the names of
well-defined template makefiles to include. Some examples are CLEAR_VARS
and BUILD_HOST_PACKAGE.</li>
<li>Any other name is fair-game for you to use in your Android.mk. However,
remember that this is a non-recursive build system, so it is possible that
your variable will be changed by another Android.mk included later, and be
different when the commands for your rule / module are executed.</li>
</ul> </ul>
<table border=1 cellpadding=2 cellspacing=0>
<tbody><tr>
<th scope="col">Parameter</th>
<th scope="col">Description</th>
</tr>
<tr>
<td valign="top">LOCAL_AAPT_FLAGS</td>
<td valign="top"></td>
</tr>
<tr>
<td valign="top">LOCAL_ACP_UNAVAILABLE</td>
<td valign="top"></td>
</tr>
<tr>
<td valign="top">LOCAL_ADDITIONAL_JAVA_DIR</td>
<td valign="top"></td>
</tr>
<tr>
<td valign="top">LOCAL_AIDL_INCLUDES</td>
<td valign="top"></td>
</tr>
<tr>
<td valign="top">LOCAL_ALLOW_UNDEFINED_SYMBOLS</td>
<td valign="top"></td>
</tr>
<tr>
<td valign="top">LOCAL_ARM_MODE</td>
<td valign="top"></td>
</tr>
<tr>
<td valign="top">LOCAL_ASFLAGS</td>
<td valign="top"></td>
</tr>
<tr>
<td valign="top">LOCAL_ASSET_DIR</td>
<td valign="top"></td>
</tr>
<tr>
<td valign="top">LOCAL_ASSET_FILES</td>
<td valign="top">In Android.mk files that <code>include $(BUILD_PACKAGE)</code> set this
to the set of files you want built into your app. Usually:</p>
<p><code>LOCAL_ASSET_FILES += $(call find-subdir-assets)</code></td>
</tr>
<tr>
<td valign="top">LOCAL_BUILT_MODULE_STEM</td>
<td valign="top"></td>
</tr>
<tr>
<td valign="top">LOCAL_C_INCLUDES</td>
<td valign="top"><p>Additional directories to instruct the C/C++ compilers to look for header
files in. These paths are rooted at the top of the tree. Use
<code>LOCAL_PATH</code> if you have subdirectories of your own that you
want in the include paths. For example:</p>
<p><code>
LOCAL_C_INCLUDES += extlibs/zlib-1.2.3<br/>
LOCAL_C_INCLUDES += $(LOCAL_PATH)/src
</code></p>
<p>You should not add subdirectories of include to
<code>LOCAL_C_INCLUDES</code>, instead you should reference those files
in the <code>#include</code> statement with their subdirectories. For
example:</p>
<p><code>#include &lt;utils/KeyedVector.h&gt;</code><br/>
not <code><s>#include &lt;KeyedVector.h&gt;</s></code></p> </td>
</tr>
<tr>
<td valign="top">LOCAL_CC</td>
<td valign="top">If you want to use a different C compiler for this module, set LOCAL_CC
to the path to the compiler. If LOCAL_CC is blank, the appropriate default
compiler is used.</td>
</tr>
<tr>
<td valign="top">LOCAL_CERTIFICATE</td>
<td valign="top"></td>
</tr>
<tr>
<td valign="top">LOCAL_CFLAGS</td>
<td valign="top">If you have additional flags to pass into the C or C++ compiler, add
them here. For example:</p>
<p><code>LOCAL_CFLAGS += -DLIBUTILS_NATIVE=1</code></td>
</tr>
<tr>
<td valign="top">LOCAL_CLASSPATH</td>
<td valign="top"></td>
</tr>
<tr>
<td valign="top">LOCAL_COMPRESS_MODULE_SYMBOLS</td>
<td valign="top"></td>
</tr>
<tr>
<td valign="top">LOCAL_COPY_HEADERS</td>
<td valign="top"><p>The set of files to copy to the install include tree. You must also
supply <code>LOCAL_COPY_HEADERS_TO</code>.</p>
<p>This is going away because copying headers messes up the error messages, and
may lead to people editing those headers instead of the correct ones. It also
makes it easier to do bad layering in the system, which we want to avoid. We
also aren't doing a C/C++ SDK, so there is no ultimate requirement to copy any
headers.</p></td>
</tr>
<tr>
<td valign="top">LOCAL_COPY_HEADERS_TO</td>
<td valign="top"><p>The directory within "include" to copy the headers listed in
<code>LOCAL_COPY_HEADERS</code> to.</p>
<p>This is going away because copying headers messes up the error messages, and
may lead to people editing those headers instead of the correct ones. It also
makes it easier to do bad layering in the system, which we want to avoid. We
also aren't doing a C/C++ SDK, so there is no ultimate requirement to copy any
headers.</p></td>
</tr>
<tr>
<td valign="top">LOCAL_CPP_EXTENSION</td>
<td valign="top">If your C++ files end in something other than "<code>.cpp</code>",
you can specify the custom extension here. For example:
<p><code>LOCAL_CPP_EXTENSION := .cc</code></p>
Note that all C++ files for a given module must have the same
extension; it is not currently possible to mix different extensions.</td>
</tr>
<tr>
<td valign="top">LOCAL_CPPFLAGS</td>
<td valign="top">If you have additional flags to pass into <i>only</i> the C++ compiler, add
them here. For example:</p>
<p><code>LOCAL_CPPFLAGS += -ffriend-injection</code></p>
<code>LOCAL_CPPFLAGS</code> is guaranteed to be after <code>LOCAL_CFLAGS</code>
on the compile line, so you can use it to override flags listed in
<code>LOCAL_CFLAGS</code></td>
</tr>
<tr>
<td valign="top">LOCAL_CXX</td>
<td valign="top">If you want to use a different C++ compiler for this module, set LOCAL_CXX
to the path to the compiler. If LOCAL_CXX is blank, the appropriate default
compiler is used.</td>
</tr>
<tr>
<td valign="top">LOCAL_DX_FLAGS</td>
<td valign="top"></td>
</tr>
<tr>
<td valign="top">LOCAL_EXPORT_PACKAGE_RESOURCES</td>
<td valign="top"></td>
</tr>
<tr>
<td valign="top">LOCAL_FORCE_STATIC_EXECUTABLE</td>
<td valign="top"><p>If your executable should be linked statically, set
<code>LOCAL_FORCE_STATIC_EXECUTABLE:=true</code>. There is a very short
list of libraries that we have in static form (currently only libc). This is
really only used for executables in /sbin on the root filesystem.</p> </td>
</tr>
<tr>
<td valign="top">LOCAL_GENERATED_SOURCES</td>
<td valign="top"><p>Files that you add to <code>LOCAL_GENERATED_SOURCES</code> will be
automatically generated and then linked in when your module is built.
See the <a href="#custom-tools">Custom Tools</a> template makefile for an
example.</p> </td>
</tr>
<tr>
<td valign="top">LOCAL_INSTRUMENTATION_FOR</td>
<td valign="top"></td>
</tr>
<tr>
<td valign="top">LOCAL_INSTRUMENTATION_FOR_PACKAGE_NAME</td>
<td valign="top"></td>
</tr>
<tr>
<td valign="top">LOCAL_INTERMEDIATE_SOURCES</td>
<td valign="top"></td>
</tr>
<tr>
<td valign="top">LOCAL_INTERMEDIATE_TARGETS</td>
<td valign="top"></td>
</tr>
<tr>
<td valign="top">LOCAL_IS_HOST_MODULE</td>
<td valign="top"></td>
</tr>
<tr>
<td valign="top">LOCAL_JAR_MANIFEST</td>
<td valign="top"></td>
</tr>
<tr>
<td valign="top">LOCAL_JARJAR_RULES</td>
<td valign="top"></td>
</tr>
<tr>
<td valign="top">LOCAL_JAVA_LIBRARIES</td>
<td valign="top"><p>When linking Java apps and libraries, <code>LOCAL_JAVA_LIBRARIES</code>
specifies which sets of java classes to include. Currently there are
two of these: <code>core</code> and <code>framework</code>.
In most cases, it will look like this:</p>
<p><code>LOCAL_JAVA_LIBRARIES := core framework</code></p>
<p>Note that setting <code>LOCAL_JAVA_LIBRARIES</code> is not necessary
(and is not allowed) when building an APK with
"<code>include $(BUILD_PACKAGE)</code>". The appropriate libraries
will be included automatically.</p> </td>
</tr>
<tr>
<td valign="top">LOCAL_JAVA_RESOURCE_DIRS</td>
<td valign="top"></td>
</tr>
<tr>
<td valign="top">LOCAL_JAVA_RESOURCE_FILES</td>
<td valign="top"></td>
</tr>
<tr>
<td valign="top">LOCAL_JNI_SHARED_LIBRARIES</td>
<td valign="top"></td>
</tr>
<tr>
<td valign="top">LOCAL_LDFLAGS</td>
<td valign="top"><p>You can pass additional flags to the linker by setting
<code>LOCAL_LDFLAGS</code>. Keep in mind that the order of parameters is
very important to ld, so test whatever you do on all platforms.</p> </td>
</tr>
<tr>
<td valign="top">LOCAL_LDLIBS</td>
<td valign="top"><p><code>LOCAL_LDLIBS</code> allows you to specify additional libraries
that are not part of the build for your executable or library. Specify
the libraries you want in -lxxx format; they're passed directly to the
link line. However, keep in mind that there will be no dependency generated
for these libraries. It's most useful in simulator builds where you want
to use a library preinstalled on the host. The linker (ld) is a particularly
fussy beast, so it's sometimes necessary to pass other flags here if you're
doing something sneaky. Some examples:</p>
<p><code>LOCAL_LDLIBS += -lcurses -lpthread<br/>
LOCAL_LDLIBS += -Wl,-z,origin
</code></p> </td>
</tr>
<tr>
<td valign="top">LOCAL_MODULE</td>
<td valign="top"><code>LOCAL_MODULE</code> is the name of what's supposed to be generated
from your Android.mk. For exmample, for libkjs, the <code>LOCAL_MODULE</code>
is "libkjs" (the build system adds the appropriate suffix -- .so .dylib .dll).
For app modules, use <code>LOCAL_PACKAGE_NAME</code> instead of
<code>LOCAL_MODULE</code>. </td>
</tr>
<tr>
<td valign="top">LOCAL_MODULE_PATH</td>
<td valign="top">Instructs the build system to put the module somewhere other than what's
normal for its type. If you override this, make sure you also set
<code>LOCAL_UNSTRIPPED_PATH</code> if it's an executable or a shared library
so the unstripped binary has somewhere to go. An error will occur if you forget
to.</p>
<p>See <a href="#moving-modules">Putting modules elsewhere</a> for more.</td>
</tr>
<tr>
<td valign="top">LOCAL_MODULE_STEM</td>
<td valign="top"></td>
</tr>
<tr>
<td valign="top">LOCAL_MODULE_TAGS</td>
<td valign="top"><p>Set <code>LOCAL_MODULE_TAGS</code> to any number of whitespace-separated
tags. <p>This variable controls what build flavors the package gets included in. For example:</p>
<ul type="disc">
<li><code>user</code>: include this in user/userdebug builds</li>
<li><code>eng</code>: include this in eng builds</li>
<li><code>tests</code>: the target is a testing target and makes it available for tests</li>
<li><code>optional</code>: don't include this</li>
</ul></td>
</tr>
<tr>
<td valign="top">LOCAL_NO_DEFAULT_COMPILER_FLAGS</td>
<td valign="top"></td>
</tr>
<tr>
<td valign="top">LOCAL_NO_EMMA_COMPILE</td>
<td valign="top"></td>
</tr>
<tr>
<td valign="top">LOCAL_NO_EMMA_INSTRUMENT</td>
<td valign="top"></td>
</tr>
<tr>
<td valign="top">LOCAL_NO_STANDARD_LIBRARIES</td>
<td valign="top"></td>
</tr>
<tr>
<td valign="top">LOCAL_OVERRIDES_PACKAGES</td>
<td valign="top"></td>
</tr>
<tr>
<td valign="top">LOCAL_PACKAGE_NAME</td>
<td valign="top"><code>LOCAL_PACKAGE_NAME</code> is the name of an app. For example,
Dialer, Contacts, etc. </td>
</tr>
<tr>
<td valign="top">LOCAL_POST_PROCESS_COMMAND</td>
<td valign="top"><p>For host executables, you can specify a command to run on the module
after it's been linked. You might have to go through some contortions
to get variables right because of early or late variable evaluation:</p>
<p><code>module := $(HOST_OUT_EXECUTABLES)/$(LOCAL_MODULE)<br/>
LOCAL_POST_PROCESS_COMMAND := /Developer/Tools/Rez -d __DARWIN__ -t APPL\<br/>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-d __WXMAC__ -o $(module) Carbon.r
</code></p>
</td>
</tr>
<tr>
<td valign="top">LOCAL_PREBUILT_EXECUTABLES</td>
<td valign="top">When including $(BUILD_PREBUILT) or $(BUILD_HOST_PREBUILT), set these to
executables that you want copied. They're located automatically into the
right bin directory.</td>
</tr>
<tr>
<td valign="top">LOCAL_PREBUILT_JAVA_LIBRARIES</td>
<td valign="top"></td>
</tr>
<tr>
<td valign="top">LOCAL_PREBUILT_LIBS</td>
<td valign="top">When including $(BUILD_PREBUILT) or $(BUILD_HOST_PREBUILT), set these to
libraries that you want copied. They're located automatically into the
right lib directory.</td>
</tr>
<tr>
<td valign="top">LOCAL_PREBUILT_OBJ_FILES</td>
<td valign="top"></td>
</tr>
<tr>
<td valign="top">LOCAL_PREBUILT_STATIC_JAVA_LIBRARIES</td>
<td valign="top"></td>
</tr>
<tr>
<td valign="top">LOCAL_PRELINK_MODULE</td>
<td valign="top"></td>
</tr>
<tr>
<td valign="top">LOCAL_REQUIRED_MODULES</td>
<td valign="top"><p>Set <code>LOCAL_REQUIRED_MODULES</code> to any number of whitespace-separated
module names, like "libblah" or "Email". If this module is installed, all
of the modules that it requires will be installed as well. This can be
used to, e.g., ensure that necessary shared libraries or providers are
installed when a given app is installed.</td>
</tr>
<tr>
<td valign="top">LOCAL_RESOURCE_DIR</td>
<td valign="top"></td>
</tr>
<tr>
<td valign="top">LOCAL_SDK_VERSION</td>
<td valign="top"></td>
</tr>
<tr>
<td valign="top">LOCAL_SHARED_LIBRARIES</td>
<td valign="top">These are the libraries you directly link against. You don't need to
pass transitively included libraries. Specify the name without the suffix:</p>
<p><code>LOCAL_SHARED_LIBRARIES := \<br/>
&nbsp;&nbsp;&nbsp;&nbsp;libutils \<br/>
&nbsp;&nbsp;&nbsp;&nbsp;libui \<br/>
&nbsp;&nbsp;&nbsp;&nbsp;libaudio \<br/>
&nbsp;&nbsp;&nbsp;&nbsp;libexpat \<br/>
&nbsp;&nbsp;&nbsp;&nbsp;libsgl
</code></td>
</tr>
<tr>
<td valign="top">LOCAL_SRC_FILES</td>
<td valign="top">The build system looks at <code>LOCAL_SRC_FILES</code> to know what source
files to compile -- .cpp .c .y .l .java. For lex and yacc files, it knows
how to correctly do the intermediate .h and .c/.cpp files automatically. If
the files are in a subdirectory of the one containing the Android.mk, prefix
them with the directory name:</p>
<p><code>LOCAL_SRC_FILES := \<br/>
&nbsp;&nbsp;&nbsp;&nbsp;file1.cpp \<br/>
&nbsp;&nbsp;&nbsp;&nbsp;dir/file2.cpp
</code></td>
</tr>
<tr>
<td valign="top">LOCAL_STATIC_JAVA_LIBRARIES</td>
<td valign="top"></td>
</tr>
<tr>
<td valign="top">LOCAL_STATIC_LIBRARIES</td>
<td valign="top">These are the static libraries that you want to include in your module.
Mostly, we use shared libraries, but there are a couple of places, like
executables in sbin and host executables where we use static libraries instead.
<p><code>LOCAL_STATIC_LIBRARIES := \<br/>
&nbsp;&nbsp;&nbsp;&nbsp;libutils \<br/>
&nbsp;&nbsp;&nbsp;&nbsp;libtinyxml
</code></td>
</tr>
<tr>
<td valign="top">LOCAL_UNINSTALLABLE_MODULE</td>
<td valign="top"></td>
</tr>
<tr>
<td valign="top">LOCAL_UNSTRIPPED_PATH</td>
<td valign="top">Instructs the build system to put the unstripped version of the module
somewhere other than what's normal for its type. Usually, you override this
because you overrode <code>LOCAL_MODULE_PATH</code> for an executable or a
shared library. If you overrode <code>LOCAL_MODULE_PATH</code>, but not
<code>LOCAL_UNSTRIPPED_PATH</code>, an error will occur.</p>
<p>See <a href="#moving-modules">Putting modules elsewhere</a> for more.</td>
</tr>
<tr>
<td valign="top">LOCAL_WHOLE_STATIC_LIBRARIES</td>
<td valign="top">These are the static libraries that you want to include in your module without allowing
the linker to remove dead code from them. This is mostly useful if you want to add a static library
to a shared library and have the static library's content exposed from the shared library.
<p><code>LOCAL_WHOLE_STATIC_LIBRARIES := \<br/>
&nbsp;&nbsp;&nbsp;&nbsp;libsqlite3_android<br/>
</code></td>
</tr>
<tr>
<td valign="top">LOCAL_YACCFLAGS</td>
<td valign="top">Any flags to pass to invocations of yacc for your module. A known limitation
here is that the flags will be the same for all invocations of YACC for your
module. This can be fixed. If you ever need it to be, just ask.</p>
<p><code>LOCAL_YACCFLAGS := -p kjsyy</code></td>
</tr>
<tr>
<td valign="top">OVERRIDE_BUILT_MODULE_PATH</td>
<td valign="top"></td>
</tr>
</table>

View File

@@ -126,3 +126,191 @@ pdk.version=1.0
</ul> </ul>
</ul> </ul>
</p> </p>
<a name="androidBuildSystemProductDefFiles"></a><h2>Product Definition Files</h2>
<p>Product-specific variables are defined in product definition files. A product definition file can inherit from other product definition files, thus reducing the need to copy and simplifying maintenance.</p>
<p>Variables maintained in a product definition files include:</p>
<p>
<table border=1 cellpadding=2 cellspacing=0>
<tbody><tr>
<th scope="col">Parameter</th>
<th scope="col">Description</th>
<th scope="col">Example</th>
</tr>
<tr>
<td valign="top">PRODUCT_NAME</td>
<td valign="top">End-user-visible name for the overall product. Appears in the "About the phone" info.</td>
<td valign="top"></td>
</tr>
<tr>
<td valign="top">PRODUCT_MODEL</td>
<td valign="top">End-user-visible name for the end product</td>
<td valign="top"></td>
</tr>
<tr>
<td valign="top">PRODUCT_LOCALES</td>
<td valign="top">A space-separated list of two-letter language code, two-letter country code pairs that describe several settings for the user, such as the UI language and time, date and currency formatting. The first locale listed in PRODUCT_LOCALES is is used if the locale has never been set before.</td>
<td valign="top"><code>en_GB de_DE es_ES fr_CA</code></td>
</tr>
<tr>
<td valign="top">PRODUCT_PACKAGES</td>
<td valign="top">Lists the APKs to install.</td>
<td valign="top"><code>Calendar Contacts</code></td>
</tr>
<tr>
<td valign="top">PRODUCT_DEVICE</td>
<td valign="top">Name of the industrial design</td>
<td valign="top"><code>dream</code></td>
</tr>
<tr>
<td valign="top">PRODUCT_MANUFACTURER</td>
<td valign="top">Name of the manufacturer</td>
<td valign="top"><code>acme</code></td>
</tr>
<tr>
<td valign="top">PRODUCT_BRAND</td>
<td valign="top">The brand (e.g., carrier) the software is customized for, if any</td>
<td valign="top"></td>
</tr>
<tr>
<td valign="top">PRODUCT_PROPERTY_OVERRIDES</td>
<td valign="top">List of property assignments in the format "key=value"</td>
<td valign="top"></td>
</tr>
<tr>
<td valign="top">PRODUCT_COPY_FILES</td>
<td valign="top">List of words like <code>source_path:destination_path</code>. The file at the source path should be copied to the destination path when building this product. The rules for the copy steps are defined in config/Makefile</td>
<td valign="top"></td>
</tr>
<tr>
<td valign="top">PRODUCT_OTA_PUBLIC_KEYS</td>
<td valign="top">List of OTA public keys for the product</td>
<td valign="top"></td>
</tr>
<tr>
<td valign="top">PRODUCT_POLICY</td>
<td valign="top">Indicate which policy this product should use</td>
<td valign="top"></td>
</tr>
<tr>
<td valign="top">PRODUCT_PACKAGE_OVERLAYS</td>
<td valign="top">Indicate whether to use default resources or add any product specific overlays</td>
<td valign="top"><code>vendor/acme/overlay</code></td>
</tr>
<tr>
<td valign="top">PRODUCT_CONTRIBUTORS_FILE</td>
<td valign="top">HTML file containing the contributors to the project.</td>
<td valign="top"></td>
</tr>
<tr>
<td valign="top">PRODUCT_TAGS</td>
<td valign="top">list of space-separated words for a given product</td>
<td valign="top"></td>
</tr>
<tr>
<td valign="top">PRODUCT_SDK_ADDON_NAME</td>
<td valign="top"></td>
<td valign="top"></td>
</tr>
<tr>
<td valign="top">PRODUCT_SDK_ADDON_COPY_FILES</td>
<td valign="top"></td>
<td valign="top"></td>
</tr>
<tr>
<td valign="top">PRODUCT_SDK_ADDON_COPY_MODULES</td>
<td valign="top"></td>
<td valign="top"></td>
</tr>
<tr>
<td valign="top">PRODUCT_SDK_ADDON_DOC_MODULE</td>
<td valign="top"></td>
<td valign="top"></td>
</tr>
</table>
</P>
<p>The snippet below illustrates a typical product definition file.</p>
<pre class="prettyprint">
$(call inherit-product, build/target/product/generic.mk)
#Overrides
PRODUCT_NAME := MyDevice
PRODUCT_MANUFACTURER := acme
PRODUCT_BRAND := acme_us
PRODUCT_LOCALES := en_GB es_ES fr_FR
PRODUCT_PACKAGE_OVERLAYS := vendor/acme/overlay
</pre>
<a name="androidBuildVariants"></a><h2>Build Variants</h2>
<p>
When building for a particular product, it's often useful to have minor
variations on what is ultimately the final release build. These are the
currently-defined build variants:
</p>
<table border=1>
<tr>
<td>
<code>eng<code>
</td>
<td>
This is the default flavor. A plain "<code>make</code>" is the
same as "<code>make eng</code>". <code>droid</code> is an alias
for <code>eng</code>.
<ul>
<li>Installs modules tagged with: <code>eng</code>, <code>debug</code>,
<code>user</code>, and/or <code>development</code>.
<li>Installs non-APK modules that have no tags specified.
<li>Installs APKs according to the product definition files, in
addition to tagged APKs.
<li><code>ro.secure=0</code>
<li><code>ro.debuggable=1</code>
<li><code>ro.kernel.android.checkjni=1</code>
<li><code>adb</code> is enabled by default.
</td>
</tr>
<tr>
<td>
<code>user<code>
</td>
<td>
"<code>make user</code>"
<p>
This is the flavor intended to be the final release bits.
<ul>
<li>Installs modules tagged with <code>user</code>.
<li>Installs non-APK modules that have no tags specified.
<li>Installs APKs according to the product definition files; tags
are ignored for APK modules.
<li><code>ro.secure=1</code>
<li><code>ro.debuggable=0</code>
<li><code>adb</code> is disabled by default.
</td>
</tr>
<tr>
<td>
<code>userdebug<code>
</td>
<td>
"<code>make userdebug</code>"
<p>
The same as <code>user</code>, except:
<ul>
<li>Also installs modules tagged with <code>debug</code>.
<li><code>ro.debuggable=1</code>
<li><code>adb</code> is enabled by default.
</td>
</tr>
</table>
<p>
If you build one flavor and then want to build another, you should run
"<code>make installclean</code>" between the two makes to guarantee that
you don't pick up files installed by the previous flavor. "<code>make
clean</code>" will also suffice, but it takes a lot longer.
</p>

View File

@@ -10,7 +10,6 @@ pdk.version=1.0
<a href="#androidBuildSystemOverview">Understanding the makefile</a><br/> <a href="#androidBuildSystemOverview">Understanding the makefile</a><br/>
<a href="#androidBuildSystemLayers">Layers</a><br/> <a href="#androidBuildSystemLayers">Layers</a><br/>
<a href="#androidBuildSystemProductDefFiles">Product Definition Files</a><br/></div>
<a href="#androidSourceSetupBuildingCodeBase">Building the Android Platform</a><br/><div style="padding-left:40px"> <a href="#androidSourceSetupBuildingCodeBase">Building the Android Platform</a><br/><div style="padding-left:40px">
<a href="#androidSourceSetupBuildingDeviceCodeBase">Device Code</a><br/> <a href="#androidSourceSetupBuildingDeviceCodeBase">Device Code</a><br/>
@@ -31,8 +30,6 @@ pdk.version=1.0
<a name="androidBuildSystemUnderstanding"></a><h2>Understanding Android's Build System</h2> <a name="androidBuildSystemUnderstanding"></a><h2>Understanding Android's Build System</h2>
<a name="androidBuildSystemOverview"></a><h3>Understanding the makefile</h3> <a name="androidBuildSystemOverview"></a><h3>Understanding the makefile</h3>
<p>A makefile defines how to build a particular application. Makefiles typically include all of the following elements:</p> <p>A makefile defines how to build a particular application. Makefiles typically include all of the following elements:</p>
@@ -95,38 +92,6 @@ include $(BUILD_EXECUTABLE)
</tr> </tr>
</table> </table>
<a name="androidBuildSystemProductDefFiles"></a><h3>Product Definition Files</h3>
<p>Product-specific variables are defined in product definition files. A product definition file can inherit from other product definition files, thus reducing the need to copy and simplifying maintenance.</p>
<p>Variables maintained in a product definition files include:</p>
<p><ul>
<li><code>PRODUCT_DEVICE</code></LI>
<LI><code>LOCALES</code></LI>
<LI><code>BRANDING_PARTNER</code></LI>
<LI><code>PROPERTY_OVERRIDES</code></LI>
</UL>
</P>
<p>The snippet below illustrates a typical product definition file.</p>
<PRE class="prettyprint">
//device/target/product/core.mk
PRODUCT_PACKAGES := Home SettingsProvider ...
//device/target/product/generic.mk
PRODUCT_PACKAGES := Calendar Camera SyncProvider ...
$(call inherit-product, target/product/core.mk)
PRODUCT_NAME := generic
//device/partner/google/products/core.mk
PRODUCT_PACKAGES := Maps GoogleAppsProvider ...
$(call inherit-product, target/product/core.mk)
//device/partner/google/products/generic.mk
PRODUCT_PACKAGES := Gmail GmailProvider ...
$(call inherit-product, partner/google/products/core.mk)
$(call inherit-product, target/product/generic.mk)
PRODUCT_NAME := google_generic
</pre>
<a name="androidSourceSetupBuildingCodeBase"></a><h2>Building the Android Platform</h2> <a name="androidSourceSetupBuildingCodeBase"></a><h2>Building the Android Platform</h2>
<p>This section describes how to build the default version of Android. Once you are comfortable with a generic build, then you can begin to modify Android for your own target device.</p> <p>This section describes how to build the default version of Android. Once you are comfortable with a generic build, then you can begin to modify Android for your own target device.</p>

View File

@@ -56,6 +56,7 @@ function nothing() {}
<li><a href="<?cs var:toroot ?>guide/early_suspend.html">Early Suspend</a></li> <li><a href="<?cs var:toroot ?>guide/early_suspend.html">Early Suspend</a></li>
</ul> </ul>
</li> </li>
<li><a href="<?cs var:toroot ?>guide/sensors.html">Sensors</a></li>
<li class="toggle-list"> <li class="toggle-list">
<div><a href="javascript:nothing()">Telephony</a></div> <div><a href="javascript:nothing()">Telephony</a></div>
<ul> <ul>