This is the mail archive of the automake@gnu.org mailing list for the automake project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: How to create static library with sources from multiple dirs?


>>> "Bob" == Bob Rossi <bob_rossi at cox dot net> writes:

[...]

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

You haven't said which Automake version you were using.  With
recent versions (>= 1.5 I think), you can build programs or
libraries from sources in subdirectories.

  AUTOMAKE_OPTIONS = subdir-objects # Optional, see the manual.
  noinst_LIBRARIES = liball.a
  liball_a_SOURCES = sub1/foo.c sub1/foo.h sub2/bar.c sub2/bar.h ...

(It's good style to list headers files in _SOURCES instead of
EXTRA_DIST, even if they aren't compiled.)
-- 
Alexandre Duret-Lutz




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]