android$source build/envsetup.sh를 실행 하여 현재 환경을 로딩해 준다.

envsetup.sh 스크립트에서 제공해 주는 함수 중 m, mm, mmm 세 가지를 사용할 수 있다.


m : 현재 경로를 기준으로 소스 트리의 최상위 경로로 이동한 후 make를 실행해준다.

mm : 현재 경로를 기준으로 가장 가까운 단위 모듈을 찾아서 그 모듈만 build 해준다.

mmm : 파라미터로 주어진 경로들에 대해 단위 모듈 build를 해준다. 


$ mmm packages/apps/Contacts와 같이 시행하면 Contacts부분만 다시 빌드됩니다. Android.mk가 존재하는

 Path만 적용할 수 있습니다.


예) bluetooth의 Power On/Off HAL 부분 이며 아래와 같이 mm을 사용할 경우 libbluedroid.so가 생성 됨을 알 수 있다.

 tiva@luxia:/android/system/bluetooth/bluedroid$ mm -j8
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=4.0.4
TARGET_PRODUCT=full_luxia
TARGET_BUILD_VARIANT=eng
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a-neon
HOST_ARCH=x86
HOST_OS=linux
HOST_BUILD_TYPE=release
BUILD_ID=IMM76I
============================================
make: Entering directory `/android'
target thumb C: libbluedroid <= system/bluetooth/bluedroid/bluetooth_bcm4329.c
system/bluetooth/bluedroid/bluetooth_bcm4329.c: In function 'str2ba':
system/bluetooth/bluedroid/bluetooth_bcm4329.c:271: warning: implicit declaration of function 'strtoul'
system/bluetooth/bluedroid/bluetooth_bcm4329.c: In function 'set_bluetooth_power':
system/bluetooth/bluedroid/bluetooth_bcm4329.c:111: warning: 'bt_wake' may be used uninitialized in this function
system/bluetooth/bluedroid/bluetooth_bcm4329.c:112: warning: 'bt_enable' may be used uninitialized in this function
system/bluetooth/bluedroid/bluetooth_bcm4329.c: In function 'bt_is_enabled':
system/bluetooth/bluedroid/bluetooth_bcm4329.c:84: warning: 'bt_wake' may be used uninitialized in this function
system/bluetooth/bluedroid/bluetooth_bcm4329.c:62: note: 'bt_wake' was declared here
system/bluetooth/bluedroid/bluetooth_bcm4329.c:85: warning: 'bt_enable' may be used uninitialized in this function
system/bluetooth/bluedroid/bluetooth_bcm4329.c:62: note: 'bt_enable' was declared here
target SharedLib: libbluedroid (out/target/product/luxia/obj/SHARED_LIBRARIES/libbluedroid_intermediates/LINKED/libbluedroid.so)
target Symbolic: libbluedroid (out/target/product/luxia/symbols/system/lib/libbluedroid.so)
target Strip: libbluedroid (out/target/product/luxia/obj/lib/libbluedroid.so)
Install: out/target/product/luxia/system/lib/libbluedroid.so


* make snod

앞에서 빌드된 모듈을 이용하여 system.img를 바로 생성할 수 있다.

$android make snod

tiva@luxia:~/mywork/android$ make snod
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=4.0.4
TARGET_PRODUCT=full_luxia
TARGET_BUILD_VARIANT=eng
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a-neon
HOST_ARCH=x86
HOST_OS=linux
HOST_BUILD_TYPE=release
BUILD_ID=IMM76I
============================================
==================================================
stagefright -> Android.mk : USE_PIXTREE_STAGEFRIGHT = false
==================================================
make snod: ignoring dependencies
Target system fs image: out/target/product/luxia/system.img
in mkuserimg.sh PATH=out/host/linux-x86/bin/:/opt/java/jdk1.6.0_26/bin:/opt/Qt-4.8.4/bin:/home/tiva/bin:/opt/android/android-sdk-linux/platform-tools:/opt/openocd/bin:/opt/Xilinx/13.4/ISE_DS/ISE/bin/lin64:/opt/toolchains/arm-2010q1-linux-gnueabi/bin:/opt/java/jdk1.6.0_26/bin:/home/tiva/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/opt/workspace/odroidA/0622/android/out/host/linux-x86/bin:/opt/workspace/odroidA/0622/android/prebuilt/linux-x86/toolchain/arm-linux-androideabi-4.4.x/bin:/opt/workspace/odroidA/0622/android/development/emulator/qtools:/opt/workspace/odroidA/0622/android/prebuilt/linux-x86/toolchain/arm-linux-androideabi-4.4.x/bin:/opt/workspace/odroidA/0622/android/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin
make_ext4fs -s -l 524288000 -a system out/target/product/luxia/system.img out/target/product/luxia/system
Creating filesystem with parameters:
    Size: 524288000
    Block size: 4096
    Blocks per group: 32768
    Inodes per group: 8000
    Inode size: 256
    Journal blocks: 2000
    Label:
    Blocks: 128000
    Block groups: 4
    Reserved block group size: 31
Created filesystem with 977/32000 inodes and 42956/128000 blocks
out/target/product/luxia/system.img total size is 169561012


'android' 카테고리의 다른 글

Boot loader에서 인식(GPT/MBR)  (0) 2014.10.15
ramdisk-uboot.img 수정  (0) 2014.06.30
ODROID-A T-flash map  (0) 2013.12.24
android platform 빌드 하기  (0) 2013.12.23
[Tip] android platform version 정보 확인  (0) 2013.12.11
Posted by 깍수
,