[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Automake: Compiling sources in other directories
From: |
Dave Brolley |
Subject: |
Automake: Compiling sources in other directories |
Date: |
Fri, 15 Dec 2000 16:29:32 -0500 |
User-agent: |
Mozilla/5.0 (Windows; U; Win95; en-US; m18) Gecko/20001108 Netscape6/6.0 |
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
- Automake: Compiling sources in other directories,
Dave Brolley <=