modts.mk revision 321964
1
2LIST= one two three
3LIST+= four five six
4
5FU_mod-ts = a / b / cool
6
7AAA= a a a
8B.aaa= Baaa
9
10all:   mod-ts
11
12# Use print or printf iff they are builtin.
13# XXX note that this causes problems, when make decides 
14# there is no need to use a shell, so avoid where possible.
15.if ${(type print) 2> /dev/null || echo:L:sh:Mbuiltin} != ""
16PRINT= print -r --
17.elif ${(type printf) 2> /dev/null || echo:L:sh:Mbuiltin} != ""
18PRINT= printf '%s\n'
19.else
20PRINT= echo
21.endif
22
23mod-ts:
24	@echo 'LIST="${LIST}"'
25	@echo 'LIST:ts,="${LIST:ts,}"'
26	@echo 'LIST:ts/:tu="${LIST:ts/:tu}"'
27	@echo 'LIST:ts::tu="${LIST:ts::tu}"'
28	@echo 'LIST:ts:tu="${LIST:ts:tu}"'
29	@echo 'LIST:tu:ts/="${LIST:tu:ts/}"'
30	@echo 'LIST:ts:="${LIST:ts:}"'
31	@echo 'LIST:ts="${LIST:ts}"'
32	@echo 'LIST:ts:S/two/2/="${LIST:ts:S/two/2/}"'
33	@echo 'LIST:S/two/2/:ts="${LIST:S/two/2/:ts}"'
34	@echo 'LIST:ts/:S/two/2/="${LIST:ts/:S/two/2/}"'
35	@echo "Pretend the '/' in '/n' etc. below are back-slashes."
36	@${PRINT} 'LIST:ts/n="${LIST:ts\n}"'
37	@${PRINT} 'LIST:ts/t="${LIST:ts\t}"'
38	@${PRINT} 'LIST:ts/012:tu="${LIST:ts\012:tu}"'
39	@${PRINT} 'LIST:ts/xa:tu="${LIST:ts\xa:tu}"'
40	@${PRINT} 'LIST:tx="${LIST:tx}"'
41	@${PRINT} 'LIST:ts/x:tu="${LIST:ts\X:tu}"'
42	@${PRINT} 'FU_$@="${FU_${@:ts}:ts}"'
43	@${PRINT} 'FU_$@:ts:T="${FU_${@:ts}:ts:T}" == cool?'
44	@${PRINT} 'B.$${AAA:ts}="${B.${AAA:ts}}" == Baaa?'
45