ANDROID模組編譯

來源:互聯網
上載者:User

之前每次修改BoardConfig.mk後,都傻傻的先make clean然後重新編譯,這樣浪費的時間不計其數。後來忍受不了這種效率,Google了一下,果然不出所料是可以模組獨立編譯的。

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.

 

編譯Android2.3所需要的toolchains:

1、安裝jdk1.6:http://www.oracle.com/technetwork/java/javase/downloads/index-jsp-138363.html

設定環境變數:

export JAVA_HOME=<JDK_PATH>
export JAVA_BIN=<JDK_PATH>
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export JAVA_HOME JAVA_BIN PATH CLASSPATH

2、

sudo apt-get install flex bison gperf libsdl1.2-dev libesd0-dev libwxgtk2.6-dev build-essential zip curl libncurses5-dev zlib1g-dev valgrind libreadline5-dev git-core gnupg
sudo apt-get install x11proto-core-dev libx11-dev

3、我的系統是64bits,還需要:

sudo apt-get install libc6-dev lib32ncurses5-dev ia32-libs lib32readline5-dev lib32z-dev g++-multilib

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.