xref: /freebsd/contrib/bmake/unit-tests/posix1.exp (revision f81cdf24ba5436367377f7c8e8f51f6df2a75ca7)
1${VAR} = "foo  bar baz"
2a
3b
4c
5foo baR baz,  bar baz, foo bar baz, fooadd baradd bazadd
6mkdir -p 'dir'
7touch 'dir/obj_1.h'
8mkdir -p 'dir'
9printf '#include "obj_1.h"\nconst char* obj_1 = "dir/obj_1.c";\n' \
10    >'dir/obj_1.c'
11Local variables
12 ${@}="dir/obj_1.o" ${<}="dir/obj_1.c"
13 ${*}="dir/obj_1" ${?}="dir/obj_1.h dir/obj_1.c"
14 ${%}=""
15
16Directory and filename parts of local variables
17 ${@D}="dir" ${@F}="obj_1.o"
18 ${<D}="dir" ${<F}="obj_1.c"
19 ${*D}="dir" ${*F}="obj_1"
20 ${?D}="dir dir" ${?F}="obj_1.h obj_1.c"
21 ${%D}="" ${%F}=""
22
23Local variable substitutions
24 ${@:.o=}="dir/obj_1" ${<:.c=.C}="dir/obj_1.C"
25 ${*:=.h}="dir/obj_1.h" ${?:.h=.H}="dir/obj_1.H dir/obj_1.c"
26 ${%:=}=""
27
28Target with suffix transformations
29 ${@D:=append}="dirappend"
30 ${@F:.o=.O}="obj_1.O"
31
32 Implied source with suffix transformations
33 ${<D:r=rr}="dirr"
34 ${<F:.c=.C}="obj_1.C"
35
36 Suffixless target with suffix transformations
37 ${*D:.=dot}="dir"
38 ${*F:.a=}="obj_1"
39
40 Out-of-date dependencies with suffix transformations
41 ${?D:ir=}="d d"
42 ${?F:.h=.H}="obj_1.H obj_1.c"
43
44 Member with suffix transformations
45 ${%D:.=}=""
46 ${%F:${VAR2}=${VAR}}=""
47
48cc -c -o 'dir/obj_1.o' 'dir/obj_1.c'
49mkdir -p '.'
50touch 'dummy'
51Local variables
52 ${@}="lib.a" ${<}="dir/obj_1.o"
53 ${*}="obj1" ${?}="dir/obj_1.o dummy"
54 ${%}="obj1.o"
55
56Directory and filename parts of local variables
57 ${@D}="." ${@F}="lib.a"
58 ${<D}="dir" ${<F}="obj_1.o"
59 ${*D}="." ${*F}="obj1"
60 ${?D}="dir ." ${?F}="obj_1.o dummy"
61 ${%D}="." ${%F}="obj1.o"
62
63Local variable substitutions
64 ${@:.o=}="lib.a" ${<:.c=.C}="dir/obj_1.o"
65 ${*:=.h}="obj1.h" ${?:.h=.H}="dir/obj_1.o dummy"
66 ${%:=}="obj1.o"
67
68Target with suffix transformations
69 ${@D:=append}=".append"
70 ${@F:.o=.O}="lib.a"
71
72 Implied source with suffix transformations
73 ${<D:r=rr}="dirr"
74 ${<F:.c=.C}="obj_1.o"
75
76 Suffixless target with suffix transformations
77 ${*D:.=dot}="dot"
78 ${*F:.a=}="obj1"
79
80 Out-of-date dependencies with suffix transformations
81 ${?D:ir=}="d ."
82 ${?F:.h=.H}="obj_1.o dummy"
83
84 Member with suffix transformations
85 ${%D:.=}=""
86 ${%F:${VAR2}=${VAR}}="obj1foo  bar baz"
87
88cp 'dir/obj_1.o' 'obj1.o'
89ar -rcv 'lib.a' 'obj1.o'
90a - obj1.o
91rm -f 'obj1.o'
92mkdir -p '.'
93printf '#include "obj_2.h"\nconst char* obj_2 = "obj_2.c";\n' \
94    >'obj_2.c'
95mkdir -p '.'
96touch 'obj_2.h'
97Local variables
98 ${@}="obj2.o" ${<}="obj_2.c"
99 ${*}="obj2" ${?}="obj_2.c obj_2.h dir/obj_1.h"
100 ${%}=""
101
102Directory and filename parts of local variables
103 ${@D}="." ${@F}="obj2.o"
104 ${<D}="." ${<F}="obj_2.c"
105 ${*D}="." ${*F}="obj2"
106 ${?D}=". . dir" ${?F}="obj_2.c obj_2.h obj_1.h"
107 ${%D}="" ${%F}=""
108
109Local variable substitutions
110 ${@:.o=}="obj2" ${<:.c=.C}="obj_2.C"
111 ${*:=.h}="obj2.h" ${?:.h=.H}="obj_2.c obj_2.H dir/obj_1.H"
112 ${%:=}=""
113
114Target with suffix transformations
115 ${@D:=append}=".append"
116 ${@F:.o=.O}="obj2.O"
117
118 Implied source with suffix transformations
119 ${<D:r=rr}="."
120 ${<F:.c=.C}="obj_2.C"
121
122 Suffixless target with suffix transformations
123 ${*D:.=dot}="dot"
124 ${*F:.a=}="obj2"
125
126 Out-of-date dependencies with suffix transformations
127 ${?D:ir=}=". . d"
128 ${?F:.h=.H}="obj_2.c obj_2.H obj_1.H"
129
130 Member with suffix transformations
131 ${%D:.=}=""
132 ${%F:${VAR2}=${VAR}}=""
133
134cc -c -o 'obj2.o' 'obj_2.c'
135ar -rcv 'lib.a' 'obj2.o'
136a - obj2.o
137mkdir -p '.'
138touch 'obj3.h'
139mkdir -p 'dir'
140touch 'dir/dummy'
141mkdir -p '.'
142printf '#include "obj3.h"\nconst char* obj3 = "obj3.c";\n' \
143    >'obj3.c'
144Local variables
145 ${@}="lib.a" ${<}="obj3.c"
146 ${*}="obj3" ${?}="obj3.h dir/dummy obj3.c"
147 ${%}="obj3.o"
148
149Directory and filename parts of local variables
150 ${@D}="." ${@F}="lib.a"
151 ${<D}="." ${<F}="obj3.c"
152 ${*D}="." ${*F}="obj3"
153 ${?D}=". dir ." ${?F}="obj3.h dummy obj3.c"
154 ${%D}="." ${%F}="obj3.o"
155
156Local variable substitutions
157 ${@:.o=}="lib.a" ${<:.c=.C}="obj3.C"
158 ${*:=.h}="obj3.h" ${?:.h=.H}="obj3.H dir/dummy obj3.c"
159 ${%:=}="obj3.o"
160
161Target with suffix transformations
162 ${@D:=append}=".append"
163 ${@F:.o=.O}="lib.a"
164
165 Implied source with suffix transformations
166 ${<D:r=rr}="."
167 ${<F:.c=.C}="obj3.C"
168
169 Suffixless target with suffix transformations
170 ${*D:.=dot}="dot"
171 ${*F:.a=}="obj3"
172
173 Out-of-date dependencies with suffix transformations
174 ${?D:ir=}=". d ."
175 ${?F:.h=.H}="obj3.H dummy obj3.c"
176
177 Member with suffix transformations
178 ${%D:.=}=""
179 ${%F:${VAR2}=${VAR}}="obj3foo  bar baz"
180
181cc -c -o 'obj3.o' 'obj3.c'
182ar -rcv 'lib.a' 'obj3.o'
183a - obj3.o
184rm -f 'obj3.o'
185exit status 0
186