Hi,
I want ot use automake to build a library for which the source has been
supplied to me by a customer. The directory structure is something like:
src/main -- most of the source files are here
src/host -- a few host-specific source files here
In src/main, I have a Makefile.am containing something like this:
lib_LTLIBRARIES = libfred.la
hostdir=$(srcdir)/../host
libfred_la_SOURCES = src1.cpp src2.cpp $(hostdir)/h1.cpp
Everything compiles ok, but the generated Makefile.in contains
libfred_a_OBJECTS = src1.o src2.o $(hostdir)/h1.o
The problem is that h1.o is in the 'main' subdirectory along with all of
the other object files. What's the right way to build a few sources from
another directory into an application?
The only think I can think of is to have another Makefile.am in src/host
which builds the host sources either into object files or into a library
which could be referenced by the src/mainMakefile.am, but that seems
like overkill just to pick up a couple of source files. Reorganizing the
source tree is also not an option.
Wondering if there is a better way.....
Dave