Source https://forum.xda-developers.com/showthread.php?t=2620389
Android.mk - this will tell the build system to include and to build sources specifically for your device. I have explained a bit of it above as well.
AndroidBoard.mk - this is for the kernel, the build system uses that to drop the kernel image in place.
AndroidProducts.mk - specifies the appropriate device's make file, to use for building. i.e. device/htc/pico/pico.mk(In my case), This is device-specific as well.
device_codename.mk - Every device has a codename, and there is a file named as the codename of device. It specifies the properties and extras to copy over into the final output, in this case, it could be for example, pico.mk
BoardConfig.mk - This is the meat of it all, this is where compiler conditional flags are set, partition layouts, boot addresses, ramdisk size, and so on.
Android.mk
Code:
LOCAL_PATH := $(my-dir) ifeq ($(TARGET_DEVICE),pico) include $(call all-makefiles-under,$(LOCAL_PATH)) endif
AndroidBoard.mk:
Code:
LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) ALL_PREBUILT += $(INSTALLED_KERNEL_TARGET) # include the non-open-source counterpart to this file -include vendor/htc/pico/AndroidBoardVendor.mk
AndroidProducts.mk
Code:
PRODUCT_MAKEFILES := \ $(LOCAL_DIR)/cm.mk \ $(LOCAL_DIR)/pico.mk
BoardConfig.mk
Now in this one, I'm taking a BoardConfig.mk file that I found over the internet with a suitable explanation of it. Credits to the post over stackoverflow for the valuable efforts.
Code:
LOCAL_PATH:= $(call my-dir) TARGET_NO_BOOTLOADER := true TARGET_PREBUILT_KERNEL := device/lg/gt540/kernel TARGET_PREBUILT_RECOVERY_KERNEL := device/lg/gt540/recovery_kernel # This will vary from device! TARGET_BOARD_PLATFORM := msm7k TARGET_ARCH_VARIANT := armv6-vfp TARGET_CPU_ABI := armeabi TARGET_CPU_ABI := armeabi-v6l TARGET_CPU_ABI2 := armeabi # OpenGL drivers config file path BOARD_EGL_CFG := device/lg/gt540/egl.cfg # Dependant, not to be taken literally! BOARD_GLOBAL_CFLAGS += -DHAVE_FM_RADIO # Dependant, not to be taken literally! BOARD_KERNEL_BASE := 0x02600000 # this will be device specific, and by doing cat /proc/mtd will give you the correct sizes BOARD_BOOTIMAGE_PARTITION_SIZE := 0x00480000 BOARD_RECOVERYIMAGE_PARTITION_SIZE := 0x00480000 BOARD_SYSTEMIMAGE_PARTITION_SIZE := 0x0cf80000 BOARD_USERDATAIMAGE_PARTITION_SIZE := 0x0d020000 BOARD_FLASH_BLOCK_SIZE := 131072
Now that the internals of each of those Android build make-files are shown.
Now, onto the vendor/ part of it, in AOSP, simply, once again, correlation and corresponds with the device/ tree, as in continuing with this example, vendor/lg/gt540/ which gets picked up by the lunch. There's more make files in there but the general consensus is there's a directory called proprietary which contains the proprietary libs (due to close-source etc) that gets copied over. The copying over of the libraries gets specified in the file device-vendor-blobs.mk, in this case, gt540-vendor-blobs.mk.
沒有留言:
張貼留言