[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
More powerful regex support in rules and elsewhere: does such an extensi
From: |
Neil Mowbray |
Subject: |
More powerful regex support in rules and elsewhere: does such an extension exist? will we see it as a feature? |
Date: |
Sun, 27 Jun 2010 07:20:45 +0800 |
Dear Folks,
Does an extension exist that gives make more powerful regex support for
rules?
The least I'm looking for is multiple part pattern rules: for example
%1._m4_.%2 : %1.m4.%2
m4 -P $(<) > $(@)
which would pre-process various files with m4. For example foo.m4.mk
becomes foo._m4_.mk. Maybe it would be nice to restrict this by, for
example,
%.(sh|mk|pl|rb|html): %1._m4_.%2 : %1.m4.%2
m4 -P $(<) > $(@)
Another use for multiple part pattern rules would be to insert or change a
component of the target/dependency path, for example,
%1/htdocs/%2.html : %1/source/%2.html
m4 -P $(<) > $(@)
Obviously if htdocs/%.html : source/%.html was adequate I would not ask the
question.
More generally, why not allow full perl style regex in pattern rules and
$(...) functions?
/^(.*)\/htdocs\/(.*\.html)$/ : $1/source/$2
m4 -P $(<) > $(@)
So as not to break things these could be enabled with a feature switch or
something like the perl "use VERSION;" in the Makefile, probably $(use
VERSION).
Is this ever going to be regular make?
Regards, Neil