> ----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

Attachment: signature.asc
Description: Digital signature

_______________________________________________
Help-make mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/help-make

Reply via email to