On Wed, 27 Dec 2006 22:11:31 -0500
"David T. Ashley" <dt*@e3ft.comwr ote:
I have a large project on a Linux box that may eventually have
several hundred 'C' source files, which need to be compiled and
linked into several executables.
That's not a large project :)
Not all of the executables will use all of the files (i.e. there
would be no linker references to some symbols).
Then you should consider using shared objects (.so libraries).
The project will naturally be broken down into several or more
subdirectories.
One hopes so. Also consider using a version control system. Subversion
is pretty neat and a doddle to set up.
Questions:
a)What is the best way in general to build? Compile all the .c files
into corresponding .o files, and then link the .o files explicitly?
See above. One would normally group the related functions into shared
libraries, and then link the various programs against these libraries.
Just linking everything statically is so twentieth century, dear :)
>
b)Any thoughts on doing this with "make"?
Make is the time-honoured way to do this. You need to spend some time
mastering its syntax, but once you know how to use it, make is a very
powerful tool. There are alternatives to make, but they have their own
limitations and idiosyncrasies, in addition to being niche products.
c)Any thoughts on the limitations of the linker?
Unless you have some specific requirements you did not mention, rest
assured that for a project like yours (building a few executables from
a moderate number of source files) the Unix linkers have no
limitations.
--
Stefaan A Eeckels
--
"We have gone from a world of concentrated knowledge and wisdom to one
of distributed ignorance. And we know and understand less while being
increasingly capable." Prof. Peter Cochrane, formerly of BT Labs
(With thanks to Brian Hamilton Kelly)