tech-toolchain archive

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

Re: bmake bug with expanding pattern macro replacements

Robert Elz <kre%munnari.OZ.AU@localhost> wrote:

>     Date:        Mon, 27 Apr 2020 14:44:42 +0200
>     From:        (Joerg Schilling) <>
>     Message-ID:  <>
>   | Do you believe you need a better method since the standard method only 
>   | works in 100% of the cases?
> What POSIX actually says is:
>     If a <percent-sign> character appears as part of subst1 or subst2 after
>     any macros have been recursively expanded, the results are unspecified.
> This makes it hard to know just what is really supposed to happen when
> there is a % char in one or the other of them.
> What's the method in ancient make that has this stuff to match a literal %
> character?
> What happens when there is more than one % character in subst1 or subst2 ?

Ancient make does not support any kind of substitution.

SVr2 make supports sufix substitution.

SunPro Make started to implement Pattern substitution in January 1986

GNU make started in 1989 with both.

My smake added support for both around 1993.

A second % on the left hand side is taken literarily, the right side supports 
any number of % (0..what you like).
> Is any of this stuff actually specified anywhere?

in POSIX ;-)

Ir of course the SunPro Make man page.


--                  (home) Jörg Schilling D-13353 Berlin (work) Blog:

Home | Main Index | Thread Index | Old Index