准备工作

在AndroidSource Code中有envsetup.sh档案,当执行过此档案后,可以大幅将build的过程简单化、自动化

此档案在src(android source code 位置)/build/中

所以可以执行以下指令

cd /src/build/
. envsetup.sh

可以使用help来检示有哪些指令可以使用

    Invoke ". build/envsetup.sh" from your shell to add thefollowing functions to your environment:  

    - croot:   Changes directory to the top of the tree.
- m: Makesfrom the top of the tree.
- mm: Builds all of the modules in the currentdirectory.
- mmm: Builds all of the modules in the supplieddirectories.
- cgrep: Greps on all local C/C++ files.
- hgrep: Greps on all local C/C++ header files.
- jgrep: Greps on all local Java files.
- mkgrep: Greps on all local make files.
- rcgrep: Greps on all local .rc files.
- resgrep: Greps on all local res/*.xml files.
- shgrep: Greps on all local .sh files.
- godir: Go to the directory containing a file.  

其中对模块的编译有辅助说明的是tapas、m、mm、mmm这几个指令。

m越多,编译范围越小。

m 编译全部的模块

root@ubuntu:/home/android/src# m  

mm 编译模块目录

    root@ubuntu:/home/android/src/external/jpeg# mm
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=2.1-update1
TARGET_PRODUCT=generic
TARGET_BUILD_VARIANT=eng
TARGET_SIMULATOR=false
TARGET_BUILD_TYPE=release
TARGET_ARCH=arm
HOST_ARCH=x86
HOST_OS=linux
HOST_BUILD_TYPE=release
BUILD_ID=ECLAIR
============================================
make: Entering directory `/home/android/src'
Copy: out/target/product/generic/system/etc/apns-conf.xml
make: Leaving directory `/home/android/src'
root@ubuntu:/home/android/src/external/jpeg#

单独编译某模块,需要在mmm后面指定模块路径

    root@ubuntu:/home/android/src# mmm external/jpeg/
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=2.1-update1
TARGET_PRODUCT=generic
TARGET_BUILD_VARIANT=eng
TARGET_SIMULATOR=
TARGET_BUILD_TYPE=release
TARGET_ARCH=arm
HOST_ARCH=x86
HOST_OS=linux
HOST_BUILD_TYPE=release
BUILD_ID=ECLAIR
============================================
make: Entering directory `/home/android/src'
Target buildinfo: out/target/product/generic/root/default.prop
Target buildinfo: out/target/product/generic/system/build.prop
Copy: out/target/product/generic/system/etc/apns-conf.xml
make: Leaving directory `/home/android/src'
root@ubuntu:/home/android/src#

最新文章

  1. C# winform 模拟键盘鼠标操作
  2. UVALive 5058 Counting BST --组合数
  3. xStream完美转换XML、JSON
  4. Windows 窗体设计器中的设计时错误
  5. JavaScript Patterns 4.2 Callback Pattern
  6. 极客技术专题【008期】:CSS3核心技术:选择器
  7. 超级坑人的Couchbase数据库问题!!!
  8. POJ 3630 Phone List Trie题解
  9. C语言中数据类型的长度
  10. java中replace()和replaceAll()区别
  11. PHP根据设备类型自动跳转相应网址页面,这个现在实用
  12. 51nod_1181:质数中的质数
  13. linux 搭建CA服务器 http+ssl mail+ssl 扫描与抓包
  14. 引导加载程序之争: LILO 和 GRUB
  15. JDK1.8源码(二)——java.lang.Integer 类
  16. 使用 nodeJs 开发微信公众号(设置自动回复消息)
  17. 转:IIS 应用程序池 内存 自动回收
  18. BugkuCTF web3
  19. skipper http router 工具
  20. python3 之__str__

热门文章

  1. datagridview 用法
  2. paper 37 : WINCE的BIB文件解析
  3. 夺命雷公狗---微信开发54----微信js-sdk接口开发(1)之快速入门
  4. linux与windows的文本文件之间的转换
  5. [转载]Emmet使用手册
  6. knockout之入门介绍
  7. 注意!你的Thread.Abort方法真的让线程停止了吗?
  8. android 中activity调用本地service中的方法。
  9. Java中多线程使用匿名内部类的方式进行创建3种方式
  10. mysql delete数据 空间占用不减少的解决办法