Hello,
On Mon, Apr 10, 2006 at 02:48:44PM +0000, Daniel Kraft wrote:
> In my automake Makefile I need a way to generate testfiles when the
> corresponding test program is compiled. I have something like:
>
> check_PROGRAMS = test
> test_SOURCES = test.cpp
>
> But I need a file created by make (i.e., a command executed which
> creates it) when test is compiled. Is there a way to specify this?
>
> test: myfile
>
> Doesn't work, [...]
... and also isn't what you meant; `myfile' is not a prerequisite for
building the program `test', right?
You need to create a phony target that does both; builds `test', creates
`myfile', and perhaps runs it.
What about something like:
TESTS = my-test
.PHONY: my-test
check_PROGRAMS = test
test_SOURCES = test.cpp
my-test: test$(EXEEXT) myfile
./test -f myfile
HTH,
Stepan Kasal