Android是支持模块化编译的,可以单独对某一个模块:比如浏览器进行编译。
1、进入Android源码根目录,执行source build/envsetup.sh;
2、可以执行mm、mmm等模块编译命令了。如要编译audioflinger,则执行mmm frameworks/base/services/audioflinger/ -B即可。
3、make -snod重新生成system.img映像。
将envsetup.sh的一些注释摘下来如下:
Invoke ". build/envsetup.sh" from your shell to add the following functions to your environment:
- 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.
- mmm: Builds all of the modules in the supplied directories.
- 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.