posix-expansion.mk revision 1.1 1 # $NetBSD: posix-expansion.mk,v 1.1 2025/04/13 09:29:33 rillig Exp $
2 #
3 # https://pubs.opengroup.org/onlinepubs/9799919799/utilities/make.html#tag_20_76_13_05
4 #
5 # In POSIX mode, when expanding an expression containing modifiers, the
6 # modifiers specified in POSIX take precedence over the BSD-style modifiers.
7
8 .POSIX:
9
10
11 MOD_SUBST= S s from to
12 # The modifier contains a "=" and is thus the POSIX modifier.
13 .if ${MOD_SUBST:S=from=to=} != "from=to= s from to"
14 # FIXME: POSIX mode must be active here.
15 # expect+1: Missing argument for ".error"
16 . error
17 .endif
18 # The modifier does not contain a "=" and thus falls back to the BSD modifier.
19 .if ${MOD_SUBST:S,from,to,} != "S s to to"
20 . error
21 .endif
22
23
24 all:
25