2) To install some building packages & utilities.
$ sudo apt-get install flex bison gperf libsdl-dev libesd0-dev libwxgtk2.6-dev build-essential zip curl
$ sudo apt-get install valgrind
$ sudo apt-get install sun-java6-jdk
4) To add some system variables.
export LANG=c
export PATH=~/bin:$PATH:.
export JAVA_HOME=/usr/lib/jvm/java-6-sun-1.6.0.07
export ANDROID_JAVA_HOME=$JAVA_HOME
3) It must install the Git & Repo, please read the link in detail. http://source.android.com/download/using-repo
$ sudo apt-get install git-core gnupg
$ curl http://android.git.kernel.org/repo >~/bin/repo
$ chmod a+x ~/bin/repo
$ mkdir myAndroid
$ cd myAndroid
$ repo init -u git://android.git.kernel.org/platform/manifest.git
4) User can download the Android codes now.
$ repo sync
5) To compile the Android.
$make
6) Checking the result in myAndroid/out.
Have fun ^_^