You can download source code for each release from the site, but if you want to build interim code, you can use git. I followed the instructions here:

http://mamedev.org/tools/