From: Martin R. <ma...@MP...> - 2004-11-07 15:29:19
|
Hi Tim! > Sorry I haven't contributed much recently, I've been having fun trying to get > my wireless network card to work in linux. :-) Sounds like a daunting task :) > One thing that's been bothering me with the raypp build system as it is is the > way the Makefile works. Since we're building as one big translation unit, > every single change to the code means a long compile. I was wondering why we > chose to do it this way? Well, the main reason was that the compilation of the big translation unit is very fast compared to separate compilation of all source files. This is the case because each source file includes quite a lot of large standard library headers, which dominate the compiled lines of code. With separate compilation they need to be parsed many times. Of course this argument is not valid if you edit only one source file and recompile. But in this case all the dependency rules must be regenerated, which also takes some time. When I changed to the one translation unit a few years ago, this was the quickest overall solution, but maybe compilers have changed. > I've frobbed the Makefile a bit and got a working system which compiles each > unit separately then archives them all into a single libraypp.a, which makes > subsequent linkage just as easy, but gets round the issue of rebuilding > everything each time a change is made. > > Does anyone object to me submitting this? Could you please upload it as a sourceforge patch first? > Is there some problem with this approach that I'm missing? Automatic dependency generation is a problem. If you have this functionality, your Makefile should work as well as the current one. Cheers, Martin |