/********************************************************************************************
* author:conowen@大钟
* E-mail:conowen@hotmail.com
* http://blog.youkuaiyun.com/conowen
* 注:本文为原创,仅作为学习交流使用,转载请标明作者及出处。
********************************************************************************************/
m、mm、mmm命令可以让你只编译单独模块,而不用费大量的时间比编译整个Android系统。
要使用m、mm、mmm命令,需要在源码目录下执行如下命令。(点与build之间是有空格的)
. build/envsetup.sh
否则会提示命令找不到
No command 'mmm' found, did you mean:
Command 'mwm' from package 'motif-clients' (multiverse)
Command 'mwm' from package 'lesstif-bin' (universe)
Command 'mgm' from package 'mgm' (universe)
Command 'rmm' from package 'nmh' (universe)
Command 'rmm' from package 'mailutils-mh' (universe)
Command 'mmv' from package 'mmv' (universe)
Command 'mmd' from package 'mtools' (main)
Command 'mmg' from package 'mkvtoolnix-gui' (universe)
Command 'mm' from package 'mountmanager' (universe)
Command 'mm' from package 'multimail' (universe)
可以使用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这几个指令
其中mmm后面要跟模块的根目录,不是所有的目录下都有子模块,那些含有Android.mk档案目录才是模块的根目录,模块名可以从Android.mk的LOCAL_MODULE或者LOCAL_PACKAGE_NAME变数中得到。
1、单独编译某模块,需要在mmm后面指定模块路径,例如编译ffmpeg 中的libjnivideo
conowen@ideal:~/conowen_android/android4.0$ mmm frameworks/base/native/video/jni
============================================
PLATFORM_VERSION_CODENAME=REL
PLATFORM_VERSION=4.0.1
TARGET_PRODUCT=full
TARGET_BUILD_VARIANT=eng
TARGET_BUILD_TYPE=release
TARGET_BUILD_APPS=
TARGET_ARCH=arm
TARGET_ARCH_VARIANT=armv7-a
HOST_ARCH=x86
HOST_OS=linux
HOST_BUILD_TYPE=release
BUILD_ID=ITL41D
============================================
2、或者可以跳转到你想编译模块相对应目录下执行“mm”命令。
就可以编译单独的模块,事实上,这个命令与mmm命令没有本质的区别。
3、用 m 编译全部的模块
conowen@ideal:~/conowen_android/android4.0$ m
你也可以在src目录下直接执行
conowen@ideal:~/conowen_android/android4.0$ make module_name