automake
[Top][All Lists]
Advanced

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

Re: question about sources in multiple directories


From: Michael Bletzinger
Subject: Re: question about sources in multiple directories
Date: Fri, 09 Feb 2001 15:39:50 -0600

"Matthew R. MacIntyre" wrote:
> 
> Hi,
> 
> I'm sure there is a fairly easy way to do this, but I just can't figure it
> out.  I was hoping someone here could help me.
> 
> I've got some c++ classes in my project's src/ directory, and I want to
> write some little driver programs in the test/ directory to show that the
> classes behave as expected.  I've had no problem including the header
> files I need to compile the driver programs, but errors occur at the
> linking phase of the build process.  How can I get automake setup the
> Makefile in the test/ directory to link with the objects in the src/
> directory?
> 
> Thanks in advance,
> 
> -matt

Wrap your objects in a noinstall library and have the test programs link
with it.

ie.

in your C++ directory:
noinst_LIBRARIES = libMyCplusplus.a

in your test directory:

testprogram_LDADD = -D../C++ directory -lMyCplusplus



This is off the top of my head and untested.  I have used this with C
code and libtool libraries but I understand that there are some problems
with shared libraries and C++ initialization on some platforms.


        Michael

-- 
------------------------------------------------------------------
Michael Bletzinger      Software Developer, Alliance Computational
address@hidden  Environment & Security
217 265 5137            NCSA



reply via email to

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