[GT540 Optimus Android Development] miroslav_mm:
I will teach you build ROM.

Lets get some ROCK!!! :p

Operating System

First step is having a fully functional linux distro. You can choose what you prefer, I'm using ubuntu and I write commands for it. You can use OSX too, as I know, but I've completely no idea how, I never had a Mac.

Well, talking about linux, you need a 64bit distribution, so if you have an old 32 bit processor youn cannot go ahead.

To check which version do you have, type in a shell

uname -a

If the results include "x86_64" you're ok.

Required Packages

You need to install some little packages, to be able to proceed, you can do this with your favorite package manager:

sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl libc6-dev libncurses5-dev:i386 x11proto-core-dev libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-dev:i386 g++-multilib mingw32 openjdk-6-jdk pngcrush schedtool tofrodos python-markdown libxml2-utils xsltproc zlib1g-dev:i386

Some systems need some trick to install all this package, is your care to check this process completed correctly and fix eventually problems.

Install "repo"

Repo is the program that handles synchronization between our pc and the repository, in this case Cyanogen's one. To install do:

mkdir -p ~/bin

curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo

chmod a+x ~/bin/repo

So we have downloaded and added executables flag to it. Now we need a folder to store locally the sources, you can put it everywhere, but to be coherent with other guides, I do:

mkdir -p ~/CM10/

Repository initialization

Well, now it's time to initialize our source folder to correctly sync with repository:

cd CM10

repo init -u git://github.com/CyanogenMod/android.git -b jellybean

Nota: Maybe the repo command is not recognized. In this case you can restart the shell or te machine.

Download

Now is download time! Write this command and get a fresh beer, you have to download several GB of data, please wait.

repo sync -j16

The "-j16" switch may be modified as you want, is the number of concurrent thread downloading from repo. 16 is my value, for a 100Mbit connection, maybe you can decrease a little to match your line speed. Someone uses 8 threads for an 8Mbit ADSL line.

Download precompiled files.

There are some others files needed, like the toolchain, including GCC, to compile code.

~/CM10/vendor/cm/get-prebuilts

Another small wait time and we're ready!

Add sources code for GT540

Copy sources from https://github.com/mmxtrem/device_lge_swift to ~/CM10/device/lge/swift

Or extract this archive http://depositfiles.com/files/1chflk58r to ~/CM10/device/lge/swift

Build

Great, we're ready to build!

The build process takes some hours, so be patient. My notebook, takes more than 10 hours!

cd CM10

source build/envsetup.sh && brunch swift

Install

When is ready, we can find the result here:

~/CM10/system/out/target/product/swift/cm-10-XXXXX-JellyBeanSwift-XXXX.zip

This is the package to be flashed in recovery mode.

There are Gapps included.

Update

If you want to update your build, you have to do only this:

cd CM10

repo sync

and build again!

P.S. Dont forget write Credit my name, when will be publish your ROM. Good Luck!

[Guide] How to use Github

http://xdaforums.com/showthread.php?t=1877040