Android compile: The difference between m, mm, mmm, mma, Mmma

Source: Internet
Author: User
<span id="Label3"></p><p><p></p></p><p><p>M: Compiling the entire Android system</p></p><p><p>Makes from the top of the tree</p></p><p><p>Mm: compile the current directory of the module, the current directory needs to have android.mk this makefile file, or go up to the nearest android.mk File.</p></p><p><p>Builds all of the moudles in the current directory</p></p><p><p>Mma: after adding or deleting files in the current directory, you can recompile with MMA.</p></p><p><p>Mmm: compile the module under the specified path, the path specified below needs to have android.mk this makefile file</p></p><p><p>Builds all of the moudles in the supplies directory</p></p><p><p><strong><span style="font-size: 16px">Mmma: after adding or deleting files in the specified directory, you can recompile with MMMA. Not fully compiled, you can use the command to compile the module</span></strong></p></p><p><p>The compilation process of the MMM command:</p></p><p><p>BUILD/CORE/MAIN.MK (is The entry file for Android compilation System)</p></p><p><p>->build/core/config.mk (compile type and target file will be fixed)</p></p><p><p>->BUILD/CORE/DEFINITIONS.MK (defines the macros used during Compilation)</p></p><p><p>                                                        - >one_shot_makefile->build/core/package.mk (compile apk Library File) </p></p><p><p>                                                                                                       ->build/core/java_library.mk (compiling Java library File) </p></p><p><p>                                                                                                      ->build/core/static_java_library.mk (compiling java Static library File) </p></p><p><p>                                                                                                      ->build/core/shared_library.mk->build/core/dynamic_library.mk- >build/core/binary.mk->build/core/base_rules.mk </p></p><p>                                                                                                                                                                                                   (  calculates the values of some basic variables and creates some basic dependency rules)</p><p><p>                                                                                                                                                           ->build/core/static_library.mk (compile. a static library File) </p></p><p><p>                                                                                                                                                          ->build/core/executable.mk (compile Executable) </p></p><p><p>                                                                                                                                                          ->build/core/prebuilt.mk (compile a pre-compiled third-party library File) </p></p><p><p>->build/core/makfile (with system.img, boot.img, recovery.img and other image file generation Rules)</p></p><p><p>The environment variable One_shot_makefile holds the file path to the android.mk of the module to be compiled, and if the environment variable value is empty, it means that the M or make command is executed, and all modules in the Android source code are Compiled.</p></p><p><p></p></p><p><p><strong>mm, mmm is similar, is used to compile some modules.</strong></p></p><p><p>With these compile commands, you first need to configure the environment in the Android root directory</p></p><pre><pre><code class="language-python hljs"><span class="hljs-comment">#source build/envsetup.sh   要确保当前根目录下有envsetup.sh脚本文件<br></span></code></pre></pre><pre><pre><code class="language-python hljs"><span class="hljs-comment">#lunch ... 对工程的选择</span></code></pre></pre><pre><pre><code class="language-python hljs"><span class="hljs-comment">#cd (要编译模块所在的目录)</span></code></pre></pre><pre><pre><code class="language-python hljs"><span class="hljs-comment">#mm(mma、mmm、mmma) -B -j2 2>&1   开始编译模块</span></code></pre></pre><pre><pre><code class="language-undefined">注:-B表示编译模块的所有文件,-j2表示编译的时候开启两个线程,2>&1表示将错误切换到输出(输入为0,输出为1,错误为2)。 </code></pre></pre><pre><pre><code class="language-css hljs">  <span class="hljs-selector-tag">envsetup<span class="hljs-selector-class">.sh脚本文件里包含<span class="hljs-selector-tag">vendorsetup<span class="hljs-selector-class">.sh 、<span class="hljs-selector-tag">lunch、 <span class="hljs-selector-tag">m <span class="hljs-selector-tag">mm <span class="hljs-selector-tag">mmm的定义</span></span></span></span></span></span></span></span></code></pre></pre><p><p></p></p><p><p><strong><span style="font-size: 16px">MMM and mm differences:</span></strong></p></p><p><p><strong><span style="font-size: 16px">Mmm Package/apps/deskclock</span></strong></p></p><p><p><strong><span style="font-size: 16px">CD package/apps/deskclock, and then mm</span></strong></p></p><p><p>Android compile: The difference between m, mm, mmm, mma, Mmma</p></p></span>
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.