[Android Software Development] sandeep.sethi:
I have recieved many messages about how to compile ROMs from compressed sources , here i present the guide

First Lets start with the download links

Download Thanks to [MENTION=5391886]DigiGoon[/MENTION] [MENTION=5490832]vaibhavpandeyvpz[/MENTION] [MENTION=4448976]kD[/MENTION] [MENTION=6552280]MSF Jarvis[/MENTION] and [MENTION=5325978]regalstreak[/MENTION] for their works

for more info u can see the link above to understand things better

Now After Downloading the sources what to do

*extarct it using terminal as said in the above link

after that the main thing , installation of main packages

1)Installing Java Development Kit (JDK)

For Kitkat

Installation of Java V6

Open The Terminal and Paste following Command

a) This will Remove the wrong Java JDK from Ubuntu 13.10

sudo apt-get purge openjdk-\* icedtea-\* icedtea6-\*

b) Enter the Following Command and This will Install JDK

wget https://launchpad.net/~webupd8team/+archive/ubuntu/java/+files/oracle-java6-installer_6u45-0%7Ewebupd8%7E8_all.deb sudo dpkg -i oracle-java6-installer_6u45-0~webupd8~8_all.deb wget https://launchpad.net/~webupd8team/+archive/ubuntu/java/+files/oracle-java6-set-default_6u45-0%7Ewebupd8%7E8_all.deb sudo dpkg -i oracle-java6-set-default_6u45-0~webupd8~8_all.deb

c)Check The Java Version Installed

java -version

For Lollipop/Marshmallow Required Java Version is 7 (java 8 not yet supported)

To Install Java V7

sudo apt-get update && sudo apt-get install openjdk-7-jdk

NOTE: For Ubuntu 16.04 user use this command

sudo add-apt-repository ppa:openjdk-r/ppa
sudo apt-get update
sudo apt-get install openjdk-7-jdk

*************JAVA INSTALLATION COMPLETES*****************

2)Installation Of Required Tools

Enter The Following Command

sudo apt-get install git-core gnupg ccache lzop flex bison gperf build-essential zip curl zlib1g-dev zlib1g-dev:i386 libc6-dev lib32ncurses5 lib32z1 lib32bz2-1.0 lib32ncurses5-dev x11proto-core-dev libx11-dev:i386 libreadline6-dev:i386 lib32z-dev libgl1-mesa-glx:i386 libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown libxml2-utils xsltproc readline-common libreadline6-dev libreadline6 lib32readline-gplv2-dev libncurses5-dev lib32readline5 lib32readline6 libreadline-dev libreadline6-dev:i386 libreadline6:i386 bzip2 libbz2-dev libbz2-1.0 libghc-bzlib-dev lib32bz2-dev libsdl1.2-dev libesd0-dev squashfs-tools pngcrush schedtool libwxgtk2.8-dev python

NOTE:if u get broken dependencies error use following command and then above command

sudo apt-get update
sudo apt-get upgrade

**************All DONE*****************************

Now compiling and setting up files

after all the above

download all ur device related sources like device tree, kernel source, vendor files(if present)

Now where to keep those sources?

So, here i take cm13 and ASUS ZenFone 4 as example

The DEVICE TREE goes here:

cm13/device/asus/a400cg

Explaination:

asus is the company name u can know it from the .zip of the device tree u downloaded

*e.g.: android_device_asus_a400cg-master.zip

this says the directory and name of folders itself

device / asus / a400cg /

The Vendor Files Here:

cm13/vendor/asus/a400cg/

The Kernel Source (if not using prebuilt kernel) Here:

cm13/kernel/asus/a400cg/

***************SETTINGS FILES COMPLETE**************

Now Compiling:

open up terminal and cd to cm13 directory

Type :

. build/envsetup.sh or source build/envsetup.sh as ur choice

then

brunch a400cg

and finished wait for it to complete.

Holla u have compiled ROM from compressed source.