This is the mail archive of the
automake@gnu.org
mailing list for the automake project.
RE: libs in subdirs
- To: 'Bryan VanDeVen' <bryanv at arlut dot utexas dot edu>, automake at gnu dot org
- Subject: RE: libs in subdirs
- From: Bernard Dautrevaux <Dautrevaux at microprocess dot com>
- Date: Thu, 23 Nov 2000 15:00:26 +0100
- List-Id: Discussion list for automake <automake.gnu.org><mailto:automake-request@gnu.org?subject=unsubscribe>
> -----Original Message-----
> From: Bryan VanDeVen [mailto:bryanv@arlut.utexas.edu]
> Sent: Tuesday, November 21, 2000 6:26 PM
> To: automake@gnu.org
> Subject: libs in subdirs
>
>
> I think this has been coverered for shlibs but I culd not
> find anything for
> static libs... is there ary way (without libtool at the
> present) to build
> static convenience libs and then have them all combined in a
> top level
> directory?
>
> For instance
>
> ..../somelib
> ..../somelib/dbdbv
> ..../somelib/gdemv
>
> so there are source files in all three directories, and we
> would like to
> eventually combine all the object files into "libsomelib.a"
>
> we tried just listing all the sources in the top level
> makefile.am, but
> automake does not like having any sources in subdirectories
> it seems. So, if
> we just build libdbdbv.a and libgdemv.a in their respective
> directories with
> their own makefile.am's, is there a way to merge them
> together with the top
> level objects into one "libsomelib.a" ?
>
What about a rule like:
libsomelib.a: dbdv/libdbdbv.a gdem/libgdemv.a
rm -rf libsomelib.temp
mkdir -p libsomelib.temp
cd libsomelib.temp && $(AR) x ../dbdv/libdbdbv.a
cd libsomelib.temp && $(AR) x ../gdem/libgdemv.a
cd libsomelib.temp && $(AR) $(ARFLAGS) ../libsomelib.a *.o
$(RANLIB) libsomelib.a
rm -rf libsomelib.temp
I know this is not so elegant, but it should work :-)
HTH
Bernard
--------------------------------------------
Bernard Dautrevaux
Microprocess Ingenierie
97 bis, rue de Colombes
92400 COURBEVOIE
FRANCE
Tel: +33 (0) 1 47 68 80 80
Fax: +33 (0) 1 47 88 97 85
e-mail: dautrevaux@microprocess.com
b.dautrevaux@usa.net
--------------------------------------------