[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Process target only if prerequisite was processed?
From: |
Ken Smith |
Subject: |
Re: Process target only if prerequisite was processed? |
Date: |
Thu, 11 Nov 2004 23:46:35 -0500 |
User-agent: |
Mutt/1.5.6i |
On Thu, Nov 11, 2004 at 06:07:25PM -0800, Matt Perry wrote:
> Is there a way to tell make to only process a target if one or more of its
> prerequisites was processed? Let's say I have a make file like this fake
> one here:
>
> all: prereq1 prereq2
> do something
> prereq1:
> ...
> prereq2:
> ...
>
> In this case an action needs to be taken if either one of the
> prerequisites were processed. The "all" target doesn't generate a file.
> It just runs a program.
>
> --
> Matt Perry | matt at primefactor dot com
Hi Matt,
If prereq1 and prereq2 are files, then make will already do the right
thing for you. Since you say "all" does not generate a file, you should
declare it phony as follows.
.PHONY: all
Ken Smith