1. source build/envsetup.sh
2. lunch
3. make
20# A list of goals which affect parsing of makefiles and we need to pass to Kati. 21PARSE_TIME_MAKE_GOALS := \ 22 $(PARSE_TIME_MAKE_GOALS) \ 23 $(dont_bother_goals) \ 24 all \ 25 APP-% \ 26 DUMP_% \ 27 ECLIPSE-% \ 28 PRODUCT-% \ 29 boottarball-nodeps \ 30 btnod \ 31 build-art% \ 32 build_kernel-nodeps \ 33 clean-oat% \ 34 continuous_instrumentation_tests \ 35 continuous_native_tests \ 36 cts \ 37 custom_images \ 38 deps-license \ 39 dicttool_aosp \ 40 dist \ 41 dump-products \ 42 dumpvar-% \ 43 eng \ 44 fusion \ 45 oem_image \ 46 old-cts \ 47 online-system-api-sdk-docs \ 48 pdk \ 49 platform \ 50 platform-java \ 51 product-graph \ 52 samplecode \ 53 sdk \ 54 sdk_addon \ 55 sdk_repo \ 56 snod \ 57 stnod \ 58 systemimage-nodeps \ 59 systemtarball-nodeps \ 60 target-files-package \ 61 test-art% \ 62 user \ 63 userdataimage \ 64 userdebug \ 65 valgrind-test-art% \ 66 vts \ 67 win_sdk \ 68 winsdk-tools
Invoke ". build/envsetup.sh" from your shell to add the following functions to your environment:
- lunch: lunch <product_name>-<build_variant>
- tapas: tapas [<App1> <App2> ...] [arm|x86|mips|armv5|arm64|x86_64|mips64] [eng|userdebug|user]
- croot: Changes directory to the top of the tree.
- m: Makes from the top of the tree.
- mm: Builds all of the modules in the current directory, but not their dependencies.
- mmm: Builds all of the modules in the supplied directories, but not their dependencies.
To limit the modules being built use the syntax: mmm dir/:target1,target2.
- mma: Builds all of the modules in the current directory, and their dependencies.
- mmma: Builds all of the modules in the supplied directories, and their dependencies.
- cgrep: Greps on all local C/C++ files.
- ggrep: Greps on all local Gradle files.
- jgrep: Greps on all local Java files.
- resgrep: Greps on all local res/*.xml files.
- sgrep: Greps on all local source files.
- godir: Go to the directory containing a file.
Look at the source to view more functions. The complete list is:
adb_get_product_device adb_get_traced_by addcompletions add_def_config add_lunch_combo add_target_product_mapping cgrep check_configuration check_product check_variant choosecombo chooseconfiguration chooseproduct choosetype choosevariant config_commit_template core coredump_enable coredump_setup cproj croot findmakefile gdbclient gdbclient_old gdbwrapper get_abs_build_var getbugreports get_build_var get_configuration_choices get_def_config getdriver getlastscreenshot get_make_command getprebuilt getscreenshotpath getsdcardpath get_symbols_directory gettargetarch gettop ggrep godir hmm is isviewserverstarted jgrep key_back key_home key_menu lunch _lunch m make mangrep map_target_product mgrep mm mma mmm mmma pez pid printconfig print_lunch_menu qpid resgrep runhat runtest sepgrep set_java_home setpaths set_sequence_number set_stuff_for_environment settitle sgrep smoketest stacks startviewserver stopviewserver systemstack tapas tracedmdump treegrep
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=5.1.1
TARGET_PRODUCT=eanab
TARGET_BUILD_VARIANT=userdebug
TARGET_BUILD_CONFIGURATION=e3os
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a-neon
TARGET_CPU_VARIANT=cortex-a9
TARGET_2ND_ARCH=
TARGET_2ND_ARCH_VARIANT=
TARGET_2ND_CPU_VARIANT=
HOST_ARCH=x86_64
HOST_OS=linux
HOST_OS_EXTRA=Linux-3.13.0-117-generic-x86_64-with-Ubuntu-12.04-precise
HOST_BUILD_TYPE=release
BUILD_ID=2.1.0-ga-rc3
OUT_DIR=out
============================================
You're building on Linux
Lunch menu... pick a combo:
1. aosp_arm-eng
2. aosp_arm64-eng
3. aosp_mips-eng
4. aosp_mips64-eng
5. aosp_x86-eng
6. aosp_x86_64-eng
7. aosp_shamu-userdebug
8. mini_emulator_mips-userdebug
9. mini_emulator_x86-userdebug
==== device/company/suez/MyDevice.mk ====
PRODUCTS.device/company/suez/MyDevice.mk.PRODUCT_NAME := suez
PRODUCTS.device/company/suez/MyDevice.mk.PRODUCT_MODEL := KFSUWI
PRODUCTS.device/company/suez/MyDevice.mk.PRODUCT_LOCALES := en_US zh_CN zh_TW es_ES pt_BR ru_RU fr_FR de_DE tr_TR vi_VN ms_MY in_ID th_TH it_IT ar_EG hi_IN bn_IN ur_PK fa_IR pt_PT nl_NL el_GR hu_HU tl_PH ro_RO cs_CZ ko_KR km_KH iw_IL my_MM pl_PL es_US bg_BG hr_HR lv_LV lt_LT sk_SK uk_UA de_AT da_DK fi_FI nb_NO sv_SE en_GB hy_AM zh_HK et_EE ja_JP kk_KZ sr_RS sl_SI ca_ES
PRODUCTS.device/company/suez/MyDevice.mk.PRODUCT_AAPT_CONFIG := normal large xlarge
PRODUCTS.device/company/suez/MyDevice.mk.PRODUCT_AAPT_PREF_CONFIG := hdpi
PRODUCTS.device/company/suez/MyDevice.mk.PRODUCT_AAPT_PREBUILT_DPI :=
PRODUCTS.device/company/suez/MyDevice.mk.PRODUCT_PACKAGES := libfwdlockengine ...............
PRODUCTS.device/company/suez/MyDevice.mk.PRODUCT_PACKAGES_DEBUG :=
PRODUCTS.device/company/suez/MyDevice.mk.PRODUCT_PACKAGES_ENG :=
PRODUCTS.device/company/suez/MyDevice.mk.PRODUCT_PACKAGES_TESTS :=
PRODUCTS.device/company/suez/MyDevice.mk.PRODUCT_DEVICE := suez
PRODUCTS.device/company/suez/MyDevice.mk.PRODUCT_MANUFACTURER := company
PRODUCTS.device/company/suez/MyDevice.mk.PRODUCT_BRAND := company
PRODUCTS.device/company/suez/MyDevice.mk.PRODUCT_PROPERTY_OVERRIDES := ro.com.android.dateformat=MM-dd-yyyy ro.config.ringtone=Ring_Synth_04.ogg ......
PRODUCTS.device/company/suez/MyDevice.mk.PRODUCT_DEFAULT_PROPERTY_OVERRIDES := ro.zygote=zygote32 persist.sys.usb.config=mtp ro.mount.fs=EXT4 camera.disable_zsl_mode=1
PRODUCTS.device/company/suez/MyDevice.mk.PRODUCT_CHARACTERISTICS := tablet
PRODUCTS.device/company/suez/MyDevice.mk.PRODUCT_COPY_FILES := frameworks/base/data/sounds/Alarm_Beep_01.ogg:system/media/audio/alarms/Alarm_Beep_01.ogg .................
PRODUCTS.device/company/suez/MyDevice.mk.PRODUCT_OTA_PUBLIC_KEYS :=
PRODUCTS.device/company/suez/MyDevice.mk.PRODUCT_EXTRA_RECOVERY_KEYS :=
PRODUCTS.device/company/suez/MyDevice.mk.PRODUCT_PACKAGE_OVERLAYS := device/company/myName/overlay/specify MyName/base/overlays/common .............
PRODUCTS.device/company/suez/MyDevice.mk.DEVICE_PACKAGE_OVERLAYS := Myname/prebuilts/middleware/FluidSupportLibrary/prebuilts/external/fluid-overlay device/company/MyDevice/overlay .....................
PRODUCTS.device/company/suez/MyDevice.mk.PRODUCT_TAGS :=
PRODUCTS.device/company/suez/MyDevice.mk.PRODUCT_SDK_ATREE_FILES :=
PRODUCTS.device/company/suez/MyDevice.mk.PRODUCT_SDK_ADDON_NAME :=
PRODUCTS.device/company/suez/MyDevice.mk.PRODUCT_SDK_ADDON_COPY_FILES :=
PRODUCTS.device/company/suez/MyDevice.mk.PRODUCT_SDK_ADDON_COPY_MODULES :=
PRODUCTS.device/company/suez/MyDevice.mk.PRODUCT_SDK_ADDON_DOC_MODULES :=
PRODUCTS.device/company/suez/MyDevice.mk.PRODUCT_SDK_ADDON_SYS_IMG_SOURCE_PROP :=
PRODUCTS.device/company/suez/MyDevice.mk.PRODUCT_DEFAULT_WIFI_CHANNELS :=
PRODUCTS.device/company/suez/MyDevice.mk.PRODUCT_DEFAULT_DEV_CERTIFICATE :=
PRODUCTS.device/company/suez/MyDevice.mk.PRODUCT_RESTRICT_VENDOR_FILES :=
PRODUCTS.device/company/suez/MyDevice.mk.PRODUCT_VENDOR_KERNEL_HEADERS :=
PRODUCTS.device/company/suez/MyDevice.mk.PRODUCT_FACTORY_RAMDISK_MODULES :=
PRODUCTS.device/company/suez/MyDevice.mk.PRODUCT_FACTORY_BUNDLE_MODULES :=
PRODUCTS.device/company/suez/MyDevice.mk.PRODUCT_RUNTIMES := runtime_libart_default
PRODUCTS.device/company/suez/MyDevice.mk.PRODUCT_BOOT_JARS := core-libart conscrypt okhttp core-junit bouncycastle ext framework telephony-common voip-common ims-common mms-common android.policy apache-xml mediatek-framework dolby_ds dolby_ds2
PRODUCTS.device/company/suez/MyDevice.mk.PRODUCT_SUPPORTS_VERITY :=
PRODUCTS.device/company/suez/MyDevice.mk.PRODUCT_OEM_PROPERTIES :=
PRODUCTS.device/company/suez/MyDevice.mk.PRODUCT_SYSTEM_PROPERTY_BLACKLIST :=
PRODUCTS.device/company/suez/MyDevice.mk.PRODUCT_SYSTEM_SERVER_JARS := services ethernet-service wifi-service AWSRemoteConfigurationAndroidClient
PRODUCTS.device/company/suez/MyDevice.mk.PRODUCT_VERITY_SIGNING_KEY :=
PRODUCTS.device/company/suez/MyDevice.mk.PRODUCT_SYSTEM_VERITY_PARTITION :=
PRODUCTS.device/company/suez/MyDevice.mk.PRODUCT_VENDOR_VERITY_PARTITION :=
PRODUCTS.device/company/suez/MyDevice./build/core/dumpvar.mkmk.PRODUCT_DEX_PREOPT_IMAGE_IN_DATA :=
PRODUCTS.device/company/suez/MyDevice.mk.PRODUCT_DEX_PREOPT_MODULE_CONFIGS :=
PRODUCTS.device/company/suez/MyDevice.mk.PRODUCT_DEX_PREOPT_DEFAULT_FLAGS :=
PRODUCTS.device/company/suez/MyDevice.mk.PRODUCT_DEX_PREOPT_BOOT_FLAGS :=
PRODUCTS.device/company/suez/MyDevice.mk.PRODUCT_PACKAGE_NAME :=
--------
vendorsetup.sh AndroidProducts.mk BoardConfig.mk
add_lunch_combo full_myName-user ---------------------------- Add an item in lunch menu
add_lunch_combo full_myName-userdebug
add_lunch_combo full_myName-eng
add_lunch_combo devpreview_myName-user
add_lunch_combo devpreview_myName-userdebug
add_lunch_combo devpreview_myName-eng
add_target_product_mapping devpreview_myName:full_myName ---- map devpreview_myName to full_myName
add_def_config full_myName:tablet ------------------ define the device's configuration (This value will be set toTARGET_BUILD_CONFIGURATION)
PRODUCT_MAKEFILES := \
full_myName:$(LOCAL_DIR)/tablet_full_myName.mk
The format of combo name is like "PRODUCT-BUILD_VARIANT", e.g. "full_myName-userdebug". After parsing this combo name, then
TARGET_PRODUCT=full_myName
TARGET_BUILD_VARIANT=userdebug
$(call inherit-product, device/amazon/myName/myName.mk)
$(call inherit-product, device/amazon/swconfigs/tablet/tablet.mk)
After running "tablet_full_myName.mk", we can get PRODUCT_DEVICE definition.
PRODUCT_DEVICE = myName
TARGET_DEVICE := $(PRODUCTS.$(INTERNAL_PRODUCT).PRODUCT_DEVICE)
Then it will look for */$(TARGET_DEVICE)/BoardConfig.mk in device(or vendor) folder.
Use printconfig function.
And we can customize the output by changing print_build_config_vars in/build/core/dumpvar.mk
During make, it will include AndroidBoard.mk to build kernel code.
1KERNEL_DIR := kernel/mediatek/mtxxxx 2 3KERNEL_PROJECT := MyKernel 4ifneq ($(TARGET_BUILD_VARIANT), user) 5KERNEL_DEFCONFIG := $(KERNEL_PROJECT)_debug_defconfig 6else 7KERNEL_DEFCONFIG := $(KERNEL_PROJECT)_defconfig 8endif 9ifeq ($(RELEASE_DEBUG),1) 10 KERNEL_DEFCONFIG := $(KERNEL_PROJECT)_defconfig 11endif 12 13include $(KERNEL_DIR)/AndroidKernel.mk 14PRELOADER_TARGET_PRODUCT ?= MyProduct 15LK_PROJECT ?= MyLK 16 17include bootable/bootloader/lk-mtk/mtxxxxx/AndroidLK.mk 18include bootable/bootloader/preloader-mtk/mtxxxxx/AndroidPL.mk