Makefile 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. # Copyright (C) 1991-2026 Free Software Foundation, Inc.
  2. # This file is part of the GNU C Library.
  3. # The GNU C Library is free software; you can redistribute it and/or
  4. # modify it under the terms of the GNU Lesser General Public
  5. # License as published by the Free Software Foundation; either
  6. # version 2.1 of the License, or (at your option) any later version.
  7. # The GNU C Library is distributed in the hope that it will be useful,
  8. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  10. # Lesser General Public License for more details.
  11. # You should have received a copy of the GNU Lesser General Public
  12. # License along with the GNU C Library; if not, see
  13. # <https://www.gnu.org/licenses/>.
  14. #
  15. # Sub-makefile for dirent portion of the library.
  16. #
  17. subdir := dirent
  18. include ../Makeconfig
  19. headers := \
  20. bits/dirent.h \
  21. bits/dirent_ext.h \
  22. dirent.h \
  23. # headers
  24. routines := \
  25. alphasort \
  26. alphasort64 \
  27. closedir \
  28. dirfd \
  29. fdopendir \
  30. getdents \
  31. getdents64 \
  32. opendir \
  33. readdir \
  34. readdir64 \
  35. readdir64_r \
  36. readdir_r \
  37. rewinddir \
  38. scandir \
  39. scandir-cancel \
  40. scandir-tail \
  41. scandir64 \
  42. scandir64-tail \
  43. scandirat \
  44. scandirat64 \
  45. seekdir \
  46. telldir \
  47. versionsort \
  48. versionsort64 \
  49. # routines
  50. tests := \
  51. bug-readdir1 \
  52. list \
  53. opendir-tst1 \
  54. tst-closedir-leaks \
  55. tst-fdopendir \
  56. tst-fdopendir2 \
  57. tst-readdir-long \
  58. tst-readdir-zero-inode \
  59. tst-rewinddir \
  60. tst-scandir \
  61. tst-scandir64 \
  62. tst-seekdir \
  63. # tests
  64. ifeq ($(run-built-tests),yes)
  65. ifneq ($(PERL),no)
  66. generated += \
  67. $(objpfx)tst-closedir-leaks-mem.out \
  68. # generated
  69. tests-special += \
  70. $(objpfx)tst-closedir-leaks-mem.out \
  71. # tests-special
  72. endif # $(PERL) ! no
  73. endif # $(run-built-tests) == yes
  74. CFLAGS-scandir.c += $(uses-callbacks)
  75. CFLAGS-scandir64.c += $(uses-callbacks)
  76. CFLAGS-scandir-tail.c += $(uses-callbacks)
  77. CFLAGS-scandir64-tail.c += $(uses-callbacks)
  78. include ../Rules
  79. opendir-tst1-ARGS = --test-dir=${common-objpfx}dirent
  80. tst-closedir-leaks-ENV += MALLOC_TRACE=$(objpfx)tst-closedir-leaks.mtrace \
  81. LD_PRELOAD=$(common-objpfx)/malloc/libc_malloc_debug.so
  82. $(objpfx)tst-closedir-leaks-mem.out: $(objpfx)tst-closedir-leaks.out
  83. $(common-objpfx)malloc/mtrace $(objpfx)tst-closedir-leaks.mtrace > $@; \
  84. $(evaluate-test)