1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
|
# $Id: sysv.mk,v 1.5 2020/07/04 18:16:55 sjg Exp $
FOO ?=
FOOBAR = ${FOO:=bar}
_this := ${.PARSEDIR}/${.PARSEFILE}
B = /b
S = /
FUN = ${B}${S}fun
SUN = the Sun
# we expect nothing when FOO is empty
all: foo fun sam bla words
foo:
@echo FOOBAR = ${FOOBAR}
.if empty(FOO)
@FOO="foo fu" ${.MAKE} -f ${_this} foo
.endif
fun:
@echo ${FUN:T}
@echo ${FUN:${B}${S}fun=fun}
@echo ${FUN:${B}${S}%=%}
@echo ${In:L:%=% ${SUN}}
SAM=sam.c
sam:
@echo ${SAM:s%.c=acme}
@echo ${SAM:s%.c=a%.d}
@echo ${SAM:s.c=a%.d}
@echo ${SAM:sam.c=a%.c}
@echo ${SAM:%=a%.c}
@echo ${SAM:%.c=a%.c}
@echo ${SAM:sam%=a%.c}
BLA=
bla:
@echo $(BLA:%=foo/%x)
# The :Q looks like a modifier but isn't.
# It is part of the replacement string.
words:
@echo a${a b c d e:L:%a=x:Q}b
|