[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: 'Generic' pattern rules
From: |
Semen Trygubenko |
Subject: |
Re: 'Generic' pattern rules |
Date: |
Thu, 25 Aug 2011 12:22:45 +0100 |
User-agent: |
Mutt/1.5.20 (2009-06-14) |
> ----BEGIN----
>
> %.bar: %.foo
> cat $< >$@
>
> file.bar: file.foo
"file.bar: file.foo" dependency is already handled by the "%.bar: %.foo" rule …
>
> file2.bar:
>
> anotherfile.bar: file.foo
>
> ----END----
>
> 'file.bar' will be built thanks to the pattern rule.
> 'anotherfile.bar' will not be built because the pattern rule does
> not match (i.e. anotherfile.foo is expected as prerequisite for the
> pattern rule to be matched).
Yep, that's what the pattern there is for … ;-)
> Is there a way to specify pattern rules that tell "here is how to
> build a *.bar file given any *.foo file"?
Not sure what you mean by "any *.foo" file in the line
above … But, taking your example, I will assume you want
anotherfile.bar to be built using the command from the pattern
rule, even though there is no match, and
that any .bar file can be built from file.foo. In
that case, how about:
%.bar: file.foo
cat $< >$@
#file.bar: file.foo
file.foo:
touch file.foo
#file2.bar:
#anotherfile.bar: file.foo
HTH,
--
Semen
signature.asc
Description: Digital signature