To accomplish this, Mozilla uses client.mk, which provides a set of rules for getting and building the code.
Mozilla is moving toward using the Python based buildbot system for automated builds and tests.