This is the mail archive of the automake@gnu.org mailing list for the automake project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: creating 1 library from all noinst libraries in subdirs


Schleicher Ralph (LLI) wrote:
> Bob Rossi <bob_rossi@cox.net> writes:
> > Is it portable to put static libraries within static libraries?
> > Or do you have to put the object files?
> 
> Libtool automatically does the right thing (unpacking the
> sub-libraries into a temporary directory, then adding the
> object files to the main library).

So I guess that assumes that one is using libtool.  Or must use
libtool.  Or something like that.  I went back and read the thread
carefully and up until now no one had mentioned it.

> Just check it out and see what happens.

I have a similar need.  I just tried it and this was the result.  I am
not using libtool.

  ar cru libfoo.a  bar/libbar.a

  ar t libfoo.a 
  libbar.a

Hmm...  So it seems that automake by itself does exactly what you tell
it to do here in this case.

I guess I can pretty easily write a custom rule to unpack and repack,
thinking about parallel makes and build directories, etc.  Actually I
am thinking of something along these lines.

SUBDIRS = bar baz biz

all: libfoo.a

libfoo.a: bar/*.o baz/*.o biz/*.o
        ar cru libfoo.a bar/*.o baz/*.o biz/*.o

Bob Proulx



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]