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