[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: build .o files to specific directory using automake
From: |
Ralf Wildenhues |
Subject: |
Re: build .o files to specific directory using automake |
Date: |
Thu, 18 Mar 2010 20:49:19 +0100 |
User-agent: |
Mutt/1.5.20 (2009-10-28) |
Hello,
* scleung wrote on Tue, Mar 16, 2010 at 03:37:36PM CET:
> Usually makefile generated by automake will compile each source file and
> output .o file in the same directory of the source file.
No, that is not true.
In the following, all all-caps entities are metasyntactic variables.
Let's say ATS is the absolute directory name of the toplevel directory
of the source tree of your package (corresponding to $(abs_top_srcdir)),
ATB is the absolute directory name of the toplevel directory of your
build tree (the directory from where you invoked configure,
corresponding to $(abs_top_builddir)), SUB/DIR a subdirectory of ATS of
some depth >= 0, and SOME/FILE.c listed in a *_SOURCES variable in
SUB/DIR/Makefile.am. Then the object corresponding to SOME/FILE.c
will live in directory
- ATB/SUB/DIR/SOME if the subdir-objects Automake option is used,
- ATB/SUB/DIR otherwise.
The base name of the object is an internal Automake detail, but
*usually*, it will end with either '.lo' or '.$(OBJEXT)' (where
$(OBJEXT) is 'o' or 'obj' for most systems), and the name will contain
'FILE' and maybe also 'SOME' and maybe even other components, but then
again, maybe not.
> How to let automake output .o files to a specific directory at the
> same time savely link them to my program/library?
I can only venture to guess that you are having a different issue.
Please describe what you want to achieve in high-level terms, then
we can help you how to get there, or why to maybe rethink your
proposed setup.
Cheers,
Ralf