[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

multiple part pattern rules / more powerful pattern rules

From: Neil.Mowbray
Subject: multiple part pattern rules / more powerful pattern rules
Date: Fri, 8 Jan 2010 04:25:36 +0800


I assume the answers are no but I have two questions about pattern
rules for each (1) is it possible, (2) is it likely to get implemented?

Both questions relate to having more powerful pattern rules.

Multiple part pattern rules
Is there any way to do something like

%1._m4_.%2 : %1.m4.%2
        m4 -P $(<) > $(@)

The motivation is I frequently pre-process files with m4 (but I want the
underlying nature of the file as the end suffix) and so I have rules like

%._m4_.html : %.m4.html 
        m4 -P $(<) > $(@)

%._m4_.css : %.m4.css 
        m4 -P $(<) > $(@)

etc.  It would be nice to collapes these into a single (multiple part)
pattern rule.  Actually the true nature of my need for multiple part
pattern rules is more complex.

Functions in dependency list

I would like to be able to compute the dependency with a function
call: : $(call my-function %).mk
        $(call process-mk-to-mk $(<), $(@)) 

Full generalisation

Actually, what would be nice is to have full regex patterns where on
uses capture groups as a replacement for the %.  Something like

m/ (\w+) ... (\d+)/ : dependency written in terms of $1, $2  (or \1, \2)

Regards, Neil

reply via email to

[Prev in Thread] Current Thread [Next in Thread]