|
Configuring a New Product In this document
|
bet | 12/95 | Sana | 22.12.2019 | Hajmi | 1.28 Mb. | | #4580 |
In this document Detailed Instructions
The steps below describe how to configure makefiles for new mobile devices and products running Android.
Create a company directory in //vendor/.
mkdir vendor/
Create a products directory beneath the company directory you created in step 1.
mkdir vendor//products/
Create a product-specific makefile, called vendor//products/.mk, that includes at least the following code:
$(call inherit-product, $(SRC_TARGET_DIR)/product/generic.mk)
#
# Overrides
PRODUCT_NAME :=
PRODUCT_DEVICE :=
Additional product-specific variables can be added to this Product Definition file.
In the products directory, create an AndroidProducts.mk file that point to (and is responsible for finding) the individual product make files.
#
# This file should set PRODUCT_MAKEFILES to a list of product makefiles
# to expose to the build system. LOCAL_DIR will already be set to
# the directory containing this file.
#
# This file may not rely on the value of any variable other than
# LOCAL_DIR; do not use any conditionals, and do not look up the
# value of any variable that isn't set in this file or in a file that
# it includes.
#
PRODUCT_MAKEFILES := \
$(LOCAL_DIR)/first_product_name.mk \
Create a board-specific directory beneath your company directory that matches the PRODUCT_DEVICE variable referenced in the product-specific make file above. This will include a make file that gets accessed by any product using this board.
mkdir vendor//
Create a BoardConfig.mk file in the directory created in the previous step (vendor//).
# These definitions override the defaults in config/config.make for
#
# TARGET_NO_BOOTLOADER := false
# TARGET_HARDWARE_3D := false
#
TARGET_USE_GENERIC_AUDIO := true
If you wish to modify system properties, create a system.prop file in your directory(vendor//).
# system.prop for
# This overrides settings in the products/generic/system.prop file
#
# rild.libpath=/system/lib/libreference-ril.so
# rild.libargs=-d /dev/ttyS0
Add a pointer to .mk within products/AndroidProducts.mk.
PRODUCT_MAKEFILES := \
$(LOCAL_DIR)/first_product_name.mk \
$(LOCAL_DIR)/second_product_name.mk
An Android.mk file must be included in vendor// with at least the following code:
# make file for new hardware from
#
LOCAL_PATH := $(call my-dir)
#
# this is here to use the pre-built kernel
ifeq ($(TARGET_PREBUILT_KERNEL),)
TARGET_PREBUILT_KERNEL := $(LOCAL_PATH)/kernel
endif
#
file := $(INSTALLED_KERNEL_TARGET)
ALL_PREBUILT += $(file)
$(file): $(TARGET_PREBUILT_KERNEL) | $(ACP)
$(transform-prebuilt-to-target)
#
# no boot loader, so we don't need any of that stuff..
#
LOCAL_PATH := vendor//
#
include $(CLEAR_VARS)
#
# include more board specific stuff here? Such as Audio parameters.
#
To create a second product for the same board, create a second product-specific make file called vendor/company_name/products/.mk that includes:
$(call inherit-product, $(SRC_TARGET_DIR)/product/generic.mk)
#
# Overrides
PRODUCT_NAME :=
PRODUCT_DEVICE :=
By now, you should have two new products, called and associated with . To verify that a product is properly configured (, for example), execute the following:
. build/envsetup.sh
make PRODUCT--user
You should find new build binaries located in /out/target/product/.
|
| |