[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Understanding Pattern Rules
From: |
Paul Smith |
Subject: |
Re: Understanding Pattern Rules |
Date: |
Tue, 05 May 2015 12:25:44 -0400 |
On Tue, 2015-05-05 at 07:49 -0700, address@hidden wrote:
> file.out: %.cached
> cat $^ > file.out
This is not a pattern rule. A pattern rule must have a pattern match
(the "%") in the TARGET, because it matches any of a set of targets.
Having a pattern in the prerequisite is optional, but there must be one
in the target, or else it's an explicit rule... and thus it depends on
the explicit prerequisite named, literally, '%.cached'.
To make this a pattern rule you'd need to write:
%.out : %.cached
cat $^ > $@
or similar.