AOSP site contains Downloading and Building guide:
http://source.android.com/source/initializing.html
You should set up your local work environment to build the Android source files. You will need to use Linux (Ubuntu in yor case) or Mac OS. Building under Windows is not currently supported.
Note: The source download is approximately 8.5GB in size. You will need over 30GB free to complete a single build, and up to 100GB (or more) for a full set of builds.
Detailed instructions for Ubuntu and MacOS you can see on AOSP site. In general you will need:
Note: It is also possible to build Android in a virtual machine. If you are running Linux in a virtual machine, you will need at least 16GB of RAM/swap and 30GB or more of disk space in order to build the Android tree.
On XDA-developers you can see this Ubuntu-guide:
http://forum.xda-developers.com/showthread.php?t=2114594