[comp.unix.questions] Question about basic library usage / makefiles

rfinch@caldwr.UUCP (Ralph Finch) (02/17/90)

Setup: SunOS.  2 directories with many Fortran subroutines (131 and
109), which end up being  0.6 and 1.2 MB worth of object files,
respectively.  These are then used to link with a main program.

Problem:  Compiling each subroutine is quick, since most aren't too
long.  But putting them in their respective libraries takes a long
time, since the libs are large.  ranlib takes a long time on each one.
But I have to use some sort of library because otherwise I get plenty
of unresolved references upon linking, since if I link with straight
object files they aren't in proper order.

Question: What method should I be using to use libraries but with fast
updates?  I tried using multiple libraries in each subdirectory, which
did speed up the ar and ranlib processes, but that was no good upon
linking (they were out of order again).  Currently in the makefile I
am compiling each source, then at the end I use Sun's .DONE (don't know
if this is in other makes) to create a new library from all objects
each time.  I found that updating the library after each compile takes
way too long.

I think I'm missing some basic technique; could somebody clue me in?

Thanks!




-- 
Ralph Finch              The opinions expressed herein are mine...
rfinch@water.ca.gov  ...ucbvax!ucdavis!caldwr!rfinch  916-445-0088

andrew@alice.UUCP (Andrew Hume) (02/26/90)

a technique i have seen used (although i find it repugnant myself)
keeps a copy of all the .o's around and uses an ar q to quickly
rebuild the library from scratch. of course, this doesn't
help with ranlib but there is no way in general to evade that;
the work of figuring out where the symbols are has to be done by someone.