Merge change 3933 into donut

* changes:
  - Moved the build variants descriptions into build_system - Added Makefile stub into sensors.jd as a starting point - Small cleanup to build_new_device to reference the PRODUCT_* parameters - Fixed URL in the README for app engine testing
This commit is contained in:
Android (Google) Code Review
2009-06-12 15:44:23 -07:00
4 changed files with 106 additions and 80 deletions

View File

@@ -58,9 +58,9 @@ Here's the command to run the pdk-docs server locally:
python <path_to_appengine_installation>/dev_appserver.py --address 0.0.0.0 \ python <path_to_appengine_installation>/dev_appserver.py --address 0.0.0.0 \
<path_to_cupcake_code>/android/out/target/common/docs <path_to_cupcake_code>/android/out/target/common/docs
To verify it is working you can access it with a browser loacally on port 8080: To verify it is working you can access it with a browser locally on port 8080:
http://localhost:8080/index.html http://localhost:8080/online-pdk/guide/index.html
NOTE: If you are trying to get to the appengine local testing instance remotely NOTE: If you are trying to get to the appengine local testing instance remotely
you will have to ssh tunnel into your linux box as appengine only serves the web you will have to ssh tunnel into your linux box as appengine only serves the web

View File

@@ -11,6 +11,7 @@ pdk.version=1.0
<ul> <ul>
<li><a href="#androidOHDPortingDeviceBuildingProcess">Detailed Instructions</a></li> <li><a href="#androidOHDPortingDeviceBuildingProcess">Detailed Instructions</a></li>
<li><a href="#androidBuildNewFileTree">New Product File Tree</a></li> <li><a href="#androidBuildNewFileTree">New Product File Tree</a></li>
<li><a href="#androidBuildSystemProductDefFiles">Product Definition Files</a></li>
</ul> </ul>
</div> </div>
</div> </div>
@@ -18,7 +19,7 @@ pdk.version=1.0
<a name="androidOHDPortingDeviceBuildingProcess"></a><h3>Detailed Instructions</h3> <a name="androidOHDPortingDeviceBuildingProcess"></a><h3>Detailed Instructions</h3>
<p>The directions below describe how to configure make files for new mobile devices and products.</p> <p>The steps below describe how to configure makefiles for new mobile devices and products running Android.</p>
<ol> <ol>
<li>Create a company directory in <code>//vendor/</code>.<br/> <li>Create a company directory in <code>//vendor/</code>.<br/>
<pre class="prettyprint"> <pre class="prettyprint">
@@ -26,13 +27,15 @@ pdk.version=1.0
<li>Create a <code>products</code> directory beneath the company directory you created in step 1.<BR> <li>Create a <code>products</code> directory beneath the company directory you created in step 1.<BR>
<pre class="prettyprint"> <pre class="prettyprint">
mkdir vendor/&lt;company_name&gt;/products/</pre></li> mkdir vendor/&lt;company_name&gt;/products/</pre></li>
<li>Create a product-specific make file, called <code>vendor/&lt;company_name&gt;/products/&lt;first_product_name&gt;.mk</code>, that includes the following code:<BR> <li>Create a product-specific makefile, called <code>vendor/&lt;company_name&gt;/products/&lt;first_product_name&gt;.mk</code>, that includes at least the following code:<BR>
<pre class="prettyprint"> <pre class="prettyprint">
$(call inherit-product, $(SRC_TARGET_DIR)/product/generic.mk) $(call inherit-product, $(SRC_TARGET_DIR)/product/generic.mk)
# #
# Overrides # Overrides
PRODUCT_NAME := &lt;first_product_name&gt; PRODUCT_NAME := &lt;first_product_name&gt;
PRODUCT_DEVICE := &lt;board_name&gt;</pre></li> PRODUCT_DEVICE := &lt;board_name&gt;</pre>
Additional product-specific variables can be added to this <a href="#androidBuildSystemProductDefFiles">Product Definition</a> file.
</li>
<li>In the <code>products</code> directory, create an <code>AndroidProducts.mk</code> file that point to (and is responsible for finding) the individual product make files.<BR> <li>In the <code>products</code> directory, create an <code>AndroidProducts.mk</code> file that point to (and is responsible for finding) the individual product make files.<BR>
<pre class="prettypring"> <pre class="prettypring">
# #
@@ -51,7 +54,7 @@ pdk.version=1.0
<li>Create a board-specific directory beneath your company directory that matches the <code>PRODUCT_DEVICE</code> variable <code>&lt;board_name&gt;</code> referenced in the product-specific make file above. This will include a make file that gets accessed by any product using this board.<BR> <li>Create a board-specific directory beneath your company directory that matches the <code>PRODUCT_DEVICE</code> variable <code>&lt;board_name&gt;</code> referenced in the product-specific make file above. This will include a make file that gets accessed by any product using this board.<BR>
<pre class="prettyprint"> <pre class="prettyprint">
mkdir vendor/&lt;company_name&gt;/&lt;board_name&gt;</pre></li> mkdir vendor/&lt;company_name&gt;/&lt;board_name&gt;</pre></li>
<li>Create a <code>product_config.mk</code> file in the directory created in the previous step (<code>vendor/&lt;company_name&gt;/&lt;board_name&gt;</code>). If this directory does not include a <code>product_config.mk</code> file, the build will fail.<BR> <li>Create a <code>BoardConfig.mk</code> file in the directory created in the previous step (<code>vendor/&lt;company_name&gt;/&lt;board_name&gt;</code>). <BR>
<pre class="prettyprint"> <pre class="prettyprint">
# These definitions override the defaults in config/config.make for &lt;board_name&gt; # These definitions override the defaults in config/config.make for &lt;board_name&gt;
# #
@@ -71,7 +74,7 @@ pdk.version=1.0
PRODUCT_MAKEFILES := \ PRODUCT_MAKEFILES := \
$(LOCAL_DIR)/first_product_name.mk \ $(LOCAL_DIR)/first_product_name.mk \
$(LOCAL_DIR)/second_product_name.mk</pre></li> $(LOCAL_DIR)/second_product_name.mk</pre></li>
<li><code>vendor/&lt;company_name&gt;/&lt;board_name&gt;</code> must include an <code>Android.mk</code> file with at least the following code:<BR><BR> <li>An <code>Android.mk</code> file must be included in <code>vendor/&lt;company_name&gt;/&lt;board_name&gt;</code> with at least the following code:<BR>
<pre class="prettyprint"> <pre class="prettyprint">
# make file for new hardware <board_name> from <company_name> # make file for new hardware <board_name> from <company_name>
# #
@@ -94,7 +97,10 @@ pdk.version=1.0
include $(CLEAR_VARS) include $(CLEAR_VARS)
# #
# include more board specific stuff here? Such as Audio parameters. # include more board specific stuff here? Such as Audio parameters.
#</pre></li> #</pre>
Additional Android.mk parameters
</li>
<li>To create a second product for the same board, create a second product-specific make file called <code>vendor/company_name/products/&lt;second_product_name&gt;.mk</code> that includes:<BR> <li>To create a second product for the same board, create a second product-specific make file called <code>vendor/company_name/products/&lt;second_product_name&gt;.mk</code> that includes:<BR>
<pre class="prettyprint"> <pre class="prettyprint">
$(call inherit-product, $(SRC_TARGET_DIR)/product/generic.mk) $(call inherit-product, $(SRC_TARGET_DIR)/product/generic.mk)
@@ -231,73 +237,4 @@ PRODUCT_PACKAGE_OVERLAYS := vendor/acme/overlay
</pre> </pre>
<a name="androidBuildVariants"></a><h3>Build Variants</h3>
<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

@@ -12,6 +12,7 @@ pdk.version=1.0
<li><a href="#androidBuildSystemLayers">Layers</a></li> <li><a href="#androidBuildSystemLayers">Layers</a></li>
<li><a href="#androidSourceSetupBuildingCodeBase">Building the Android Platform</a></li> <li><a href="#androidSourceSetupBuildingCodeBase">Building the Android Platform</a></li>
<li><a href="#androidSourceSetupBuildingKernel">Building the Android Kernel</a></li> <li><a href="#androidSourceSetupBuildingKernel">Building the Android Kernel</a></li>
<li><a href="#androidBuildVariants">Build Variants</a></li>
</ul> </ul>
</div> </div>
</div> </div>
@@ -108,6 +109,8 @@ include $(BUILD_EXECUTABLE)
% make -j4 PRODUCT-generic-eng % make -j4 PRODUCT-generic-eng
</pre> </pre>
<p>These <a href="#androidBuildVariants">Build Variants</a> differ in terms of debug options and packages installed.
<a name="androidBuildingCleaning"></a><h4>Cleaning Up</h4> <a name="androidBuildingCleaning"></a><h4>Cleaning Up</h4>
@@ -194,4 +197,73 @@ Java HotSpot(TM) Client VM (build 1.5.0_07-87, mixed mode, sharing)
<p>To build the kernel, execute:</p> <p>To build the kernel, execute:</p>
<pre class="prettyprint"> <pre class="prettyprint">
% make -j4 % make -j4
</pre> </pre>
<a name="androidBuildVariants"></a><h3>Build Variants</h3>
<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>".
<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>
<li>Installs non-APK modules that have no tags specified.</li>
<li>Installs APKs according to the product definition files; tags
are ignored for APK modules.</li>
<li><code>ro.secure=1</code> </li>
<li><code>ro.debuggable=0</code> </li>
<li><code>adb</code> is disabled by default.</li>
</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

@@ -32,13 +32,30 @@ The types of sensors currently supported by Android include:
<a name="androidSensorBuildingDriver"></a><h3>Building a Sensor Library</h3> <a name="androidSensorBuildingDriver"></a><h3>Building a Sensor Library</h3>
<p> To implement a Sensors driver, create a shared library that implements the interface defined in <code>sensors.h</code>. You must name your shared library <p> To implement a Sensors driver, create a shared library that implements the interface defined in <code>sensors.h</code>. You must name your shared library
<code>libsensors.so</code> so that it will get loaded from <code>/system/lib</code> at runtime. <code>libsensors.so</code> so that it will get loaded from <code>/system/lib</code> at runtime.
</p </p>
<p> The following stub <code>Android.mk</code> file ensures that <code>libsensors</code> compiles and links to the appropriate libraries:</p>
<pre>
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := sensors
LOCAL_PRELINK_MODULE := false
LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw
LOCAL_SHARED_LIBRARIES := liblog
# include any shared library dependencies
LOCAL_SRC_FILES := sensors.c
include $(BUILD_SHARED_LIBRARY)
</pre>
<a name="androidSensorsInterface"></a><h3>Interface</h3> <a name="androidSensorsInterface"></a><h3>Interface</h3>
<p><span class="lh3"><a name="androidDoxygenNote"></a></span> <p><span class="lh3"><a name="androidDoxygenNote"></a></span>
<p class="note"><strong>Note</strong>: This document relies on some Doxygen-generated content that appears in an iFrame below. To return to the Doxygen default content for this page, <a href="sensors.html">click here</a>.</p> <p class="note"><strong>Note</strong>: This document relies on some Doxygen-generated content that appears in an iFrame below. To return to the Doxygen default content for this page, <a href="sensors.html">click here</a>.</p>