- add a file AndroidProducts.mk
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
modify “first_product_name.mk” to “hawkboard.mk”
- Create a product-specific makefile, called vendor/<company_name>/products/<first_product_name>.mk, that includes at least the following code:
$(call inherit-product, $(SRC_TARGET_DIR)/product/generic.mk)
#
# Overrides
PRODUCT_NAME := <first_product_name>
PRODUCT_DEVICE := <board_name>
example: create hawkboard.mk in “vendor/ti/hawkboard” directory.
- Create a board-specific directory beneath your company directory that matches the PRODUCT_DEVICE variable <board_name> 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/<company_name>/<board_name> - Create a BoardConfig.mk file in the directory created in the previous step (vendor/<company_name>/<board_name>).
# These definitions override the defaults in config/config.make for <board_name>
#
# TARGET_NO_BOOTLOADER := false
# TARGET_HARDWARE_3D := false
#
TARGET_USE_GENERIC_AUDIO := true
4.
Adding a board to android build
=====================
- cd vendor/ti ; mkdir hawkboard
- make TARGET_PRODUCT=hawkboard
following error comes,
build/core/product_config.mk:173: *** No matches for product “hawkboard”. Stop.
- cd vendor/ti; cp beagleboard/AndroidProducts.mk hawkboard/
error:
sudo make TARGET_PRODUCT=hawkboard
build/core/product_config.mk:165: *** _nic.PRODUCTS.[[vendor/ti/hawkboard/beagleboard.mk]]: “vendor/ti/hawkboard/beagleboard.mk” does not exist. Stop
edit: hawkboard/AndroidProducts.mk
PRODUCT_MAKEFILES :=
$(LOCAL_DIR)/beagleboard.mk
to
PRODUCT_MAKEFILES :=
$(LOCAL_DIR)/hawkboard.mk
- take beagleboard.mk as a reference.
cp beagleboard/beagleboard.mk hawkboard/hawkboard.mk
error:
sudo make TARGET_PRODUCT=hawkboard
build/core/product_config.mk:166: *** vendor/ti/hawkboard/hawkboard.mk: PRODUCT_NAME must be unique; “beagleboard” already used by vendor/ti/beagleboard/beagleboard.mk vendor/ti/hawkboard/hawkboard.mk . Stop.
edit: hawkboard/hawkboard.mk to
PRODUCT_PACKAGES :=
SoundRecorder
$(call inherit-product, build/target/product/rowboat.mk)
# Overrides
PRODUCT_BRAND := TI
PRODUCT_NAME := hawkboard
PRODUCT_DEVICE := hawkboard
PRODUCT_PACKAGE_OVERLAYS := vendor/rowboat/generic
error:
sudo make TARGET_PRODUCT=hawkboard
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=2.1-update1
TARGET_PRODUCT=hawkboard
TARGET_BUILD_VARIANT=eng
TARGET_SIMULATOR=
TARGET_BUILD_TYPE=release
TARGET_ARCH=arm
HOST_ARCH=x86
HOST_OS=linux
HOST_BUILD_TYPE=release
BUILD_ID=ECLAIR
============================================
build/core/config.mk:126: *** No config file found for TARGET_DEVICE hawkboard. Stop.
- take beagleboard/BoardConfig.mk as a reference,
cp beagleboard/BoardConfig.mk hawkboard/
error:
sudo make TARGET_PRODUCT=hawkboard
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=2.1-update1
TARGET_PRODUCT=hawkboard
TARGET_BUILD_VARIANT=eng
TARGET_SIMULATOR=
TARGET_BUILD_TYPE=release
TARGET_ARCH=arm
HOST_ARCH=x86
HOST_OS=linux
HOST_BUILD_TYPE=release
BUILD_ID=ECLAIR
============================================
build/target/board/Android.mk:28: *** Missing “vendor/ti/hawkboard/AndroidBoard.mk”. Stop.
- take beagleboard/AndroidBoard.mk as a reference
cp beagleboard/AndroidBoard.mk hawkboard/
================================================================
modify top Makefile (i.e. android_src/Makefile) to add
ifeq ($(TARGET_PRODUCT), hawkboard)
make -C kernel ARCH=arm omap3_beagle_android_defconfig
endif
for compiling kernel
sudo make TARGET_PRODUCT=hawkboard TARGET_PREBUILT_KERNEL=path_to_kernel/kernel
===================================
- mkdir vendor/myvendor
- mkdir vendor/myvendor/products/
- touch vendor/myvendor/products/hawkboard.mk
edit hawkboard.mk for adding
$(call inherit-product, build/target/product/generic.mk)
# Overrides
PRODUCT_NAME := hawkboard
PRODUCT_DEVICE := hawkboard
- touch vendor/myvendor/products/AndroidProducts.mk
edit AndroidProducts.mk for
PRODUCT_MAKEFILES :=
$(LOCAL_DIR)/hawkboard.mk
- mkdir vendor/myvendor/hawkboard
- Create a BoardConfig.mk file in the directory created in the previous step (vendor/myvendor/hawkboard).
# These definitions override the defaults in config/config.make for <board_name>
#
# TARGET_NO_BOOTLOADER := false
# TARGET_HARDWARE_3D := false
#
TARGET_USE_GENERIC_AUDIO := true
- create AndroidBoard.mk in directory “vendor/myvendor/hawkboard/AndroidBoard.mk”