一、下載源碼
1.1 下載 repo 工具
mkdir ~/bin
PATH=~/bin:$PATH
curl https://storage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo
1.2 下載源碼
repo init -u https://mirrors.tuna.tsinghua.edu.cn/git/AOSP/platform/manifest
repo sync
官網(wǎng)查看源碼
二、搭建Linux編譯環(huán)境
2.1 安裝依賴庫(kù)
sudo apt-get install libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-dev g++-multilib
sudo apt-get install -y git flex bison gperf build-essential libncurses5-dev:i386
sudo apt-get install tofrodos python-markdown libxml2-utils xsltproc zlib1g-dev:i386
sudo apt-get install dpkg-dev libsdl1.2-dev libesd0-dev
sudo apt-get install git-core gnupg flex bison gperf build-essential
sudo apt-get install zip curl zlib1g-dev gcc-multilib g++-multilib
sudo apt-get install libc6-dev-i386
sudo apt-get install lib32ncurses5-dev x11proto-core-dev libx11-dev
sudo apt-get install libgl1-mesa-dev libxml2-utils xsltproc unzip m4
sudo apt-get install lib32z-dev ccache
sudo apt-get install libssl-dev
三具练、源碼編譯
3.1 使用 envsetup.sh 腳本初始化環(huán)境:
source build/envsetup.sh
或
build/envsetup.sh
3.2 選擇目標(biāo)
source build/envsetup.sh
lunch 1
time make -j12