automake
[Top][All Lists]
Advanced

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

building a _shared_ library from sources in different directories


From: Giannis Georgalis
Subject: building a _shared_ library from sources in different directories
Date: 16 Jul 2003 17:14:08 +0300
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

Hello,
I have a project, which (directory) structure is the following; 

project_name (=top_source_dir)
        |
        --module1         \
        |   |-- Src        | __ And all the module sub-directories
        |   |-- Include    |    have the same structure.
        |   |-- Obj       /
        |
        --module2
        |
        --module3
        |
        --module4
        |
        --program1
        |
        --program2

What I want to do, is to build a *shared* library from ALL the sources
that are included in module1 AND module2 AND module3 AND module4 and
then link the program1 and program2 against this shared library.

My latest approach to this problem (that didn't work) was to have for
example in module2, module3, module4 directories a Makefile.am of the
form:

INCLUDES = -Iinclude1 -I../include2
noinst_LTLIBRARIES = libmodule{2,3,4}.la
libmodule{2,3,4}_la_SOURCES = Src/source1.cpp Src/source2.cpp \
Include/header1.h ...

And finally in the module1 sub-directory, a Makefile of the form:

INCLUDES = -Iinclude1 -I../include2
lib_LTLIBRARIES = libproject_name.la
libproject_name_la_SOURCES = Src/source19.cpp Src/source20.cpp \
header2003.h ...
libproject_name_la_LIBADD = ../module2/libmodule2.la \
        ../module3/libmodule3.la ../module4/libmodule4.la

What am I doing wrong ?

Additionally, even though it isn't as important for me as the
previous question; Is it possible to make object files being created
in the Obj subdirectory ? -> Note that my makefiles reside in the
module1, module2, module3, module4, program1 and program2
subdirectories.

Thank you,
Giannis

-- 
question = ( to ) ? be : ! be;
                -- Wm. Shakespeare





reply via email to

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