This is the mail archive of the automake@gnu.org mailing list for the automake project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Copying build results to another directory


>>>>> "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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]