]>
Commit | Line | Data |
---|---|---|
6d7e8eda | 1 | # Copyright (C) 1991-2023 Free Software Foundation, Inc. |
28f540f4 RM |
2 | # This file is part of the GNU C Library. |
3 | ||
4 | # The GNU C Library is free software; you can redistribute it and/or | |
41bdb6e2 AJ |
5 | # modify it under the terms of the GNU Lesser General Public |
6 | # License as published by the Free Software Foundation; either | |
7 | # version 2.1 of the License, or (at your option) any later version. | |
28f540f4 RM |
8 | |
9 | # The GNU C Library is distributed in the hope that it will be useful, | |
10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
41bdb6e2 | 12 | # Lesser General Public License for more details. |
28f540f4 | 13 | |
41bdb6e2 | 14 | # You should have received a copy of the GNU Lesser General Public |
59ba27a6 | 15 | # License along with the GNU C Library; if not, see |
5a82c748 | 16 | # <https://www.gnu.org/licenses/>. |
28f540f4 RM |
17 | |
18 | # | |
19 | # Sub-makefile for POSIX portion of the library. | |
20 | # | |
21 | subdir := posix | |
22 | ||
a5f891ac JM |
23 | include ../Makeconfig |
24 | ||
12a4cfca AZ |
25 | headers := \ |
26 | bits/confname.h \ | |
27 | bits/cpu-set.h \ | |
28 | bits/environments.h \ | |
29 | bits/getopt_core.h \ | |
30 | bits/getopt_ext.h \ | |
31 | bits/getopt_posix.h \ | |
32 | bits/local_lim.h \ | |
33 | bits/mman_ext.h \ | |
34 | bits/posix1_lim.h \ | |
35 | bits/posix2_lim.h \ | |
36 | bits/posix_opt.h \ | |
37 | bits/pthreadtypes-arch.h \ | |
38 | bits/pthreadtypes.h \ | |
39 | bits/sched.h \ | |
40 | bits/thread-shared-types.h \ | |
41 | bits/types.h \ | |
42 | bits/types/idtype_t.h \ | |
43 | bits/types/struct_sched_param.h \ | |
44 | bits/typesizes.h \ | |
45 | bits/unistd.h \ | |
46 | bits/unistd_ext.h \ | |
47 | bits/utsname.h \ | |
48 | bits/waitflags.h \ | |
49 | bits/waitstatus.h \ | |
50 | cpio.h \ | |
51 | fnmatch.h \ | |
52 | getopt.h \ | |
53 | glob.h \ | |
54 | re_comp.h \ | |
55 | regex.h \ | |
56 | sched.h \ | |
57 | spawn.h \ | |
58 | sys/times.h \ | |
59 | sys/types.h \ | |
60 | sys/unistd.h \ | |
61 | sys/utsname.h \ | |
62 | sys/wait.h \ | |
63 | tar.h \ | |
64 | unistd.h \ | |
65 | wait.h \ | |
66 | wordexp.h \ | |
67 | # headers | |
68 | ||
69 | routines := \ | |
70 | _Fork \ | |
71 | _exit \ | |
72 | alarm \ | |
73 | bsd-getpgrp \ | |
74 | confstr \ | |
75 | execl \ | |
76 | execle \ | |
77 | execlp \ | |
78 | execv \ | |
79 | execve \ | |
80 | execveat \ | |
81 | execvp \ | |
82 | execvpe \ | |
83 | fexecve \ | |
84 | fnmatch \ | |
85 | fork \ | |
86 | fpathconf \ | |
87 | gai_strerror \ | |
88 | get_child_max \ | |
89 | getaddrinfo \ | |
90 | getegid \ | |
91 | geteuid \ | |
92 | getgid \ | |
93 | getgroups \ | |
94 | getopt \ | |
95 | getopt1 \ | |
96 | getpgid \ | |
97 | getpgrp \ | |
98 | getpid \ | |
99 | getppid \ | |
100 | getresgid \ | |
101 | getresuid \ | |
102 | getsid \ | |
103 | getuid \ | |
104 | glob \ | |
105 | glob-lstat-compat \ | |
106 | glob64 \ | |
107 | glob64-lstat-compat \ | |
108 | glob64-time64 \ | |
109 | glob_pattern_p \ | |
110 | globfree \ | |
111 | globfree64 \ | |
112 | globfree64-time64 \ | |
113 | group_member \ | |
114 | nanosleep \ | |
115 | pathconf \ | |
116 | pause \ | |
117 | posix_madvise \ | |
118 | pread \ | |
119 | pread64 \ | |
120 | pwrite \ | |
121 | pwrite64 \ | |
122 | regex \ | |
123 | register-atfork \ | |
124 | sched_cpualloc \ | |
125 | sched_cpucount \ | |
126 | sched_cpufree \ | |
127 | sched_getaffinity \ | |
128 | sched_getp \ | |
129 | sched_gets \ | |
130 | sched_primax \ | |
131 | sched_primin \ | |
132 | sched_rr_gi \ | |
133 | sched_setaffinity \ | |
134 | sched_setp \ | |
135 | sched_sets \ | |
136 | sched_yield \ | |
137 | setgid \ | |
138 | setpgid \ | |
139 | setpgrp \ | |
140 | setresgid \ | |
141 | setresuid \ | |
142 | setsid \ | |
143 | setuid \ | |
144 | shm-directory \ | |
145 | sleep \ | |
146 | spawn \ | |
147 | spawn_faction_addchdir \ | |
148 | spawn_faction_addclose \ | |
149 | spawn_faction_addclosefrom \ | |
150 | spawn_faction_adddup2 \ | |
151 | spawn_faction_addfchdir \ | |
152 | spawn_faction_addopen \ | |
153 | spawn_faction_addtcsetpgrp_np \ | |
154 | spawn_faction_destroy \ | |
155 | spawn_faction_init \ | |
156 | spawn_valid_fd \ | |
157 | spawnattr_destroy \ | |
158 | spawnattr_getdefault \ | |
159 | spawnattr_getflags \ | |
160 | spawnattr_getpgroup \ | |
161 | spawnattr_getschedparam \ | |
162 | spawnattr_getschedpolicy \ | |
163 | spawnattr_getsigmask \ | |
164 | spawnattr_init \ | |
165 | spawnattr_setdefault \ | |
166 | spawnattr_setflags \ | |
167 | spawnattr_setpgroup \ | |
168 | spawnattr_setschedparam \ | |
169 | spawnattr_setschedpolicy \ | |
170 | spawnattr_setsigmask \ | |
171 | spawni \ | |
172 | spawnp \ | |
173 | streams-compat \ | |
174 | sysconf \ | |
175 | times \ | |
176 | uname \ | |
177 | vfork \ | |
178 | wait \ | |
179 | wait3 \ | |
180 | wait4 \ | |
181 | waitid \ | |
182 | waitpid \ | |
183 | wordexp \ | |
184 | # routines | |
185 | ||
186 | aux := \ | |
187 | environ \ | |
188 | init-posix \ | |
189 | # aux | |
190 | ||
191 | tests := \ | |
192 | bug-ga1 \ | |
193 | bug-getopt1 \ | |
194 | bug-getopt2 \ | |
195 | bug-getopt3 \ | |
196 | bug-getopt4 \ | |
197 | bug-getopt5 \ | |
198 | bug-glob2 \ | |
199 | bug-glob3 \ | |
200 | bug-regex1 \ | |
7b31c02d CD |
201 | bug-regex2 \ |
202 | bug-regex3 \ | |
203 | bug-regex4 \ | |
204 | bug-regex6 \ | |
205 | bug-regex7 \ | |
206 | bug-regex8 \ | |
207 | bug-regex9 \ | |
12a4cfca AZ |
208 | bug-regex10 \ |
209 | bug-regex11 \ | |
210 | bug-regex12 \ | |
211 | bug-regex13 \ | |
212 | bug-regex14 \ | |
213 | bug-regex15 \ | |
214 | bug-regex16 \ | |
215 | bug-regex17 \ | |
216 | bug-regex18 \ | |
217 | bug-regex19 \ | |
12a4cfca AZ |
218 | bug-regex21 \ |
219 | bug-regex22 \ | |
220 | bug-regex23 \ | |
221 | bug-regex24 \ | |
222 | bug-regex25 \ | |
223 | bug-regex26 \ | |
224 | bug-regex27 \ | |
225 | bug-regex28 \ | |
226 | bug-regex29 \ | |
12a4cfca AZ |
227 | bug-regex30 \ |
228 | bug-regex31 \ | |
229 | bug-regex32 \ | |
230 | bug-regex34 \ | |
231 | bug-regex35 \ | |
232 | bug-regex36 \ | |
233 | bug-regex37 \ | |
234 | bug-regex38 \ | |
12a4cfca AZ |
235 | regexbug1 \ |
236 | runptests \ | |
237 | runtests \ | |
238 | test-errno \ | |
239 | test-ssize-max \ | |
240 | test-vfork \ | |
241 | testfnm \ | |
242 | transbug \ | |
243 | tst-boost \ | |
244 | tst-chmod \ | |
245 | tst-cpucount \ | |
246 | tst-cpuset \ | |
247 | tst-dir \ | |
248 | tst-execl1 \ | |
249 | tst-execl2 \ | |
250 | tst-execle1 \ | |
251 | tst-execle2 \ | |
252 | tst-execlp1 \ | |
253 | tst-execlp2 \ | |
254 | tst-execv1 \ | |
255 | tst-execv2 \ | |
256 | tst-execve1 \ | |
257 | tst-execve2 \ | |
258 | tst-execveat \ | |
259 | tst-execvp1 \ | |
260 | tst-execvp2 \ | |
261 | tst-execvp3 \ | |
262 | tst-execvp4 \ | |
263 | tst-execvpe1 \ | |
264 | tst-execvpe2 \ | |
265 | tst-execvpe3 \ | |
266 | tst-execvpe4 \ | |
267 | tst-execvpe5 \ | |
268 | tst-execvpe6 \ | |
269 | tst-fexecve \ | |
270 | tst-fnmatch \ | |
271 | tst-fnmatch2 \ | |
272 | tst-fnmatch3 \ | |
273 | tst-fnmatch4 \ | |
274 | tst-fnmatch5 \ | |
275 | tst-fnmatch6 \ | |
276 | tst-fnmatch7 \ | |
277 | tst-fork \ | |
127c21c0 | 278 | tst-gai_strerror \ |
12a4cfca AZ |
279 | tst-getaddrinfo \ |
280 | tst-getaddrinfo2 \ | |
281 | tst-getaddrinfo3 \ | |
282 | tst-getopt_long1 \ | |
283 | tst-glob-tilde \ | |
284 | tst-glob_symlinks \ | |
285 | tst-gnuglob \ | |
286 | tst-gnuglob64 \ | |
287 | tst-mmap \ | |
288 | tst-mmap-offset \ | |
289 | tst-nanosleep \ | |
290 | tst-nice \ | |
291 | tst-pathconf \ | |
292 | tst-pcre \ | |
293 | tst-posix_fadvise \ | |
294 | tst-posix_fadvise64 \ | |
295 | tst-posix_spawn-fd \ | |
296 | tst-posix_spawn-setsid \ | |
297 | tst-preadwrite \ | |
298 | tst-preadwrite64 \ | |
299 | tst-regcomp-truncated \ | |
300 | tst-regex \ | |
301 | tst-regex2 \ | |
302 | tst-regexloc \ | |
303 | tst-rxspencer \ | |
304 | tst-rxspencer-no-utf8 \ | |
305 | tst-sched_getaffinity \ | |
306 | tst-spawn-chdir \ | |
307 | tst-spawn4 \ | |
308 | tst-spawn5 \ | |
309 | tst-spawn6 \ | |
310 | tst-spawn7 \ | |
311 | tst-sysconf \ | |
312 | tst-sysconf-empty-chroot \ | |
313 | tst-truncate \ | |
314 | tst-truncate64 \ | |
315 | tst-vfork1 \ | |
316 | tst-vfork2 \ | |
317 | tst-wait3 \ | |
318 | tst-wait4 \ | |
319 | tst-waitid \ | |
320 | tst-wordexp-nocmd \ | |
321 | tstgetopt \ | |
322 | # tests | |
8209c5f1 FW |
323 | |
324 | # Test for the glob symbol version that was replaced in glibc 2.27. | |
325 | ifeq ($(have-GLIBC_2.26)$(build-shared),yesyes) | |
12a4cfca AZ |
326 | tests += \ |
327 | tst-glob_lstat_compat | |
328 | # tests | |
8209c5f1 FW |
329 | endif |
330 | ||
63c317fe FW |
331 | # Test for the posix_spawn, posix_spawnp symbol versions replaced in |
332 | # glibc 2.15. | |
333 | ifeq ($(have-GLIBC_2.14)$(build-shared),yesyes) | |
12a4cfca AZ |
334 | tests += \ |
335 | tst-spawn4-compat \ | |
336 | # tests | |
63c317fe FW |
337 | endif |
338 | ||
12a4cfca | 339 | tests-internal := \ |
7b31c02d | 340 | bug-regex5 \ |
12a4cfca AZ |
341 | bug-regex20 \ |
342 | bug-regex33 \ | |
12a4cfca AZ |
343 | tst-rfc3484 \ |
344 | tst-rfc3484-2 \ | |
345 | tst-rfc3484-3 \ | |
346 | # tests-internal | |
347 | ||
348 | tests-container := \ | |
349 | bug-ga2 \ | |
350 | tst-vfork3 \ | |
351 | # tests-container | |
352 | ||
353 | tests-time64 := \ | |
354 | tst-gnuglob64-time64 \ | |
355 | tst-wait3-time64 \ | |
356 | tst-wait4-time64 \ | |
357 | # tests-time64 | |
358 | ||
359 | xtests := \ | |
360 | tst-getaddrinfo4 \ | |
361 | tst-getaddrinfo5 \ | |
362 | tst-sched_rr_get_interval \ | |
363 | # xtests | |
364 | ||
365 | xtests-time64 := \ | |
366 | tst-sched_rr_get_interval-time64 \ | |
367 | # xtests-time64 | |
368 | ||
df455ccb | 369 | ifeq (yes,$(build-shared)) |
12a4cfca AZ |
370 | test-srcs := \ |
371 | globtest | |
372 | # tests-src | |
373 | tests += \ | |
374 | tst-exec \ | |
375 | tst-spawn \ | |
376 | tst-spawn2 \ | |
377 | tst-spawn3 \ | |
378 | wordexp-test \ | |
379 | # tests | |
df455ccb | 380 | endif |
12a4cfca | 381 | |
544ce845 | 382 | ifeq (yesyes,$(build-shared)$(have-thread-library)) |
12a4cfca AZ |
383 | tests += \ |
384 | tst-_Fork \ | |
385 | tst-getopt-cancel \ | |
386 | # tests | |
544ce845 | 387 | endif |
28f540f4 | 388 | |
12a4cfca AZ |
389 | tests-static = \ |
390 | tst-exec-static \ | |
391 | tst-spawn-static \ | |
392 | # tests-static | |
393 | ||
394 | tests += \ | |
395 | $(tests-static) | |
396 | # tests | |
397 | ||
398 | others := \ | |
399 | getconf \ | |
400 | # others | |
401 | ||
402 | install-bin := \ | |
403 | getconf \ | |
404 | # getconf | |
405 | ||
406 | install-others-programs := \ | |
407 | $(inst_libexecdir)/getconf \ | |
408 | # install-others-programs | |
409 | ||
410 | before-compile += \ | |
411 | $(objpfx)posix-conf-vars-def.h \ | |
412 | # before-compile | |
4cca6b86 | 413 | |
414fd335 | 414 | # So they get cleaned up. |
12a4cfca AZ |
415 | generated += \ |
416 | $(addprefix wordexp-test-result, 1 2 3 4 5 6 7 8 9 10) \ | |
417 | annexc \ | |
418 | annexc.out \ | |
419 | bug-ga2-mem.out \ | |
420 | bug-ga2.mtrace \ | |
421 | bug-glob2-mem.out \ | |
422 | bug-glob2.mtrace \ | |
423 | bug-regex14-mem.out \ | |
424 | bug-regex14.mtrace \ | |
425 | bug-regex2-mem.out \ | |
426 | bug-regex2.mtrace \ | |
427 | bug-regex21-mem.out \ | |
428 | bug-regex21.mtrace \ | |
429 | bug-regex31-mem.out \ | |
430 | bug-regex31.mtrace \ | |
431 | bug-regex36.mtrace \ | |
432 | getconf.speclist \ | |
433 | ptestcases.h \ | |
434 | testcases.h \ | |
435 | tst-boost-mem.out \ | |
436 | tst-boost.mtrace \ | |
437 | tst-fnmatch-mem.out \ | |
438 | tst-fnmatch.mtrace \ | |
439 | tst-getconf.out \ | |
440 | tst-pcre-mem.out \ | |
441 | tst-pcre.mtrace \ | |
442 | tst-rxspencer-no-utf8-mem.out \ | |
443 | tst-rxspencer-no-utf8.mtrace \ | |
444 | tst-vfork3-mem.out \ | |
445 | tst-vfork3.mtrace \ | |
446 | wordexp-tst.out \ | |
447 | # generated | |
414fd335 | 448 | |
f214606a JM |
449 | ifeq ($(run-built-tests),yes) |
450 | ifeq (yes,$(build-shared)) | |
12a4cfca AZ |
451 | tests-special += \ |
452 | $(objpfx)globtest.out \ | |
453 | $(objpfx)wordexp-tst.out \ | |
454 | # tests-special | |
f214606a JM |
455 | endif |
456 | endif | |
457 | ||
458 | # Run a test on the header files we use. | |
459 | # XXX Please note that for now we ignore the result of this test. | |
460 | tests-special += $(objpfx)annexc.out | |
461 | ifeq ($(run-built-tests),yes) | |
12a4cfca AZ |
462 | tests-special += \ |
463 | $(objpfx)bug-ga2-mem.out \ | |
464 | $(objpfx)bug-glob2-mem.out \ | |
465 | $(objpfx)bug-regex14-mem.out \ | |
466 | $(objpfx)bug-regex2-mem.out \ | |
467 | $(objpfx)bug-regex21-mem.out \ | |
468 | $(objpfx)bug-regex31-mem.out \ | |
469 | $(objpfx)bug-regex36-mem.out \ | |
470 | $(objpfx)tst-boost-mem.out \ | |
471 | $(objpfx)tst-fnmatch-mem.out \ | |
472 | $(objpfx)tst-getconf.out \ | |
473 | $(objpfx)tst-glob-tilde-mem.out \ | |
474 | $(objpfx)tst-pcre-mem.out \ | |
475 | $(objpfx)tst-rxspencer-no-utf8-mem.out \ | |
476 | $(objpfx)tst-vfork3-mem.out \ | |
477 | # tests-special | |
f214606a JM |
478 | endif |
479 | ||
28f540f4 RM |
480 | include ../Rules |
481 | ||
03ac099f | 482 | ifeq ($(run-built-tests),yes) |
df455ccb AS |
483 | # globtest and wordexp-test currently only works with shared libraries |
484 | ifeq (yes,$(build-shared)) | |
3f36c563 | 485 | $(objpfx)globtest.out: globtest.sh $(objpfx)globtest |
740b3dbe | 486 | $(SHELL) $< $(common-objpfx) '$(test-via-rtld-prefix)' \ |
8f8052c2 | 487 | '$(test-program-prefix)' '$(test-wrapper-env)'; \ |
f0881698 | 488 | $(evaluate-test) |
3f36c563 | 489 | $(objpfx)wordexp-tst.out: wordexp-tst.sh $(objpfx)wordexp-test |
8540f6d2 | 490 | $(SHELL) $< $(common-objpfx) '$(test-program-prefix-before-env)' \ |
8f8052c2 | 491 | '$(run-program-env)' '$(test-program-prefix-after-env)'; \ |
f0881698 | 492 | $(evaluate-test) |
61eb22d3 | 493 | endif |
f881f6ff | 494 | |
466f2be6 | 495 | LOCALES := \ |
7b31c02d CD |
496 | C.UTF-8 \ |
497 | cs_CZ.ISO-8859-2 \ | |
498 | cs_CZ.UTF-8 \ | |
499 | da_DK.ISO-8859-1 \ | |
500 | de_DE.ISO-8859-1 \ | |
501 | de_DE.UTF-8 \ | |
502 | en_US.UTF-8 \ | |
503 | es_US.ISO-8859-1 \ | |
504 | es_US.UTF-8 \ | |
505 | ja_JP.EUC-JP \ | |
506 | tr_TR.UTF-8 \ | |
507 | # LOCALES | |
f881f6ff AS |
508 | include ../gen-locales.mk |
509 | ||
510 | $(objpfx)bug-regex1.out: $(gen-locales) | |
511 | $(objpfx)bug-regex4.out: $(gen-locales) | |
512 | $(objpfx)bug-regex5.out: $(gen-locales) | |
513 | $(objpfx)bug-regex6.out: $(gen-locales) | |
514 | $(objpfx)bug-regex17.out: $(gen-locales) | |
515 | $(objpfx)bug-regex18.out: $(gen-locales) | |
516 | $(objpfx)bug-regex19.out: $(gen-locales) | |
517 | $(objpfx)bug-regex20.out: $(gen-locales) | |
518 | $(objpfx)bug-regex22.out: $(gen-locales) | |
519 | $(objpfx)bug-regex23.out: $(gen-locales) | |
520 | $(objpfx)bug-regex25.out: $(gen-locales) | |
521 | $(objpfx)bug-regex26.out: $(gen-locales) | |
522 | $(objpfx)bug-regex30.out: $(gen-locales) | |
523 | $(objpfx)bug-regex32.out: $(gen-locales) | |
524 | $(objpfx)bug-regex33.out: $(gen-locales) | |
525 | $(objpfx)bug-regex34.out: $(gen-locales) | |
526 | $(objpfx)bug-regex35.out: $(gen-locales) | |
527 | $(objpfx)tst-fnmatch.out: $(gen-locales) | |
528 | $(objpfx)tst-fnmatch4.out: $(gen-locales) | |
529 | $(objpfx)tst-fnmatch5.out: $(gen-locales) | |
a140ff91 | 530 | $(objpfx)tst-fnmatch6.out: $(gen-locales) |
f881f6ff AS |
531 | $(objpfx)tst-regex.out: $(gen-locales) |
532 | $(objpfx)tst-regex2.out: $(gen-locales) | |
533 | $(objpfx)tst-regexloc.out: $(gen-locales) | |
534 | $(objpfx)tst-rxspencer.out: $(gen-locales) | |
535 | $(objpfx)tst-rxspencer-no-utf8.out: $(gen-locales) | |
761404b7 | 536 | $(objpfx)tst-regcomp-truncated.out: $(gen-locales) |
df455ccb | 537 | endif |
61eb22d3 | 538 | |
09055553 RM |
539 | # If we will use the generic uname implementation, we must figure out what |
540 | # it will say by examining the system, and write the results in config-name.h. | |
541 | uname.c: $(objpfx)config-name.h | |
542 | $(objpfx)config-name.h: $(..)scripts/config-uname.sh $(common-objpfx)config.make | |
848917f9 | 543 | $(make-target-directory) |
09055553 RM |
544 | $< '$(config-os)' '$(config-release)' \ |
545 | '$(config-machine)-$(config-vendor)' > $@.new | |
546 | mv -f $@.new $@ | |
547 | ||
36975e8e L |
548 | CFLAGS-getaddrinfo.c += -DRESOLVER -fexceptions |
549 | CFLAGS-pause.c += -fexceptions -fasynchronous-unwind-tables | |
550 | CFLAGS-pread.c += -fexceptions -fasynchronous-unwind-tables | |
8d98c7c0 | 551 | CFLAGS-pread64.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes) |
36975e8e | 552 | CFLAGS-pwrite.c += -fexceptions -fasynchronous-unwind-tables |
8d98c7c0 | 553 | CFLAGS-pwrite64.c += -fexceptions -fasynchronous-unwind-tables $(config-cflags-wno-ignored-attributes) |
36975e8e L |
554 | CFLAGS-sleep.c += -fexceptions |
555 | CFLAGS-wait.c += -fexceptions -fasynchronous-unwind-tables | |
556 | CFLAGS-waitid.c += -fexceptions -fasynchronous-unwind-tables | |
557 | CFLAGS-waitpid.c += -fexceptions -fasynchronous-unwind-tables | |
57e687c6 | 558 | CFLAGS-wait4.c += -fexceptions -fasynchronous-unwind-tables |
36975e8e L |
559 | CFLAGS-getopt.c += -fexceptions |
560 | CFLAGS-wordexp.c += -fexceptions | |
70fb71fd | 561 | CFLAGS-wordexp.os = -fomit-frame-pointer |
36975e8e L |
562 | CFLAGS-sysconf.c += -fexceptions -DGETCONF_DIR='"$(libexecdir)/getconf"' |
563 | CFLAGS-pathconf.c += -fexceptions | |
564 | CFLAGS-fpathconf.c += -fexceptions | |
565 | CFLAGS-spawn.c += -fexceptions | |
70fb71fd | 566 | CFLAGS-spawn.os = -fomit-frame-pointer |
36975e8e | 567 | CFLAGS-spawnp.c += -fexceptions |
70fb71fd | 568 | CFLAGS-spawnp.os = -fomit-frame-pointer |
36975e8e | 569 | CFLAGS-spawni.c += -fexceptions |
70fb71fd | 570 | CFLAGS-spawni.os = -fomit-frame-pointer |
36975e8e L |
571 | CFLAGS-glob.c += $(uses-callbacks) -fexceptions |
572 | CFLAGS-glob64.c += $(uses-callbacks) -fexceptions | |
573 | CFLAGS-getconf.c += -DGETCONF_DIR='"$(libexecdir)/getconf"' | |
70fb71fd UD |
574 | CFLAGS-execve.os = -fomit-frame-pointer |
575 | CFLAGS-fexecve.os = -fomit-frame-pointer | |
576 | CFLAGS-execv.os = -fomit-frame-pointer | |
577 | CFLAGS-execle.os = -fomit-frame-pointer | |
578 | CFLAGS-execl.os = -fomit-frame-pointer | |
579 | CFLAGS-execvp.os = -fomit-frame-pointer | |
580 | CFLAGS-execlp.os = -fomit-frame-pointer | |
36975e8e | 581 | CFLAGS-nanosleep.c += -fexceptions -fasynchronous-unwind-tables |
8d98c7c0 | 582 | CFLAGS-fork.c = $(libio-mtsafe) $(config-cflags-wno-ignored-attributes) |
7a114794 | 583 | |
e25054c4 | 584 | tstgetopt-ARGS = -a -b -cfoobar --required foobar --optional=bazbug \ |
b64cd08a | 585 | --none random --col --color --colour |
0793d348 | 586 | |
740b3dbe | 587 | tst-exec-ARGS = -- $(host-test-program-cmd) |
4cf8f209 | 588 | tst-exec-static-ARGS = $(tst-exec-ARGS) |
1eb89306 | 589 | tst-execvpe5-ARGS = -- $(host-test-program-cmd) |
740b3dbe | 590 | tst-spawn-ARGS = -- $(host-test-program-cmd) |
4cf8f209 | 591 | tst-spawn-static-ARGS = $(tst-spawn-ARGS) |
882d6e17 | 592 | tst-spawn5-ARGS = -- $(host-test-program-cmd) |
342cc934 | 593 | tst-spawn6-ARGS = -- $(host-test-program-cmd) |
2053c113 | 594 | tst-spawn7-ARGS = -- $(host-test-program-cmd) |
53e5cdd8 | 595 | tst-dir-ARGS = `pwd` `cd $(common-objdir)/$(subdir); pwd` `cd $(common-objdir); pwd` $(objpfx)tst-dir |
3aa65137 | 596 | tst-chmod-ARGS = $(objdir) |
df859a0c | 597 | tst-vfork3-ARGS = --test-dir=$(objpfx) |
079199de | 598 | |
c13c99fa | 599 | tst-rxspencer-ARGS = --utf8 rxspencer/tests |
7f98f180 | 600 | tst-rxspencer-no-utf8-ARGS = rxspencer/tests |
6c805a2b UD |
601 | tst-pcre-ARGS = PCRE.tests |
602 | tst-boost-ARGS = BOOST.tests | |
0da4ee55 | 603 | bug-glob1-ARGS = "$(objpfx)" |
506cbf1f | 604 | tst-execvp3-ARGS = --test-dir=$(objpfx) |
27f10a09 | 605 | CFLAGS-tst-spawn3.c += -DOBJPFX=\"$(objpfx)\" |
0d6af3a8 | 606 | |
250102c8 | 607 | $(objpfx)testcases.h: TESTS TESTS2C.sed |
3e6bd4b1 | 608 | LC_ALL=C sed -f TESTS2C.sed < $< > $@T |
250102c8 FW |
609 | mv $@T $@ |
610 | $(objpfx)runtests.o: $(objpfx)testcases.h | |
92040cbc | 611 | |
250102c8 | 612 | $(objpfx)ptestcases.h: PTESTS PTESTS2C.sed |
3e6bd4b1 | 613 | LC_ALL=C sed -f PTESTS2C.sed < $< > $@T |
250102c8 FW |
614 | mv $@T $@ |
615 | $(objpfx)runptests.o: $(objpfx)ptestcases.h | |
4959e310 | 616 | |
544ce845 | 617 | $(objpfx)tst-getopt-cancel: $(shared-thread-library) |
c32c868a | 618 | $(objpfx)tst-_Fork: $(shared-thread-library) |
544ce845 | 619 | |
f8c17e79 | 620 | test-xfail-annexc = yes |
3f36c563 | 621 | $(objpfx)annexc.out: $(objpfx)annexc |
f8c17e79 | 622 | $(dir $<)$(notdir $<) '$(CC)' \ |
f0881698 JM |
623 | '$(patsubst %,-I../%,$(sorted-subdirs)) -I../include $(+sysdep-includes) $(sysincludes) -I..' > $@; \ |
624 | $(evaluate-test) | |
4959e310 | 625 | |
e69924e3 | 626 | annexc-CFLAGS = -O |
4959e310 UD |
627 | $(objpfx)annexc: annexc.c |
628 | $(native-compile) | |
770d454d | 629 | |
2d2d9f2b SP |
630 | tst-fnmatch-ENV += MALLOC_TRACE=$(objpfx)tst-fnmatch.mtrace \ |
631 | LD_PRELOAD=$(common-objpfx)/malloc/libc_malloc_debug.so | |
3540d66b | 632 | |
0b20a9e8 | 633 | $(objpfx)tst-fnmatch-mem.out: $(objpfx)tst-fnmatch.out |
f0881698 JM |
634 | $(common-objpfx)malloc/mtrace $(objpfx)tst-fnmatch.mtrace > $@; \ |
635 | $(evaluate-test) | |
3540d66b | 636 | |
2d2d9f2b SP |
637 | bug-regex2-ENV = MALLOC_TRACE=$(objpfx)bug-regex2.mtrace \ |
638 | LD_PRELOAD=$(common-objpfx)/malloc/libc_malloc_debug.so | |
770d454d | 639 | |
0b20a9e8 | 640 | $(objpfx)bug-regex2-mem.out: $(objpfx)bug-regex2.out |
f0881698 JM |
641 | $(common-objpfx)malloc/mtrace $(objpfx)bug-regex2.mtrace > $@; \ |
642 | $(evaluate-test) | |
a3bbce5b | 643 | |
2d2d9f2b SP |
644 | bug-regex14-ENV = MALLOC_TRACE=$(objpfx)bug-regex14.mtrace \ |
645 | LD_PRELOAD=$(common-objpfx)/malloc/libc_malloc_debug.so | |
240e87c2 | 646 | |
0b20a9e8 | 647 | $(objpfx)bug-regex14-mem.out: $(objpfx)bug-regex14.out |
f0881698 JM |
648 | $(common-objpfx)malloc/mtrace $(objpfx)bug-regex14.mtrace > $@; \ |
649 | $(evaluate-test) | |
240e87c2 | 650 | |
2d2d9f2b SP |
651 | bug-regex21-ENV = MALLOC_TRACE=$(objpfx)bug-regex21.mtrace \ |
652 | LD_PRELOAD=$(common-objpfx)/malloc/libc_malloc_debug.so | |
ee70274a | 653 | |
0b20a9e8 | 654 | $(objpfx)bug-regex21-mem.out: $(objpfx)bug-regex21.out |
f0881698 JM |
655 | $(common-objpfx)malloc/mtrace $(objpfx)bug-regex21.mtrace > $@; \ |
656 | $(evaluate-test) | |
ee70274a | 657 | |
2d2d9f2b SP |
658 | bug-regex31-ENV = MALLOC_TRACE=$(objpfx)bug-regex31.mtrace \ |
659 | LD_PRELOAD=$(common-objpfx)/malloc/libc_malloc_debug.so | |
ef06edbe | 660 | |
0b20a9e8 | 661 | $(objpfx)bug-regex31-mem.out: $(objpfx)bug-regex31.out |
f0881698 JM |
662 | $(common-objpfx)malloc/mtrace $(objpfx)bug-regex31.mtrace > $@; \ |
663 | $(evaluate-test) | |
ef06edbe | 664 | |
2d2d9f2b SP |
665 | bug-regex36-ENV = MALLOC_TRACE=$(objpfx)bug-regex36.mtrace \ |
666 | LD_PRELOAD=$(common-objpfx)/malloc/libc_malloc_debug.so | |
4d43ef1e AS |
667 | |
668 | $(objpfx)bug-regex36-mem.out: $(objpfx)bug-regex36.out | |
669 | $(common-objpfx)malloc/mtrace $(objpfx)bug-regex36.mtrace > $@; \ | |
670 | $(evaluate-test) | |
671 | ||
2d2d9f2b SP |
672 | tst-vfork3-ENV = MALLOC_TRACE=$(objpfx)tst-vfork3.mtrace \ |
673 | LD_PRELOAD=$(common-objpfx)/malloc/libc_malloc_debug.so | |
df859a0c | 674 | |
0b20a9e8 | 675 | $(objpfx)tst-vfork3-mem.out: $(objpfx)tst-vfork3.out |
c142eb25 SP |
676 | { test -r $(objpfx)tst-vfork3.mtrace \ |
677 | || ( echo "tst-vfork3.mtrace does not exist"; exit 77; ) \ | |
678 | && $(common-objpfx)malloc/mtrace $(objpfx)tst-vfork3.mtrace; } > $@; \ | |
f0881698 | 679 | $(evaluate-test) |
df859a0c | 680 | |
7f98f180 JM |
681 | # tst-rxspencer.mtrace is not generated, only |
682 | # tst-rxspencer-no-utf8.mtrace, since otherwise the file has almost | |
683 | # 100M and takes very long time to process. | |
2d2d9f2b SP |
684 | tst-rxspencer-no-utf8-ENV += \ |
685 | MALLOC_TRACE=$(objpfx)tst-rxspencer-no-utf8.mtrace \ | |
686 | LD_PRELOAD=$(common-objpfx)/malloc/libc_malloc_debug.so | |
0b20a9e8 | 687 | $(objpfx)tst-rxspencer-no-utf8-mem.out: $(objpfx)tst-rxspencer-no-utf8.out |
f0881698 JM |
688 | $(common-objpfx)malloc/mtrace $(objpfx)tst-rxspencer-no-utf8.mtrace \ |
689 | > $@; \ | |
690 | $(evaluate-test) | |
ee70274a | 691 | |
2d2d9f2b SP |
692 | tst-pcre-ENV = MALLOC_TRACE=$(objpfx)tst-pcre.mtrace \ |
693 | LD_PRELOAD=$(common-objpfx)/malloc/libc_malloc_debug.so | |
0b20a9e8 | 694 | $(objpfx)tst-pcre-mem.out: $(objpfx)tst-pcre.out |
f0881698 JM |
695 | $(common-objpfx)malloc/mtrace $(objpfx)tst-pcre.mtrace > $@; \ |
696 | $(evaluate-test) | |
6c805a2b | 697 | |
2d2d9f2b SP |
698 | tst-boost-ENV = MALLOC_TRACE=$(objpfx)tst-boost.mtrace \ |
699 | LD_PRELOAD=$(common-objpfx)/malloc/libc_malloc_debug.so | |
0b20a9e8 | 700 | $(objpfx)tst-boost-mem.out: $(objpfx)tst-boost.out |
f0881698 JM |
701 | $(common-objpfx)malloc/mtrace $(objpfx)tst-boost.mtrace > $@; \ |
702 | $(evaluate-test) | |
6c805a2b | 703 | |
a3bbce5b | 704 | $(objpfx)tst-getconf.out: tst-getconf.sh $(objpfx)getconf |
8f8052c2 | 705 | $(SHELL) $< $(common-objpfx) '$(built-program-cmd)'; \ |
f0881698 | 706 | $(evaluate-test) |
64333c66 | 707 | |
0b20a9e8 | 708 | $(objpfx)bug-ga2-mem.out: $(objpfx)bug-ga2.out |
aa7e05c3 SL |
709 | { test -r $(objpfx)bug-ga2.mtrace \ |
710 | || ( echo "bug-ga2.mtrace does not exist"; exit 77; ) \ | |
711 | && $(common-objpfx)malloc/mtrace $(objpfx)bug-ga2.mtrace; } > $@; \ | |
f0881698 | 712 | $(evaluate-test) |
5605e117 | 713 | |
2d2d9f2b SP |
714 | bug-ga2-ENV = MALLOC_TRACE=$(objpfx)bug-ga2.mtrace \ |
715 | LD_PRELOAD=$(common-objpfx)/malloc/libc_malloc_debug.so | |
778cddad | 716 | |
2d2d9f2b SP |
717 | bug-glob2-ENV = MALLOC_TRACE=$(objpfx)bug-glob2.mtrace \ |
718 | LD_PRELOAD=$(common-objpfx)/malloc/libc_malloc_debug.so | |
778cddad | 719 | |
0b20a9e8 | 720 | $(objpfx)bug-glob2-mem.out: $(objpfx)bug-glob2.out |
f0881698 JM |
721 | $(common-objpfx)malloc/mtrace $(objpfx)bug-glob2.mtrace > $@; \ |
722 | $(evaluate-test) | |
28f367c4 | 723 | |
2d2d9f2b SP |
724 | tst-glob-tilde-ENV = MALLOC_TRACE=$(objpfx)tst-glob-tilde.mtrace \ |
725 | LD_PRELOAD=$(common-objpfx)/malloc/libc_malloc_debug.so | |
e80fc1fc FW |
726 | |
727 | $(objpfx)tst-glob-tilde-mem.out: $(objpfx)tst-glob-tilde.out | |
728 | $(common-objpfx)malloc/mtrace $(objpfx)tst-glob-tilde.mtrace > $@; \ | |
729 | $(evaluate-test) | |
730 | ||
db502a60 RM |
731 | $(inst_libexecdir)/getconf: $(inst_bindir)/getconf \ |
732 | $(objpfx)getconf.speclist FORCE | |
28f367c4 UD |
733 | $(addprefix $(..)./scripts/mkinstalldirs ,\ |
734 | $(filter-out $(wildcard $@),$@)) | |
db502a60 RM |
735 | while read spec; do \ |
736 | ln -f $< $@/$$spec.new || $(INSTALL_PROGRAM) $< $@/$$spec.new; \ | |
737 | mv -f $@/$$spec.new $@/$$spec; \ | |
738 | done < $(objpfx)getconf.speclist | |
739 | ||
531f1ae0 JM |
740 | $(objpfx)getconf.speclist: getconf-speclist.c posix-envs.def |
741 | $(compile.c) -E -o - \ | |
742 | | sed -n -e '/@@@PRESENT_/s/@@@PRESENT_//p' > $@.new | |
d9967a8b | 743 | mv -f $@.new $@ |
ad98e30c RM |
744 | |
745 | # This file is only actually needed at install time. But forcing it to | |
746 | # be built both makes it available for eyeball inspection and avoids the | |
747 | # surprise of things that look like compilation being done by 'make install'. | |
748 | others: $(objpfx)getconf.speclist | |
4a6aca7b SP |
749 | |
750 | $(objpfx)posix-conf-vars-def.h: $(..)scripts/gen-posix-conf-vars.awk \ | |
751 | posix-conf-vars.list Makefile | |
752 | $(make-target-directory) | |
753 | $(AWK) -f $(filter-out Makefile, $^) > $@.tmp | |
754 | mv -f $@.tmp $@ |