[BACK]Return to modts.mk CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / usr.bin / make / unit-tests

File: [cvs.NetBSD.org] / src / usr.bin / make / unit-tests / modts.mk (download)

Revision 1.2, Mon Mar 7 20:20:35 2016 UTC (22 months, 1 week ago) by sjg
Branch: MAIN
CVS Tags: prg-localcount2-base3, prg-localcount2-base2, prg-localcount2-base1, prg-localcount2-base, prg-localcount2, pgoyette-localcount-base, pgoyette-localcount-20170426, pgoyette-localcount-20170320, pgoyette-localcount-20170107, pgoyette-localcount-20161104, pgoyette-localcount-20160806, pgoyette-localcount-20160726, pgoyette-localcount, perseant-stdc-iso10646-base, perseant-stdc-iso10646, netbsd-8-base, netbsd-8, matt-nb8-mediatek-base, matt-nb8-mediatek, localcount-20160914, bouyer-socketcan-base1, bouyer-socketcan-base, bouyer-socketcan, HEAD
Changes since 1.1: +2 -1 lines

For :ts numeric escapes \x* is hex, anything else is octal.

LIST= one two three
LIST+= four five six

FU_mod-ts = a / b / cool

AAA= a a a
B.aaa= Baaa

all:   mod-ts

# Use print or printf iff they are builtin.
# XXX note that this causes problems, when make decides 
# there is no need to use a shell, so avoid where possible.
.if ${type print 2> /dev/null || echo:L:sh:Mbuiltin} != ""
PRINT= print -r --
.elif ${type printf 2> /dev/null || echo:L:sh:Mbuiltin} != ""
PRINT= printf '%s\n'
.else
PRINT= echo
.endif

mod-ts:
	@echo 'LIST="${LIST}"'
	@echo 'LIST:ts,="${LIST:ts,}"'
	@echo 'LIST:ts/:tu="${LIST:ts/:tu}"'
	@echo 'LIST:ts::tu="${LIST:ts::tu}"'
	@echo 'LIST:ts:tu="${LIST:ts:tu}"'
	@echo 'LIST:tu:ts/="${LIST:tu:ts/}"'
	@echo 'LIST:ts:="${LIST:ts:}"'
	@echo 'LIST:ts="${LIST:ts}"'
	@echo 'LIST:ts:S/two/2/="${LIST:ts:S/two/2/}"'
	@echo 'LIST:S/two/2/:ts="${LIST:S/two/2/:ts}"'
	@echo 'LIST:ts/:S/two/2/="${LIST:ts/:S/two/2/}"'
	@echo "Pretend the '/' in '/n' etc. below are back-slashes."
	@${PRINT} 'LIST:ts/n="${LIST:ts\n}"'
	@${PRINT} 'LIST:ts/t="${LIST:ts\t}"'
	@${PRINT} 'LIST:ts/012:tu="${LIST:ts\012:tu}"'
	@${PRINT} 'LIST:ts/xa:tu="${LIST:ts\xa:tu}"'
	@${PRINT} 'LIST:tx="${LIST:tx}"'
	@${PRINT} 'LIST:ts/x:tu="${LIST:ts\X:tu}"'
	@${PRINT} 'FU_$@="${FU_${@:ts}:ts}"'
	@${PRINT} 'FU_$@:ts:T="${FU_${@:ts}:ts:T}" == cool?'
	@${PRINT} 'B.$${AAA:ts}="${B.${AAA:ts}}" == Baaa?'