Android full source 를 빌드할 때, 새로운 product 를 추가하는 과정을 정리했습니다.


1. verder 디렉토리에 company 디렉토리 생성

  mkdir vendor/<company_name>


2. products 디렉토리 생성

  mkdir vendor/<company_name>/products/


3. product 스팩 makefile 생성, vendor/<company_name>/products/<product_name>.mk

  product_name.mk 은 다음 내용을 포함해야 합니다.

  $(call inherit-product, $(SRC_TARGET_DIR)/product/generic.mk)
  #
  # Overrides
  PRODUCT_NAME := <first_product_name>
  PRODUCT_DEVICE := <board_name>


   그 외, 스팩은 다음과 같은 형식으로 추가 할수 있습니다.

ParameterDescriptionExample
PRODUCT_NAMEEnd-user-visible name for the overall product. Appears in the "About the phone" info.
PRODUCT_MODELEnd-user-visible name for the end product
PRODUCT_LOCALESA 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.en_GB de_DE es_ES fr_CA
PRODUCT_PACKAGESLists the APKs to install.Calendar Contacts
PRODUCT_DEVICEName of the industrial designdream
PRODUCT_MANUFACTURERName of the manufactureracme
PRODUCT_BRANDThe brand (e.g., carrier) the software is customized for, if any
PRODUCT_PROPERTY_OVERRIDESList of property assignments in the format "key=value"
PRODUCT_COPY_FILESList of words like source_path:destination_path. 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
PRODUCT_OTA_PUBLIC_KEYSList of OTA public keys for the product
PRODUCT_POLICYIndicate which policy this product should use
PRODUCT_PACKAGE_OVERLAYSIndicate whether to use default resources or add any product specific overlaysvendor/acme/overlay
PRODUCT_CONTRIBUTORS_FILEHTML file containing the contributors to the project.
PRODUCT_TAGSlist of space-separated words for a given product


4. products 디렉토리에 AndroidProduct.mk 파일 생성.

    이 파일에서 product_name.mk 을 지정해야 합니다.

  #
  # 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)/product_name.mk \




* 다음 편에서 계속 됩니다...