1 # $Id: modmisc.mk,v 1.1 2014/08/21 13:44:51 apb Exp $
3 # miscellaneous modifier tests
5 # do not put any dirs in this list which exist on some
6 # but not all target systems - an exists() check is below.
7 path
=:/bin
:/tmp
::/:.
:/no
/such
/dir:.
9 MOD_NODOT
=S
/:/ /g
:N.
:ts
:
10 # and decorate, note that $'s need to be doubled. Also note that
11 # the modifier_variable can be used with other modifiers.
12 MOD_NODOTX
=S
/:/ /g
:N.
:@d@
'$$d'@
13 # another mod - pretend it is more interesting
14 MOD_HOMES
=S
,/home
/,/homes
/,
15 MOD_OPT
=@d@
$${exists
($$d):?
$$d:$${d
:S
,/usr
,/opt
,}}@
18 all: modvar modvarloop modsysv
21 @echo
"The answer is ${libfoo.a:L:libfoo.a=42}"
24 @echo
"path='${path}'"
25 @echo
"path='${path:${MOD_NODOT}}'"
26 @echo
"path='${path:S,home,homes,:${MOD_NODOT}}'"
27 @echo
"path=${path:${MOD_NODOTX}:ts:}"
28 @echo
"path=${path:${MOD_HOMES}:${MOD_NODOTX}:ts:}"
30 .for d in
${path
:${MOD_SEP}:N.
} /usr
/xbin
31 path_
$d?
= ${d
:${MOD_OPT}:${MOD_HOMES}}/
32 paths
+= ${d
:${MOD_OPT}:${MOD_HOMES}}
36 @echo
"path_/usr/xbin=${path_/usr/xbin}"
37 @echo
"paths=${paths}"
38 @echo
"PATHS=${paths:tu}"