To save compile times of the entire Android OS (see: Requirements and Building of Android OS) and your custom ROM builds from hours, it is possible to use Android Open Source Project AMI as a starting point for building the entire AOSP build environment which is pre-configured and completely synced with the repo on this app and ready to go.
Once the instance is ready, run these commands to compile the Android OS:
$ cd aosp && . build/envsetup.sh
$ lunch aosp_arm-BUILDTYPE
$ make -j4
BUILDTYPE is one of the following:
user: limited access; suited for production,
userdebug: like "user", but with root access,
eng: development configuration with additional debugging tools.
See: Preparing to build.
The solution above eliminates the need to host a build environment on the local machine, or require the Linux OS.