Android 模組編譯

來源:互聯網
上載者:User

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.

Android 源碼編譯 make命令

Makefile  

在符合GNU Makefiel慣例的Makefile中,包含了一些基本的預先定義的操作:

make

根據Makefile編譯原始碼,串連,產生目標檔案,可執行檔。

make clean

 清除上次的make命令所產生的object檔案(尾碼為“.o”的檔案)及可執行檔,僅僅是清除之前編譯的可執行檔及設定檔。 

make distclean 要清除所有產生的檔案,包括configure產生的檔案,如Makefile檔案。

make install

將編譯成功的可執行檔安裝到系統目錄中,一般為/usr/local/bin目錄。

make dist

產生髮布軟體包檔案(即distributionpackage)。這個命令將會將可執行檔及相關檔案打包成一個tar.gz壓縮的檔案用來作為發布軟體的軟體包。

它會在目前的目錄下產生一個名字類似“PACKAGE-VERSION.tar.gz”的檔案。PACKAGE和VERSION,是我們在configure.in中定義的AM_INIT_AUTOMAKE(PACKAGE,VERSION)。

make distcheck

產生發布軟體包並對其進行測試檢查,以確定發布包的正確性。這個操作將自動把壓縮包檔案解開,然後執行configure命令,並且執行make,來確認編譯不出現錯誤,最後提示你軟體包已經準備好,發行就緒了。

make distclean類似make clean,但同時也將configure產生的檔案全部刪除掉,包括Makefile。 

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.