Skip to content

Compilation

tom3q edited this page Jan 19, 2013 · 7 revisions

Compilation

Prerequisites

Getting CM7 for Spica source tree

mkdir cm7_spica
cd cm7_spica
repo init -u git://github.com/tom3q/android -b gingerbread
repo sync

Preparing source tree

Copy zImage as kernel.bin to device/samsung/spica.

cp ../kernel-dir/zImage device/samsung/spica/kernel.bin

Download ROM manager files (currently unused, but needed for compilation).

cd vendor/cyanogen
./get-rommanager
cd ../..

(Optional, recommended) Download and extract core Google Apps

cd vendor/cyanogen
wget http://goo.im/gapps/gapps-gb-20110828-signed.zip -O /tmp/gapps.zip
./extract-gapps-files /tmp/gapps.zip
rm /tmp/gapps.zip
cd ../..

Preparing build environment

(Optional, recommended) Enable compilation with core Google Apps.

export CYANOGEN_WITH_GOOGLE=true

Prepare the shell for Android compilation and choose the target.

. build/envsetup.sh
lunch cyanogen_spica-eng

Compilation of CM7 for Spica

make -j5

Creating update package for recovery

make -j5 otapackage

The resulting zip package will be placed in out/target/product/spica.

Notes

  • The "Preparing build environment" section must be executed every time a new shell session is started.
  • You can use repo sync -jN instead of repo sync, where N is a number of threads to use to sync the tree in parallel.
  • Replace 5 in make -j5 (and make -j5 otapackage) with the number of threads for parallel compilation suitable for your machine. Usually the number of logical CPUs (cores) + 1 is fine, but it also depends on available RAM (-j5 is fine for 4 GB).
  • Kernel, ROM manager and Google Apps don't have to be copied/downloaded every time a ROM is being compiled. Just only whenever one of them changes (i.e. new GApps version is released).