rosmake is a ros dependency aware build tool which can be used to build all dependencies in the correct order.