Makefile 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. # Copyright (C) 1997-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 real-time portion of the library.
  16. #
  17. subdir := rt
  18. include ../Makeconfig
  19. headers := aio.h mqueue.h bits/mqueue.h bits/mqueue2.h
  20. routines = \
  21. shm_open \
  22. shm_unlink \
  23. librt-routines = librt-compat
  24. librt-shared-only-routines = librt-compat
  25. $(librt-routines-var) += \
  26. aio_cancel \
  27. aio_error \
  28. aio_fsync \
  29. aio_misc \
  30. aio_notify \
  31. aio_read \
  32. aio_read64 \
  33. aio_return \
  34. aio_sigqueue \
  35. aio_suspend \
  36. aio_write \
  37. aio_write64 \
  38. lio_listio \
  39. lio_listio64 \
  40. mq_close \
  41. mq_getattr \
  42. mq_notify \
  43. mq_open \
  44. mq_receive \
  45. mq_send \
  46. mq_setattr \
  47. mq_timedreceive \
  48. mq_timedsend \
  49. mq_unlink \
  50. timer_create \
  51. timer_delete \
  52. timer_getoverr \
  53. timer_gettime \
  54. timer_settime \
  55. ifeq ($(pthread-in-libc),yes)
  56. # Pretend that librt.so is a linker script, so that the symbolic
  57. # link is not installed.
  58. install-lib-ldscripts = librt.so
  59. $(inst_libdir)/librt.so:
  60. endif
  61. tests := tst-shm tst-timer tst-timer2 \
  62. tst-aio tst-aio64 tst-aio2 tst-aio3 tst-aio4 tst-aio5 tst-aio6 \
  63. tst-aio7 tst-aio8 tst-aio9 tst-aio10 \
  64. tst-mqueue1 tst-mqueue2 tst-mqueue3 tst-mqueue4 \
  65. tst-mqueue5 tst-mqueue6 tst-mqueue7 tst-mqueue8 tst-mqueue9 \
  66. tst-bz28213 \
  67. tst-timer3 tst-timer4 tst-timer5 \
  68. tst-cpuclock2 tst-cputimer1 tst-cputimer2 tst-cputimer3 \
  69. tst-clock_nanosleep2 \
  70. tst-shm-cancel \
  71. tst-mqueue10
  72. tests-internal := tst-timer-sigmask
  73. tests-time64 := \
  74. tst-aio6-time64 \
  75. tst-cpuclock2-time64 \
  76. tst-clock_nanosleep2-time64 \
  77. tst-mqueue1-time64 \
  78. tst-mqueue2-time64 \
  79. tst-mqueue4-time64 \
  80. tst-mqueue8-time64 \
  81. tst-mqueue10-time64 \
  82. tst-timer4-time64
  83. extra-libs := librt
  84. extra-libs-others := $(extra-libs)
  85. include ../Rules
  86. CFLAGS-aio_suspend.c += -fexceptions
  87. CFLAGS-mq_timedreceive.c += -fexceptions -fasynchronous-unwind-tables
  88. CFLAGS-mq_timedsend.c += -fexceptions -fasynchronous-unwind-tables
  89. # Exclude fortified routines from being built with _FORTIFY_SOURCE
  90. routines_no_fortify += \
  91. mq_open \
  92. # routines_no_fortify
  93. LDFLAGS-rt.so = -Wl,--enable-new-dtags,-z,nodelete
  94. $(objpfx)librt.so: $(shared-thread-library)
  95. ifneq ($(pthread-in-libc),yes)
  96. ifeq (yes,$(build-shared))
  97. $(addprefix $(objpfx),$(tests) $(tests-internal)): \
  98. $(objpfx)librt.so $(shared-thread-library)
  99. else
  100. $(addprefix $(objpfx),$(tests)) $(tests-internal): \
  101. $(objpfx)librt.a $(static-thread-library)
  102. endif
  103. endif # !$(pthread-in-libc)
  104. tst-mqueue7-ARGS = -- $(host-test-program-cmd)