Re: Can automake just build .o objects, without linking them?

Ralf Wildenhues <[email protected]>
Newsgroups gmane.comp.gnu.utils
Organization Department of Numerical Simulation, University of Bonn
Message-ID <[email protected]>
Hello Rodrigo,

* Rodrigo  Meza wrote on Tue, Mar 06, 2007 at 05:50:29PM CET:
> 
>   I have a problem with automake. I have a hierarchy of files like
> this:
> 
> lib/liball.a
> lib/dir1/lib1.o
> lib/dir1/lib1.c
> lib/dir1/lib1.h
> lib/dir2/lib2.o
> lib/dir2/lib2.c
> lib/dir2/lib2.h
> lib/dir3/lib3.o
> lib/dir3/lib3.c
> lib/dir3/lib3.h
> 
> and I would like to compile all the object files in their own
> directory to afterwards build the .a file with them.

Do it like this:

# You can also put the option in the argument to AM_INIT_AUTOMAKE
# in configure.ac.
AUTOMAKE_OPTIONS = subdir-objects

noinst_LIBRARIES = liball.a
liball_a_SOURCES = \
        dir1/lib1.c \
        dir1/lib1.h \
        dir2/lib2.c \
        dir2/lib2.h \
        dir3/lib3.c \
        dir3/lib3.h

Hope that helps.

Cheers,
Ralf
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.