automake
[Top][All Lists]
Advanced

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

Re: How to specify additional dependencies of files


From: Stepan Kasal
Subject: Re: How to specify additional dependencies of files
Date: Mon, 10 Apr 2006 19:11:52 +0200
User-agent: Mutt/1.4.1i

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




reply via email to

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