Android 編譯時:m、mm、mmm、mma、mmma的區別

 

m:編譯整個安卓系統css

     makes from the top of the treejava

mm:編譯當前目錄下的模塊,當前目錄下須要有Android.mk這個makefile文件,不然就往上找最近的Android.mk文件。python

         builds all of the moudles in the current directoryapp

         mma:當前目錄新增或刪除文件後,能夠用mma從新編譯。ui

mmm:編譯指定路徑下的模塊,指定的路徑下面須要有Android.mk這個makefile文件spa

             builds all of the moudles in the supplies directory線程

mmma:指定目錄下新增或刪除文件後,能夠用mmma從新編譯。 // 未全編譯的狀況系下,能夠使用該命令單編譯模塊code

            mmm命令 的編譯過程:it

            build/core/main.mk(是Android編譯系統的入口文件)io

           ->build/core/config.mk(會定好編譯類型和目標文件)

                                                      ->build/core/definitions.mk(定義在編譯過程當中用到的宏)

                                                      ->ONE_SHOT_MAKEFILE->build/core/package.mk(編譯Apk庫文件)

                                                                                                 ->build/core/java_library.mk(編譯Java庫文件)

                                                                                                 ->build/core/static_java_library.mk(編譯Java靜態庫文件)

                                                                                                 ->build/core/shared_library.mk->build/core/dynamic_library.mk->build/core/binary.mk->build/core/base_rules.mk

                                                                                                                                                                                         ( 計算一些基本變量的值,並建立一些基本的依賴規則)

                                                                                                                                                  ->build/core/static_library.mk(編譯.a靜態庫文件)

                                                                                                                                                  ->build/core/executable.mk(編譯可執行文件)

                                                                                                                                                  ->build/core/prebuilt.mk(編譯已經預編譯好的第三方庫文件)

                                                                                                 ->build/core/Makfile(有system.img、boot.img、recovery.img等鏡像文件生成規則)

             環境變量ONE_SHOT_MAKEFILE中存放要編譯模塊的Android.mk的文件路徑,若是環境變量值爲空,表示執行的是m或者make命令,會對Android源代碼中的全部模塊進行編譯。

 

mm、mmm是相似的,都是用來編譯某些模塊。

使用這些編譯命令,首先須要在Android根目錄下配置環境

#source build/envsetup.sh   要確保當前根目錄下有envsetup.sh腳本文件
#lunch ... 對工程的選擇
#cd (要編譯模塊所在的目錄)
#mm(mma、mmm、mmma) -B -j2 2>&1   開始編譯模塊
注:-B表示編譯模塊的全部文件,-j2表示編譯的時候開啓兩個線程,2>&1表示將錯誤切換到輸出(輸入爲0,輸出爲1,錯誤爲2)。
 envsetup.sh腳本文件裏包含vendorsetup.sh 、lunch、 m mm mmm的定義

 

mmm 和 mm 區別:

mmm package/apps/DeskClock

cd package/apps/DeskClock ,而後再mm

相關文章
相關標籤/搜索