Makefile 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  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. # Makefile for time routines
  16. #
  17. subdir := time
  18. include ../Makeconfig
  19. headers := time.h sys/time.h sys/timeb.h bits/time.h \
  20. bits/types/clockid_t.h bits/types/clock_t.h \
  21. bits/types/struct_itimerspec.h \
  22. bits/types/struct_timespec.h bits/types/struct_timeval.h \
  23. bits/types/struct_tm.h bits/types/timer_t.h \
  24. bits/types/time_t.h bits/types/struct_timeb.h
  25. routines := offtime asctime clock ctime ctime_r difftime \
  26. gmtime localtime mktime time \
  27. gettimeofday settimeofday settimezone \
  28. adjtime tzset tzfile getitimer setitimer \
  29. stime dysize timegm ftime \
  30. getdate strptime strptime_l \
  31. strftime wcsftime strftime_l wcsftime_l \
  32. timespec_get timespec_getres \
  33. clock_getcpuclockid clock_getres \
  34. clock_gettime clock_settime clock_nanosleep
  35. aux := era alt_digit lc-time-cleanup
  36. tests := \
  37. bug-asctime \
  38. bug-asctime_r \
  39. bug-getdate1 \
  40. bug-mktime1 \
  41. bug-mktime4 \
  42. clocktest \
  43. test_time \
  44. tst-adjtime \
  45. tst-clock \
  46. tst-clock2 \
  47. tst-clock_gettime \
  48. tst-clock_nanosleep \
  49. tst-clock_settime \
  50. tst-cpuclock1 \
  51. tst-ctime \
  52. tst-difftime \
  53. tst-ftime \
  54. tst-ftime_l \
  55. tst-getdate \
  56. tst-gettimeofday \
  57. tst-gmtime \
  58. tst-itimer \
  59. tst-mktime \
  60. tst-mktime2 \
  61. tst-mktime3 \
  62. tst-mktime4 \
  63. tst-posixtz \
  64. tst-settimeofday \
  65. tst-strftime \
  66. tst-strftime2 \
  67. tst-strftime3 \
  68. tst-strftime4 \
  69. tst-strptime \
  70. tst-strptime-whitespace \
  71. tst-strptime2 \
  72. tst-strptime3 \
  73. tst-time \
  74. tst-timegm \
  75. tst-timespec_get \
  76. tst-timespec_getres \
  77. tst-tzfile-fault \
  78. tst-tzname \
  79. tst-y2039 \
  80. tst_wcsftime \
  81. # tests
  82. tests-time64 := \
  83. tst-adjtime-time64 \
  84. tst-clock-time64 \
  85. tst-clock2-time64 \
  86. tst-clock_gettime-time64 \
  87. tst-clock_nanosleep-time64 \
  88. tst-clock_settime-time64 \
  89. tst-cpuclock1-time64 \
  90. tst-ctime-time64 \
  91. tst-difftime-time64 \
  92. tst-gettimeofday-time64 \
  93. tst-gmtime-time64 \
  94. tst-itimer-time64 \
  95. tst-mktime4-time64 \
  96. tst-settimeofday-time64 \
  97. tst-strftime4-time64 \
  98. tst-time-time64 \
  99. tst-timegm-time64 \
  100. tst-timespec_get-time64 \
  101. tst-timespec_getres-time64 \
  102. tst-y2039-time64
  103. include ../Rules
  104. ifeq ($(run-built-tests),yes)
  105. LOCALES := de_DE.ISO-8859-1 en_US.ISO-8859-1 ja_JP.EUC-JP fr_FR.UTF-8 \
  106. es_ES.UTF-8 pl_PL.UTF-8 ru_RU.UTF-8 \
  107. ja_JP.UTF-8 lo_LA.UTF-8 th_TH.UTF-8 \
  108. zh_TW.UTF-8 cmn_TW.UTF-8 hak_TW.UTF-8 \
  109. nan_TW.UTF-8 lzh_TW.UTF-8
  110. include ../gen-locales.mk
  111. $(objpfx)tst-ftime_l.out: $(gen-locales)
  112. $(objpfx)tst-strptime.out: $(gen-locales)
  113. $(objpfx)tst-strftime2.out: $(gen-locales)
  114. $(objpfx)tst-strftime3.out: $(gen-locales)
  115. endif
  116. $(objpfx)tst-clock_gettime: $(librt)
  117. $(objpfx)tst-clock_gettime-time64: $(librt)
  118. $(objpfx)tst-clock_nanosleep: $(librt)
  119. $(objpfx)tst-clock_nanosleep-time64: $(librt)
  120. tz-cflags = -DTZDIR='"$(zonedir)"' \
  121. -DTZDEFAULT='"$(localtime-file)"' \
  122. -DTZDEFRULES='"$(posixrules-file)"'
  123. CFLAGS-tzfile.c += $(tz-cflags)
  124. CFLAGS-tzset.c += $(tz-cflags)
  125. CFLAGS-getdate.c += -fexceptions
  126. CFLAGS-clock_nanosleep.c += -fexceptions -fasynchronous-unwind-tables
  127. CFLAGS-nanosleep.c += -fexceptions -fasynchronous-unwind-tables
  128. # Don't warn about Y2k problem in strftime format string.
  129. CFLAGS-test_time.c += -Wno-format
  130. test_time-ARGS= EST5EDT CST
  131. tst-tzname-ENV = TZDIR=${common-objpfx}timezone/testdata
  132. CPPFLAGS-tst-tzname.c += -DTZDEFRULES='"$(posixrules-file)"'
  133. bug-getdate1-ARGS = ${objpfx}bug-getdate1-fmt
  134. tst-tzfile-fault-ENV = GLIBC_TUNABLES=glibc.rtld.enable_secure=1