[G 2014 General] DiamondBond:
Im sick of seeing guides around that tell you all about how to build a rom but never ever go into detail about the hardest part in my opinion which is obtaining device specific code, its ridiculous!? So im here to help.

Just a prior note, im no dev, ive never built from source before (hopefully this will change in few days :D) and the real devs are people like Luk & Luca who built a lovely repos for us with lots of good documentation. So please go and give Luca & Luk a thanks on any one of there posts!

Also i would like to personally thank Luca for helping me when i asked for info regarding building.

Lets get started shall we! :D

1 - Pre-requisites

4+ GB RAM (I have 4GB)

Preferably a Quad-Core CPU (I have an i5)

At least 90GB of HDD/SSD space for the repo & ccache (SSD recommended for faster compile times, i have a 750GB HDD)

GPU - (not needed but may aswell throw it in here) GTX-740M & Intel HD 4000 (Optimus technology - not working on Linux though)

And lastly a Github account, please go make one (its free!) :)

2 - Installing Linux

We need a Linux based 64 bit OS, i use Lubuntu with my own tweaks

Download and install it, either dual-boot or use it as your primary OS like the bad-ass you are! (If you want help on doing this there at least +100000 guides in google and youtube alone) :)

3 - Grabbing build dependencies

sudo apt-get install git && cd ~/ && git clone https://github.com/DiamondBond/Scripts/ .init-scripts && cd ~/.init-scripts && ./dev_init.sh

Copy & Pasta that code above into your terminal and accept/press ok/press yes to any prompts that appear

That should get your system fit with all the necessary things to build and work with androids source, its about 900mb of a download! So sit back and relax...

4 - Preparing to download the massive source-code

I recommend downloading a small movie before doing this so you can relax while it all syncs! (just be sure to keep your eye on that sync window to make sure its still scrolling...)

Lets make a folder to hold all our stuff:

mkdir -p ~/android/titan/roms/cm && cd ~/android/titan/roms/cm

Now your inside the cm folder, you have to be in the cm directory every-time you want to start building!

Now initiate the cm repo: (one-time thing)

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

Now it might give a small error at the end stating for some email and user id stuff.

So now is the time to add your github infos (run this in terminal):

git config --global user.email "you@example.com"
git config --global user.name "Your Name"

EG:

git config --global user.email "diamond.nigel75@Gmail.com"
git config --global user.name "Diamond Bond"

We havnt yet downloaded the CM source, but we will in the next part...

(source code is roughly 35GB for CM12.1 , pure AOSP is slightly smaller)

5 - Downloading & waiting

Note: Straight after syncing official CM12.1 repo this is its size: (31GB)

It is time!, run one of the two commands below (depending on your networking speed) to initiate the long wait of syncing!)

repo sync

Finished? sweet, lets have a rave party! :D

6 - Building!

Now once youve downloaded all the source code you should be able to run your first build after init! :D

Thanks to some nice build scripts by Luca and Luk, running builds is super duper easy! :)

To initialize the last thing, run:

. build/envsetup.sh

then to build run

brunch titan

to build, ive read around and on my system it should only take 1.5 to 3 hours tops, and my system is mediocre + its a laptop so take in account that it may thermally throttle, if you have a desktop it should only take around 1-2 hours with relatively decent specs! :)

7 - Party Time!

If you want help please leave a comment in this thread and i/others will try to help.

Also if you do get a successful build done please share it with us, we would love to be a part of your victory party! :D

Thanks to this guide: http://xdaforums.com/chef-central/android/guide-android-rom-development-t2814763

&

Luca & Luk again!