Module Name: src
Committed By: sjg
Date: Sat Aug 30 22:21:08 UTC 2014
Modified Files:
src/usr.bin/make/unit-tests: impsrc.mk posix1.exp posix1.mk suffixes.mk
sysv.mk varmisc.mk
Log Message:
Replace use of $() with ${}
$() means something special to the shell, so ${} reduces confusion
and is used almost exclusively in the rest of the makefiles.
Discussed with: christos
To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/usr.bin/make/unit-tests/impsrc.mk \
src/usr.bin/make/unit-tests/sysv.mk \
src/usr.bin/make/unit-tests/varmisc.mk
cvs rdiff -u -r1.3 -r1.4 src/usr.bin/make/unit-tests/posix1.exp
cvs rdiff -u -r1.2 -r1.3 src/usr.bin/make/unit-tests/posix1.mk \
src/usr.bin/make/unit-tests/suffixes.mk
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.bin/make/unit-tests/impsrc.mk
diff -u src/usr.bin/make/unit-tests/impsrc.mk:1.1 src/usr.bin/make/unit-tests/impsrc.mk:1.2
--- src/usr.bin/make/unit-tests/impsrc.mk:1.1 Sat Aug 23 15:05:40 2014
+++ src/usr.bin/make/unit-tests/impsrc.mk Sat Aug 30 22:21:07 2014
@@ -1,7 +1,7 @@
-# $NetBSD: impsrc.mk,v 1.1 2014/08/23 15:05:40 christos Exp $
+# $NetBSD: impsrc.mk,v 1.2 2014/08/30 22:21:07 sjg Exp $
-# Does $(.IMPSRC) work properly?
-# It should be set, in order of precedence, to $(.TARGET) of:
+# Does ${.IMPSRC} work properly?
+# It should be set, in order of precedence, to ${.TARGET} of:
# 1) the implied source of a transformation rule,
# 2) the first prerequisite from the dependency line of an explicit rule, or
# 3) the first prerequisite of an explicit rule.
Index: src/usr.bin/make/unit-tests/sysv.mk
diff -u src/usr.bin/make/unit-tests/sysv.mk:1.1 src/usr.bin/make/unit-tests/sysv.mk:1.2
--- src/usr.bin/make/unit-tests/sysv.mk:1.1 Thu Aug 21 13:44:52 2014
+++ src/usr.bin/make/unit-tests/sysv.mk Sat Aug 30 22:21:08 2014
@@ -1,7 +1,7 @@
-# $Id: sysv.mk,v 1.1 2014/08/21 13:44:52 apb Exp $
+# $Id: sysv.mk,v 1.2 2014/08/30 22:21:08 sjg Exp $
FOO ?=
-FOOBAR = $(FOO:=bar)
+FOOBAR = ${FOO:=bar}
_this := ${.PARSEDIR}/${.PARSEFILE}
@@ -14,7 +14,7 @@ SUN = the Sun
all: foo fun
foo:
- @echo FOOBAR = $(FOOBAR)
+ @echo FOOBAR = ${FOOBAR}
.if empty(FOO)
@FOO="foo fu" ${.MAKE} -f ${_this} foo
.endif
Index: src/usr.bin/make/unit-tests/varmisc.mk
diff -u src/usr.bin/make/unit-tests/varmisc.mk:1.1 src/usr.bin/make/unit-tests/varmisc.mk:1.2
--- src/usr.bin/make/unit-tests/varmisc.mk:1.1 Thu Aug 21 15:37:13 2014
+++ src/usr.bin/make/unit-tests/varmisc.mk Sat Aug 30 22:21:08 2014
@@ -1,8 +1,8 @@
-# $Id: varmisc.mk,v 1.1 2014/08/21 15:37:13 apb Exp $
+# $Id: varmisc.mk,v 1.2 2014/08/30 22:21:08 sjg Exp $
#
# Miscellaneous variable tests.
all: unmatched_var_paren
unmatched_var_paren:
- @echo $(foo::=foo-text)
+ @echo ${foo::=foo-text}
Index: src/usr.bin/make/unit-tests/posix1.exp
diff -u src/usr.bin/make/unit-tests/posix1.exp:1.3 src/usr.bin/make/unit-tests/posix1.exp:1.4
--- src/usr.bin/make/unit-tests/posix1.exp:1.3 Fri Aug 29 15:55:44 2014
+++ src/usr.bin/make/unit-tests/posix1.exp Sat Aug 30 22:21:08 2014
@@ -1,4 +1,4 @@
-$(VAR) = "foo bar baz"
+${VAR} = "foo bar baz"
a
b
c
@@ -9,81 +9,81 @@ mkdir -p 'dir'
printf '#include "obj_1.h"\nconst char* obj_1 = "dir/obj_1.c";\n' \
>'dir/obj_1.c'
Local variables
- $(@)="dir/obj_1.o" $(<)="dir/obj_1.c"
- $(*)="dir/obj_1" $(?)="dir/obj_1.h dir/obj_1.c"
- $(%)=""
+ ${@}="dir/obj_1.o" ${<}="dir/obj_1.c"
+ ${*}="dir/obj_1" ${?}="dir/obj_1.h dir/obj_1.c"
+ ${%}=""
Directory and filename parts of local variables
- $(@D)="dir" $(@F)="obj_1.o"
- $(<D)="dir" $(<F)="obj_1.c"
- $(*D)="dir" $(*F)="obj_1"
- $(?D)="dir dir" $(?F)="obj_1.h obj_1.c"
- $(%D)="" $(%F)=""
+ ${@D}="dir" ${@F}="obj_1.o"
+ ${<D}="dir" ${<F}="obj_1.c"
+ ${*D}="dir" ${*F}="obj_1"
+ ${?D}="dir dir" ${?F}="obj_1.h obj_1.c"
+ ${%D}="" ${%F}=""
Local variable substitutions
- $(@:.o=)="dir/obj_1" $(<:.c=.C)="dir/obj_1.C"
- $(*:=.h)="dir/obj_1.h" $(?:.h=.H)="dir/obj_1.H dir/obj_1.c"
- $(%:=)=""
+ ${@:.o=}="dir/obj_1" ${<:.c=.C}="dir/obj_1.C"
+ ${*:=.h}="dir/obj_1.h" ${?:.h=.H}="dir/obj_1.H dir/obj_1.c"
+ ${%:=}=""
Target with suffix transformations
- $(@D:=append)="dirappend"
- $(@F:.o=.O)="obj_1.O"
+ ${@D:=append}="dirappend"
+ ${@F:.o=.O}="obj_1.O"
Implied source with suffix transformations
- $(<D:r=rr)="dirr"
- $(<F:.c=.C)="obj_1.C"
+ ${<D:r=rr}="dirr"
+ ${<F:.c=.C}="obj_1.C"
Suffixless target with suffix transformations
- $(*D:.=dot)="dir"
- $(*F:.a=)="obj_1"
+ ${*D:.=dot}="dir"
+ ${*F:.a=}="obj_1"
Out-of-date dependencies with suffix transformations
- $(?D:ir=)="d d"
- $(?F:.h=.H)="obj_1.H obj_1.c"
+ ${?D:ir=}="d d"
+ ${?F:.h=.H}="obj_1.H obj_1.c"
Member with suffix transformations
- $(%D:.=)=""
- $(%F:$(VAR2)=$(VAR))=""
+ ${%D:.=}=""
+ ${%F:${VAR2}=${VAR}}=""
cc -c -o 'dir/obj_1.o' 'dir/obj_1.c'
mkdir -p '.'
touch 'dummy'
Local variables
- $(@)="lib.a" $(<)="dir/obj_1.o"
- $(*)="obj1" $(?)="dir/obj_1.o dummy"
- $(%)="obj1.o"
+ ${@}="lib.a" ${<}="dir/obj_1.o"
+ ${*}="obj1" ${?}="dir/obj_1.o dummy"
+ ${%}="obj1.o"
Directory and filename parts of local variables
- $(@D)="." $(@F)="lib.a"
- $(<D)="dir" $(<F)="obj_1.o"
- $(*D)="." $(*F)="obj1"
- $(?D)="dir ." $(?F)="obj_1.o dummy"
- $(%D)="." $(%F)="obj1.o"
+ ${@D}="." ${@F}="lib.a"
+ ${<D}="dir" ${<F}="obj_1.o"
+ ${*D}="." ${*F}="obj1"
+ ${?D}="dir ." ${?F}="obj_1.o dummy"
+ ${%D}="." ${%F}="obj1.o"
Local variable substitutions
- $(@:.o=)="lib.a" $(<:.c=.C)="dir/obj_1.o"
- $(*:=.h)="obj1.h" $(?:.h=.H)="dir/obj_1.o dummy"
- $(%:=)="obj1.o"
+ ${@:.o=}="lib.a" ${<:.c=.C}="dir/obj_1.o"
+ ${*:=.h}="obj1.h" ${?:.h=.H}="dir/obj_1.o dummy"
+ ${%:=}="obj1.o"
Target with suffix transformations
- $(@D:=append)=".append"
- $(@F:.o=.O)="lib.a"
+ ${@D:=append}=".append"
+ ${@F:.o=.O}="lib.a"
Implied source with suffix transformations
- $(<D:r=rr)="dirr"
- $(<F:.c=.C)="obj_1.o"
+ ${<D:r=rr}="dirr"
+ ${<F:.c=.C}="obj_1.o"
Suffixless target with suffix transformations
- $(*D:.=dot)="dot"
- $(*F:.a=)="obj1"
+ ${*D:.=dot}="dot"
+ ${*F:.a=}="obj1"
Out-of-date dependencies with suffix transformations
- $(?D:ir=)="d ."
- $(?F:.h=.H)="obj_1.o dummy"
+ ${?D:ir=}="d ."
+ ${?F:.h=.H}="obj_1.o dummy"
Member with suffix transformations
- $(%D:.=)=""
- $(%F:$(VAR2)=$(VAR))="obj1foo bar baz"
+ ${%D:.=}=""
+ ${%F:${VAR2}=${VAR}}="obj1foo bar baz"
cp 'dir/obj_1.o' 'obj1.o'
ar -rcv 'lib.a' 'obj1.o'
@@ -95,41 +95,41 @@ printf '#include "obj_2.h"\nconst char*
mkdir -p '.'
touch 'obj_2.h'
Local variables
- $(@)="obj2.o" $(<)="obj_2.c"
- $(*)="obj2" $(?)="obj_2.c obj_2.h dir/obj_1.h"
- $(%)=""
+ ${@}="obj2.o" ${<}="obj_2.c"
+ ${*}="obj2" ${?}="obj_2.c obj_2.h dir/obj_1.h"
+ ${%}=""
Directory and filename parts of local variables
- $(@D)="." $(@F)="obj2.o"
- $(<D)="." $(<F)="obj_2.c"
- $(*D)="." $(*F)="obj2"
- $(?D)=". . dir" $(?F)="obj_2.c obj_2.h obj_1.h"
- $(%D)="" $(%F)=""
+ ${@D}="." ${@F}="obj2.o"
+ ${<D}="." ${<F}="obj_2.c"
+ ${*D}="." ${*F}="obj2"
+ ${?D}=". . dir" ${?F}="obj_2.c obj_2.h obj_1.h"
+ ${%D}="" ${%F}=""
Local variable substitutions
- $(@:.o=)="obj2" $(<:.c=.C)="obj_2.C"
- $(*:=.h)="obj2.h" $(?:.h=.H)="obj_2.c obj_2.H dir/obj_1.H"
- $(%:=)=""
+ ${@:.o=}="obj2" ${<:.c=.C}="obj_2.C"
+ ${*:=.h}="obj2.h" ${?:.h=.H}="obj_2.c obj_2.H dir/obj_1.H"
+ ${%:=}=""
Target with suffix transformations
- $(@D:=append)=".append"
- $(@F:.o=.O)="obj2.O"
+ ${@D:=append}=".append"
+ ${@F:.o=.O}="obj2.O"
Implied source with suffix transformations
- $(<D:r=rr)="."
- $(<F:.c=.C)="obj_2.C"
+ ${<D:r=rr}="."
+ ${<F:.c=.C}="obj_2.C"
Suffixless target with suffix transformations
- $(*D:.=dot)="dot"
- $(*F:.a=)="obj2"
+ ${*D:.=dot}="dot"
+ ${*F:.a=}="obj2"
Out-of-date dependencies with suffix transformations
- $(?D:ir=)=". . d"
- $(?F:.h=.H)="obj_2.c obj_2.H obj_1.H"
+ ${?D:ir=}=". . d"
+ ${?F:.h=.H}="obj_2.c obj_2.H obj_1.H"
Member with suffix transformations
- $(%D:.=)=""
- $(%F:$(VAR2)=$(VAR))=""
+ ${%D:.=}=""
+ ${%F:${VAR2}=${VAR}}=""
cc -c -o 'obj2.o' 'obj_2.c'
ar -rcv 'lib.a' 'obj2.o'
@@ -142,41 +142,41 @@ mkdir -p '.'
printf '#include "obj3.h"\nconst char* obj3 = "obj3.c";\n' \
>'obj3.c'
Local variables
- $(@)="lib.a" $(<)="obj3.c"
- $(*)="obj3" $(?)="obj3.h dir/dummy obj3.c"
- $(%)="obj3.o"
+ ${@}="lib.a" ${<}="obj3.c"
+ ${*}="obj3" ${?}="obj3.h dir/dummy obj3.c"
+ ${%}="obj3.o"
Directory and filename parts of local variables
- $(@D)="." $(@F)="lib.a"
- $(<D)="." $(<F)="obj3.c"
- $(*D)="." $(*F)="obj3"
- $(?D)=". dir ." $(?F)="obj3.h dummy obj3.c"
- $(%D)="." $(%F)="obj3.o"
+ ${@D}="." ${@F}="lib.a"
+ ${<D}="." ${<F}="obj3.c"
+ ${*D}="." ${*F}="obj3"
+ ${?D}=". dir ." ${?F}="obj3.h dummy obj3.c"
+ ${%D}="." ${%F}="obj3.o"
Local variable substitutions
- $(@:.o=)="lib.a" $(<:.c=.C)="obj3.C"
- $(*:=.h)="obj3.h" $(?:.h=.H)="obj3.H dir/dummy obj3.c"
- $(%:=)="obj3.o"
+ ${@:.o=}="lib.a" ${<:.c=.C}="obj3.C"
+ ${*:=.h}="obj3.h" ${?:.h=.H}="obj3.H dir/dummy obj3.c"
+ ${%:=}="obj3.o"
Target with suffix transformations
- $(@D:=append)=".append"
- $(@F:.o=.O)="lib.a"
+ ${@D:=append}=".append"
+ ${@F:.o=.O}="lib.a"
Implied source with suffix transformations
- $(<D:r=rr)="."
- $(<F:.c=.C)="obj3.C"
+ ${<D:r=rr}="."
+ ${<F:.c=.C}="obj3.C"
Suffixless target with suffix transformations
- $(*D:.=dot)="dot"
- $(*F:.a=)="obj3"
+ ${*D:.=dot}="dot"
+ ${*F:.a=}="obj3"
Out-of-date dependencies with suffix transformations
- $(?D:ir=)=". d ."
- $(?F:.h=.H)="obj3.H dummy obj3.c"
+ ${?D:ir=}=". d ."
+ ${?F:.h=.H}="obj3.H dummy obj3.c"
Member with suffix transformations
- $(%D:.=)=""
- $(%F:$(VAR2)=$(VAR))="obj3foo bar baz"
+ ${%D:.=}=""
+ ${%F:${VAR2}=${VAR}}="obj3foo bar baz"
cc -c -o 'obj3.o' 'obj3.c'
ar -rcv 'lib.a' 'obj3.o'
Index: src/usr.bin/make/unit-tests/posix1.mk
diff -u src/usr.bin/make/unit-tests/posix1.mk:1.2 src/usr.bin/make/unit-tests/posix1.mk:1.3
--- src/usr.bin/make/unit-tests/posix1.mk:1.2 Fri Aug 29 15:55:44 2014
+++ src/usr.bin/make/unit-tests/posix1.mk Sat Aug 30 22:21:08 2014
@@ -1,4 +1,4 @@
-# $NetBSD: posix1.mk,v 1.2 2014/08/29 15:55:44 sjg Exp $
+# $NetBSD: posix1.mk,v 1.3 2014/08/30 22:21:08 sjg Exp $
# Keep the default suffixes from interfering, just in case.
.SUFFIXES:
@@ -19,7 +19,7 @@ clean:
# are retained, but a single leading tab (if any) from the next line is
# removed. (PR 49085)
# Expect:
-# $(VAR) = "foo bar baz"
+# ${VAR} = "foo bar baz"
# a
# b
# c
@@ -29,7 +29,7 @@ VAR = foo\
baz
line-continuations:
- @echo '$$(VAR) = "$(VAR)"'
+ @echo '$${VAR} = "${VAR}"'
@echo 'aXbXc' | sed -e 's/X/\
/g'
@@ -39,11 +39,11 @@ line-continuations:
#
# The only variable modifier accepted by POSIX.
-# $(VAR:s1=s2): replace s1, if found, with s2 at end of each word in
-# $(VAR). s1 and s2 may contain macro expansions.
+# ${VAR:s1=s2}: replace s1, if found, with s2 at end of each word in
+# ${VAR}. s1 and s2 may contain macro expansions.
# Expect: foo baR baz, bar baz, foo bar baz, fooadd baradd bazadd
suffix-substitution:
- @echo '$(VAR:r=R), $(VAR:foo=), $(VAR:not_there=wrong), $(VAR:=add)'
+ @echo '${VAR:r=R}, ${VAR:foo=}, ${VAR:not_there=wrong}, ${VAR:=add}'
#
@@ -62,19 +62,19 @@ localvars: lib.a
# $% = archive member name
LOCALS = \
"Local variables\n\
- \$$(@)=\"$(@)\" \$$(<)=\"$(<)\"\n\
- \$$(*)=\"$(*)\" \$$(?)=\"$(?)\"\n\
- \$$(%%)=\"$(%)\"\n\n"
+ \$${@}=\"${@}\" \$${<}=\"${<}\"\n\
+ \$${*}=\"${*}\" \$${?}=\"${?}\"\n\
+ \$${%%}=\"${%}\"\n\n"
# $XD = directory part of X $XF = file part of X
# X is one of the local variables.
LOCAL_ALTERNATIVES = \
"Directory and filename parts of local variables\n\
- \$$(@D)=\"$(@D)\" \$$(@F)=\"$(@F)\"\n\
- \$$(<D)=\"$(<D)\" \$$(<F)=\"$(<F)\"\n\
- \$$(*D)=\"$(*D)\" \$$(*F)=\"$(*F)\"\n\
- \$$(?D)=\"$(?D)\" \$$(?F)=\"$(?F)\"\n\
- \$$(%%D)=\"$(%D)\" \$$(%%F)=\"$(%F)\"\n\n"
+ \$${@D}=\"${@D}\" \$${@F}=\"${@F}\"\n\
+ \$${<D}=\"${<D}\" \$${<F}=\"${<F}\"\n\
+ \$${*D}=\"${*D}\" \$${*F}=\"${*F}\"\n\
+ \$${?D}=\"${?D}\" \$${?F}=\"${?F}\"\n\
+ \$${%%D}=\"${%D}\" \$${%%F}=\"${%F}\"\n\n"
# Do all kinds of meaningless substitutions on local variables to see
# if they work. Add, remove and replace things.
@@ -82,30 +82,30 @@ VAR2 = .o
VAR3 = foo
LOCAL_SUBSTITUTIONS = \
"Local variable substitutions\n\
- \$$(@:.o=)=\"$(@:.o=)\" \$$(<:.c=.C)=\"$(<:.c=.C)\"\n\
- \$$(*:=.h)=\"$(*:=.h)\" \$$(?:.h=.H)=\"$(?:.h=.H)\"\n\
- \$$(%%:=)=\"$(%:=)\"\n\n"
+ \$${@:.o=}=\"${@:.o=}\" \$${<:.c=.C}=\"${<:.c=.C}\"\n\
+ \$${*:=.h}=\"${*:=.h}\" \$${?:.h=.H}=\"${?:.h=.H}\"\n\
+ \$${%%:=}=\"${%:=}\"\n\n"
LOCAL_ALTERNATIVE_SUBSTITUTIONS = \
"Target with suffix transformations\n\
- \$$(@D:=append)=\"$(@D:=append)\"\n\
- \$$(@F:.o=.O)=\"$(@F:.o=.O)\"\n\
+ \$${@D:=append}=\"${@D:=append}\"\n\
+ \$${@F:.o=.O}=\"${@F:.o=.O}\"\n\
\n\
Implied source with suffix transformations\n\
- \$$(<D:r=rr)=\"$(<D:r=rr)\"\n\
- \$$(<F:.c=.C)=\"$(<F:.c=.C)\"\n\
+ \$${<D:r=rr}=\"${<D:r=rr}\"\n\
+ \$${<F:.c=.C}=\"${<F:.c=.C}\"\n\
\n\
Suffixless target with suffix transformations\n\
- \$$(*D:.=dot)=\"$(*D:.=dot)\"\n\
- \$$(*F:.a=)=\"$(*F:.a=)\"\n\
+ \$${*D:.=dot}=\"${*D:.=dot}\"\n\
+ \$${*F:.a=}=\"${*F:.a=}\"\n\
\n\
Out-of-date dependencies with suffix transformations\n\
- \$$(?D:ir=)=\"$(?D:ir=)\"\n\
- \$$(?F:.h=.H)=\"$(?F:.h=.H)\"\n\
+ \$${?D:ir=}=\"${?D:ir=}\"\n\
+ \$${?F:.h=.H}=\"${?F:.h=.H}\"\n\
\n\
Member with suffix transformations\n\
- \$$(%%D:.=)=\"$(%D:.=)\"\n\
- \$$(%%F:\$$(VAR2)=\$$(VAR))=\"$(%F:$(VAR2)=$(VAR))\"\n\n"
+ \$${%%D:.=}=\"${%D:.=}\"\n\
+ \$${%%F:\$${VAR2}=\$${VAR}}=\"${%F:${VAR2}=${VAR}}\"\n\n"
.SUFFIXES: .c .o .a
@@ -113,43 +113,43 @@ LOCAL_ALTERNATIVE_SUBSTITUTIONS = \
# but such a thing is not POSIX compatible. It's also somewhat useless
# in a test makefile.
.c.a:
- @printf $(LOCALS)
- @printf $(LOCAL_ALTERNATIVES)
- @printf $(LOCAL_SUBSTITUTIONS)
- @printf $(LOCAL_ALTERNATIVE_SUBSTITUTIONS)
- cc -c -o '$(%)' '$(<)'
- ar $(ARFLAGS) '$(@)' '$(%)'
- rm -f '$(%)'
+ @printf ${LOCALS}
+ @printf ${LOCAL_ALTERNATIVES}
+ @printf ${LOCAL_SUBSTITUTIONS}
+ @printf ${LOCAL_ALTERNATIVE_SUBSTITUTIONS}
+ cc -c -o '${%}' '${<}'
+ ar ${ARFLAGS} '${@}' '${%}'
+ rm -f '${%}'
.c.o:
- @printf $(LOCALS)
- @printf $(LOCAL_ALTERNATIVES)
- @printf $(LOCAL_SUBSTITUTIONS)
- @printf $(LOCAL_ALTERNATIVE_SUBSTITUTIONS)
- cc -c -o '$(@)' '$(<)'
+ @printf ${LOCALS}
+ @printf ${LOCAL_ALTERNATIVES}
+ @printf ${LOCAL_SUBSTITUTIONS}
+ @printf ${LOCAL_ALTERNATIVE_SUBSTITUTIONS}
+ cc -c -o '${@}' '${<}'
# Some of these rules are padded with useless extra dependencies just so
-# that $(?) has more than one file.
+# that ${?} has more than one file.
lib.a: lib.a(obj1.o) lib.a(obj2.o) lib.a(obj3.o)
- ar -s '$(@)'
+ ar -s '${@}'
# Explicit rule where the dependency is an inferred file. The dependency
# object's name differs from the member's because there was a bug which
# forced a dependency on member even when no such dependency was specified
# (PR 49086).
lib.a(obj1.o): dir/obj_1.o dummy
- @printf $(LOCALS)
- @printf $(LOCAL_ALTERNATIVES)
- @printf $(LOCAL_SUBSTITUTIONS)
- @printf $(LOCAL_ALTERNATIVE_SUBSTITUTIONS)
+ @printf ${LOCALS}
+ @printf ${LOCAL_ALTERNATIVES}
+ @printf ${LOCAL_SUBSTITUTIONS}
+ @printf ${LOCAL_ALTERNATIVE_SUBSTITUTIONS}
cp 'dir/obj_1.o' '$%'
- ar $(ARFLAGS) '$(@)' '$%'
+ ar ${ARFLAGS} '${@}' '$%'
rm -f '$%'
# Excplicit rule where the dependency also has an explicit rule.
lib.a(obj2.o): obj2.o
- ar $(ARFLAGS) '$(@)' '$(%)'
+ ar ${ARFLAGS} '${@}' '${%}'
# Use .c.a inference with an extra dependency.
lib.a(obj3.o): obj3.h dir/dummy
@@ -165,20 +165,20 @@ dir/obj_1.o: dir/obj_1.h
# was a bug which forced dependencies based on inference rules on all
# applicable targets (PR 49086).
obj2.o: obj_2.c obj_2.h dir/obj_1.h
- @printf $(LOCALS)
- @printf $(LOCAL_ALTERNATIVES)
- @printf $(LOCAL_SUBSTITUTIONS)
- @printf $(LOCAL_ALTERNATIVE_SUBSTITUTIONS)
- cc -c -o '$(@)' 'obj_2.c'
+ @printf ${LOCALS}
+ @printf ${LOCAL_ALTERNATIVES}
+ @printf ${LOCAL_SUBSTITUTIONS}
+ @printf ${LOCAL_ALTERNATIVE_SUBSTITUTIONS}
+ cc -c -o '${@}' 'obj_2.c'
# Hey, this is make, we can make our own test data setup! obj1.c
# and obj2.c are not used, so they should not get created. They're here
# as a bait for a regression into the forced dependencies discussed earlier.
obj1.c dir/obj_1.c obj2.c obj_2.c obj3.c:
- mkdir -p '$(@D)'
- printf '#include "$(@F:.c=.h)"\nconst char* $(@F:.c=) = "$(@)";\n' \
- >'$(@)'
+ mkdir -p '${@D}'
+ printf '#include "${@F:.c=.h}"\nconst char* ${@F:.c=} = "${@}";\n' \
+ >'${@}'
dir/obj_1.h obj_2.h obj3.h dummy dir/dummy:
- mkdir -p '$(@D)'
- touch '$(@)'
+ mkdir -p '${@D}'
+ touch '${@}'
Index: src/usr.bin/make/unit-tests/suffixes.mk
diff -u src/usr.bin/make/unit-tests/suffixes.mk:1.2 src/usr.bin/make/unit-tests/suffixes.mk:1.3
--- src/usr.bin/make/unit-tests/suffixes.mk:1.2 Fri Aug 29 15:55:44 2014
+++ src/usr.bin/make/unit-tests/suffixes.mk Sat Aug 30 22:21:08 2014
@@ -1,4 +1,4 @@
-# $NetBSD: suffixes.mk,v 1.2 2014/08/29 15:55:44 sjg Exp $
+# $NetBSD: suffixes.mk,v 1.3 2014/08/30 22:21:08 sjg Exp $
# Issues from PR 49086
@@ -42,7 +42,7 @@ all: issue10.e
#
# issue11.j should depend on issue11.i and issue11.second and issue11.i
# should depend on issue11.h and issue11.first. The bug was that
-# the dynamic sources were expanded before $(.PREFIX) and $(.TARGET) were
+# the dynamic sources were expanded before ${.PREFIX} and ${.TARGET} were
# available, so they would have expanded to a null string.
all: issue11.j
@@ -54,36 +54,36 @@ clean:
.SUFFIXES: .a .b .c
.a .a.b .b.a:
- @echo 'There should be no text after the colon: $(.IMPSRC)'
- touch $(.TARGET)
+ @echo 'There should be no text after the colon: ${.IMPSRC}'
+ touch ${.TARGET}
.c.d .d.c .d .d.e .e.d:
@echo 'first set'
- cp $(.IMPSRC) $(.TARGET)
+ cp ${.IMPSRC} ${.TARGET}
.SUFFIXES:
.SUFFIXES: .c .d .e .f .g
.e .e.f .f.e:
@echo 'second set'
- cp $(.IMPSRC) $(.TARGET)
+ cp ${.IMPSRC} ${.TARGET}
issue3.a:
@echo 'There is a bug if you see this.'
- touch $(.TARGET)
+ touch ${.TARGET}
issue5a.c issue5b.d issue5c.d issue5d.d issue5e.e issue10.d issue10.f:
- touch $(.TARGET)
+ touch ${.TARGET}
.SUFFIXES: .h .i .j
-.h.i: $(.PREFIX).first
- @echo '.ALLSRC: $(.ALLSRC)'
- cp $(.IMPSRC) $(.TARGET)
-
-.i.j: $(.PREFIX).second
- @echo '.ALLSRC: $(.ALLSRC)'
- cp $(.IMPSRC) $(.TARGET)
+.h.i: ${.PREFIX}.first
+ @echo '.ALLSRC: ${.ALLSRC}'
+ cp ${.IMPSRC} ${.TARGET}
+
+.i.j: ${.PREFIX}.second
+ @echo '.ALLSRC: ${.ALLSRC}'
+ cp ${.IMPSRC} ${.TARGET}
issue11.h issue11.first issue11.second:
- touch $(.TARGET)
+ touch ${.TARGET}