speeding up compilation and link time

Does anyone have any ideas or tips on how to shorten the time to build? I am building a new tool (in the llvm/projects directory) and it takes minutes to fully build the project, possibly because it uses lots of templates and boost & stl libraries and I am using a slow machine. Specifically, I am looking for ways to change the Makefile and use precompiled headers and incremental linking, but still can’t figure out how the Makefile is structured.

compiler: gcc 4.2.0.
build options: ENABLE_OPTIMIZED=0 REQUIRES_EH=1

Thanks.

Does anyone have any ideas or tips on how to shorten the time to build? I am building a new tool (in the llvm/projects directory) and it takes minutes to fully build the project, possibly because it uses lots of templates and boost & stl libraries and I am using a slow machine. Specifically, I am looking for ways to change the Makefile and use precompiled headers and incremental linking, but still can't figure out how the Makefile is structured.

You may try to use a compiler cache, such as ccache (http://ccache.samba.org). While compiler caches can significantly reduce compilation time I guess that linking time will not be affected much.

Cheers,
  Christian

You can precompile headers... The only change needed for makefiles is generally to add:

g++ -c foo.h -o foo.h.gch

and then to use -include foo.h on the compiles.