1. This guide is for Ubuntu 12+ based machine, I run Linux Mint 15. Follow links at end of OP for alternate directions
Windows Users: Setup Ubuntu in Virtualbox Instructions
2. You need to know the location for your device, vendor, and kernel repos. This can be found fairly easily in the forum for your phone. Also take note of your phones codename.
For example the Optimus G is the gee and its repos can be found here https://github.com/TeamPlaceholder
Note*All terminal commands will be in Code boxes*
Install Java JDK
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java6-installer
sudo apt-get install git gnupg flex bison gperf build-essential \ zip curl libc6-dev libncurses5-dev:i386 x11proto-core-dev \ libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-glx:i386 \ libgl1-mesa-dev g++-multilib mingw32 tofrodos \ python-markdown libxml2-utils xsltproc zlib1g-dev:i386
sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so
Install ADB & Fastboot This is optional, as you may already have them working. If not, they're a good thing to have.
sudo add-apt-repository ppa:nilarimogard/webupd8
sudo apt-get update
sudo apt-get install android-tools-adb android-tools-fastboot
curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo
Choose which custom rom you are going to build and initialize the repo for it
repo init -u chosen-manifest
AOKP: https://github.com/AOKP/platform_manifest.git -b Branch
Cyanogenmod: https://github.com/CyanogenMod/android.git -b Branch
CarbonDev: https://github.com/CarbonDev/android.git -b Branch
Liquid Smooth: https://github.com/LiquidSmooth/android.git -b Branch
Replace Branch with appropriate branch from github repo ie cm-10.2 or jb3
If unsure which branch click the link above to locate appropriate branch
Go HERE and follow instructions on obtaining your device specific repos.
Sync the repo
Before you're ready to build your source needs to be configured to include your device. This preparation varies slightly for different custom Roms.
Go HERE and follow instructions for your ROM choice
This is where you can make edits to the source before building to suit your needs.
Go HERE and follow the instructions to tweak source
make -j# otapackage
This can be hard, especially if you're new to programming languages and building. Meet Google your new best friend.
Here is a basic overview to get you started, and if no more at least googling in the right direction.
When it's done you're rom will be in working-dir/out/target/product/codename/
I used these sites while making this guide