Buildsystemmk
Buildsystemmk
Buildsystemmk
mk
SPEAKERS
01 02 03 04
How to make Device Android.mk One last bite
definition
HOW TO MAKE
source, lunch, make !
HOW TO MAKE
# source ./build/envsetup.sh
#
# head -n 15 build/envsetup.sh
function hmm() {
cat <<EOF
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] [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.
- 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.
- jgrep: Greps on all local Java files.
- resgrep: Greps on all local res/*.xml files.
- godir: Go to the directory containing a file.
#
HOW TO MAKE
lunch
HOW TO MAKE
make
make -j42
vendorsetup.sh
add_lunch_combo TARGETNAME-TYPE
Lunch entry point
BoardConfig.mk
A bunch of
Define your Can include other
specific
device hardware BoardConfig.mk
defines
DEVICE DEFINITION
BoardConfig.mk
WIFI_DRIVER_FW_PATH_AP := "/vendor/firmware/fw_bcmdhd_apsta.bin"
WIFI_DRIVER_FW_PATH_STA := "/vendor/firmware/fw_bcmdhd.bin"
BOARD_USES_SECURE_SERVICES := true
TARGET_NO_RADIOIMAGE := true
TARGET_BOARD_PLATFORM := msm8974
TARGET_BOOTLOADER_BOARD_NAME := hammerhead
TARGET_BOARD_INFO_FILE := device/lge/hammerhead/board-info.txt
BOARD_VENDOR_QCOM_GPS_LOC_API_HARDWARE := $(TARGET_BOARD_PLATFORM)
TARGET_NO_RPC := true
BOARD_EGL_CFG := device/lge/hammerhead/egl.cfg
USE_OPENGL_RENDERER := true
VSYNC_EVENT_PHASE_OFFSET_NS := 7500000
SF_VSYNC_EVENT_PHASE_OFFSET_NS := 5000000
TARGET_USES_ION := true
TARGET_USERIMAGES_USE_EXT4 := true
BOARD_BOOTIMAGE_PARTITION_SIZE := 23068672
BOARD_RECOVERYIMAGE_PARTITION_SIZE := 23068672
BOARD_SYSTEMIMAGE_PARTITION_SIZE := 1073741824
BOARD_USERDATAIMAGE_PARTITION_SIZE := 13725837312
BOARD_CACHEIMAGE_PARTITION_SIZE := 734003200
BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE := ext4
BOARD_FLASH_BLOCK_SIZE := 131072
BOARD_CHARGER_DISABLE_INIT_BLANK := true
BOARD_CHARGER_ENABLE_SUSPEND := true
TARGET_RECOVERY_PIXEL_FORMAT := RGBX_8888
TARGET_RECOVERY_UI_LIB := librecovery_ui_hammerhead
DEVICE DEFINITION
BoardConfig.mk
TARGET_RECOVERY_FSTAB = device/lge/hammerhead/fstab.hammerhead
TARGET_RELEASETOOLS_EXTENSIONS := device/lge/hammerhead
PDK_PLATFORM_ZIP_PRODUCT_BINARIES := device/lge/hammerhead-kernel/vmlinux.bz2
BOARD_HAL_STATIC_LIBRARIES := libdumpstate.hammerhead
BOARD_SEPOLICY_DIRS := \
device/lge/hammerhead/sepolicy
BOARD_SEPOLICY_UNION := \
device.te \
app.te \
file_contexts
HAVE_ADRENO_SOURCE:= false
OVERRIDE_RS_DRIVER:= libRSDriver_adreno.so
TARGET_FORCE_HWC_FOR_VIRTUAL_DISPLAYS := true
TARGET_TOUCHBOOST_FREQUENCY:= 1200
-include vendor/lge/hammerhead/BoardConfigVendor.mk
DEVICE DEFINITION
device.mk
device.mk
Include software
PRODUCT_PACKAGES
PRODUCT_PACKAGES_DEBUG
PRODUCT_PACKAGES_ENG
PRODUCT_PACKAGES_TESTS
PRODUCT_COPY_FILES
DEVICE DEFINITION
device.mk
Customize
PRODUCT_PROPERTY_OVERRIDES
PRODUCT_DEFAULT_PROPERTY_OVERRIDES
PRODUCT_RESTRICT_VENDOR_FILES
PRODUCT_PACKAGE_OVERLAYS
DEVICE_PACKAGE_OVERLAYS
DEVICE DEFINITION
device.mk
Some leftovers
PRODUCT_AAPT_CONFIG
PRODUCT_AAPT_PREF_CONFIG
PRODUCT_OTA_PUBLIC_KEYS
PRODUCT_EXTRA_RECOVERY_KEYS
PRODUCT_DEFAULT_DEV_CERTIFICATE
And more in build/core/product.mk
DEVICE DEFINITION
device.mk
PRODUCT_PACKAGES += \
gralloc.msm8974 \
libgenlock \
hwcomposer.msm8974 \
[...]
flp.msm8974
PRODUCT_PROPERTY_OVERRIDES += \
ro.hwui.texture_cache_size=72 \
debug.qualcomm.sns.hal=w \
debug.qualcomm.sns.daemon=w \
[...]
debug.qualcomm.sns.libsensor1=w
PRODUCT_DEFAULT_PROPERTY_OVERRIDES += \
rild.libpath=/system/lib/libril-qc-qmi-1.so
# Camera configuration
PRODUCT_DEFAULT_PROPERTY_OVERRIDES += \
camera.disable_zsl_mode=1
# Input resampling configuration
PRODUCT_PROPERTY_OVERRIDES += \
ro.input.noresample=1
# setup dalvik vm configs.
$(call inherit-product, frameworks/native/build/phone-xhdpi-2048-dalvik-heap.mk)
$(call inherit-product-if-exists, hardware/qcom/msm8x74/msm8x74.mk)
$(call inherit-product-if-exists, vendor/qcom/gpu/msm8x74/msm8x74-gpu-vendor.mk)
$(call inherit-product-if-exists,
hardware/broadcom/wlan/bcmdhd/firmware/bcm4339/device-bcm.mk)
Android.mk
A piece of Android
Android.mk
Android.mk, Android.mk everywhere
# cat packages/apps/Settings/Android.mk
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE_TAGS := optional
LOCAL_SRC_FILES := \
$(call all-java-files-under, src) \
src/com/android/settings/EventLogTags.logtags
LOCAL_PACKAGE_NAME := Settings
LOCAL_CERTIFICATE := platform
LOCAL_PRIVILEGED_MODULE := true
LOCAL_PROGUARD_FLAG_FILES := proguard.flags
LOCAL_AAPT_FLAGS += -c zz_ZZ
include $(BUILD_PACKAGE)
More makefiles
untold module makefiles
CleanSpec.mk
Application.mk
One last bite
Even more makefiles
Base devices
build/target/**
One last bite
Other tools
Non-make stuff
Python
build/tool/releasetools/
├── build_image.py
├── img_from_target_files
└── ota_from_target_files
One last bite
Other tools
Non-make stuff
Java
build/tools/signapk
Thank You for your time !
If you have any question ?
0682079415
[email protected]
[email protected]
@charly_prunier
Copyrights
#
# Copyright (C) 2013 The Android Open-Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#