[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to create static library with sources from multiple dirs?

From: Bob Rossi
Subject: How to create static library with sources from multiple dirs?
Date: Sat, 15 Feb 2003 19:46:34 -0500
User-agent: Mutt/1.3.28i


Is this question appropriate here?

I have three directories that each contain source code. I also have one
directory that is called include. In all I have these 4 directories at
the same level.

   src/ annotate-two-src/ gdb-mi-src/ include/

I would like to create 1 static library from the code in these dirs.

src/ contains general functions such as xmalloc, xstrncpy, forkpty ...
annotate-two-src/ contains code to interface with gdb using annotations.
gdb-mi-src/ contains code to interface with gdb using GDB/MI.
include/ contains headers the client should use

I would like to create 1 library even though the sources are spread out
over 3 directories. I can only seem to come up with 2 undesirable solutions.
   1. Put all the code in one directory and make 1 library.
   2. Create 3 library's

Here are the's that I have so far. They create 3 library's. 
I would greatly like to figure out how to create only 1 called libtgdb.a

At the level containing the 4 directories I have
   SUBDIRS = annotate-two-src gdb-mi-src src
   EXTRA_DIST = include

In the src/ dir I have
   INCLUDES = -I ../include -I ../annotate-two-src -I ../gdb-mi-src
   noinst_LIBRARIES = libtgdb.a
   libtgdb_a_SOURCES = tgdb.c types.c pseudo.c error.c util.c

In the annotate-two-src/ dir I have
noinst_LIBRARIES = libannotate-two.a
libannotate_two_a_SOURCES = a2-tgdb.c annotate.c state_machine.c data.c
EXTRA_DIST = a2-tgdb.h annotate.h state_machine.h data.h
INCLUDES = -I../include

In the gdb-mi-src/ dir I have
noinst_LIBRARIES = libgdb-mi.a
libgdb_mi_a_SOURCES = gdb-mi-tgdb.c gdb-mi_init.c
EXTRA_DIST = gdb-mi-tgdb.h gdb-mi_init.h
INCLUDES = -I../include

Is there any way to solve my problem? Help would be greatly appreciated.

Bob Rossi

reply via email to

[Prev in Thread] Current Thread [Next in Thread]