automake
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Destination directory for object files


From: Jeff Ward
Subject: Re: Destination directory for object files
Date: Tue, 3 Mar 2009 16:31:01 -0500

Thanks for quick reply.

Hello Jeff,

* Jeff Ward wrote on Tue, Mar 03, 2009 at 07:58:37PM CET:
I have an automake project setup but I would like the object files to be
placed in a specified directory.  For example:

Foo/Foo.cpp
Foo/obj
Foo/Makefile.am

I would like to have the Foo.o in the obj directory after compilation
and not in directory Foo.  Is this possible?  If so how do I go about
setting that up?   This would really cleanup my directory.

Do not use a directory named "obj",
<http://www.gnu.org/software/autoconf/manual/html_node/obj_002f-and-Make.html >

"obj" was simply for the mock scenario really it could be called anything hopefully configurable. Thanks for the heads up though.


Get to know how VPATH builds work:
<http://www.gnu.org/software/automake/manual/html_node/VPATH-Builds.html >
They achieve something similar to what you want and are much more
flexible in practice.

The VPATH is definitely a nice solution for a parallel build tree. In my case I was hoping for a more crude solution. In then end what I was hoping for is an option that would change the rule for .cpp.o: in the generated makefile.

Currently it looks something like this:
.cpp.o:
if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ ...

What I was hoping for was an ability to make the rule look something like the following:
.cpp.o:
if $(CXXCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o objects/$@ $<; \

This would cause my object files to be placed somewhere other than the current directory. I know this is probably a stretch and might be going against the core capabilities and features of the tool. But I can hope.


Hope that helps.

Cheers,
Ralf

Thanks again,
- Jeff





reply via email to

[Prev in Thread] Current Thread [Next in Thread]