Re: how to write a general rule

Bram Moolenaar <[email protected]>
Newsgroups gmane.comp.tools.aap.user
Message-ID <[email protected]>
Joerg Beyer wrote:

> I am not sure, how to write a generell aap-rule. I have a
> inputfile x.in that sould be transformed to x.out. For the
> sake of simplicity let's assume that the tranformation is
> a sed step.
> 
> So I have this aap rule:
> 
> ------------------
> x.out : x.in
>         :sys sed -e "s,e,X,g" <$source  >$target
> ------------------
> 
> This works fine. Now my question: how do I generalize
> this rule for file x.in to any file that ends with a ".in"?

You already found out that you need to use "%.out : %.in".

> @bram: I cant find this in the manual, but I will make up
> a documented example for the documentation - if you like.

I notice that the use of "%" is not explained in the reference manual.
If you can write something to add there that would be useful.

I actually planned to support more ways of pattern matching for ":rule",
but didn't give it a high priority.  There doesn't seem to be much
demand for it.

-- 
"I've been teaching myself to play the piano for about 5 years and now write
most of my songs on it, mainly because I can never find any paper."
		Jeff Lynne, ELO's greatest hits

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///          Creator of Vim - Vi IMproved -- http://www.Vim.org          \\\
\\\              Project leader for A-A-P -- http://www.A-A-P.org        ///
 \\\  Help AIDS victims, buy here: http://ICCF-Holland.org/click1.html  ///


-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?   SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.