This is the mail archive of the
automake@gnu.org
mailing list for the automake project.
Re: Copying build results to another directory
- To: Richard Carlson <jrc at brainhotel dot org>
- Subject: Re: Copying build results to another directory
- From: Tom Tromey <tromey at redhat dot com>
- Date: 26 Jul 2001 17:32:17 -0600
- Cc: automake at gnu dot org
- List-Id: Discussion list for automake <automake.gnu.org>
- References: <Pine.LNX.4.21.0107241515200.3487-100000@opus.brainhotel.org>
- Reply-To: tromey at redhat dot com
>>>>> "Richard" == Richard Carlson <jrc@brainhotel.org> writes:
Richard> Makefile.am:
Richard> noinst_PROGRAMS = hello
Richard> hello_SOURCES = hello.c
Try something like this:
all-local: hello
cp hello someplace
Richard> cp -p hello $(top_srcdir)/bin
In general you don't want to put anything in srcdir.
You particularly don't want to copy an executable there.
Instead use $(top_builddir).
Richard> The problem with this is that I'd like the binary to be
Richard> copied when I solely build 'hello', as in "make hello".
There's no really good way to do this.
You can make it work by introducing your own `hello' target which
does the link itself and then does the copy.
Or you can name the executable differently in the build tree:
noinst_PROGRAMS = hellox
hellox_SOURCES = hello.c
all-local: hello
hello: hellox
cp hellox $(top_builddir)/bin/hello
Why do you want to copy things around during the build?
Why not just use them where they lie?
Tom