Makefile 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259
  1. #
  2. # Copyright (C) 1994-2026 Free Software Foundation, Inc.
  3. #
  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.
  8. # The GNU C Library is distributed in the hope that it will be useful,
  9. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. # Lesser General Public License for more details.
  12. # You should have received a copy of the GNU Lesser General Public
  13. # License along with the GNU C Library; if not, see
  14. # <https://www.gnu.org/licenses/>.
  15. subdir := htl
  16. srcdir = .
  17. MICROKERNEL := mach
  18. SYSDEPS :=
  19. LCLHDRS :=
  20. libpthread-routines :=
  21. headers := \
  22. bits/cancelation.h \
  23. bits/pthread-np.h \
  24. bits/pthread.h \
  25. bits/pthreadtypes-arch.h \
  26. bits/pthreadtypes.h \
  27. bits/semaphore.h \
  28. bits/thread-shared-types.h \
  29. bits/types/__pthread_key.h \
  30. bits/types/__pthread_spinlock_t.h \
  31. bits/types/__pthread_t.h \
  32. bits/types/__thrd_t.h \
  33. bits/types/struct___pthread_attr.h \
  34. bits/types/struct___pthread_barrier.h \
  35. bits/types/struct___pthread_barrierattr.h \
  36. bits/types/struct___pthread_cond.h \
  37. bits/types/struct___pthread_condattr.h \
  38. bits/types/struct___pthread_mutex.h \
  39. bits/types/struct___pthread_mutexattr.h \
  40. bits/types/struct___pthread_once.h \
  41. bits/types/struct___pthread_rwlock.h \
  42. bits/types/struct___pthread_rwlockattr.h \
  43. pthread.h \
  44. semaphore.h \
  45. # headers
  46. distribute :=
  47. routines := \
  48. alloca_cutoff \
  49. cancellation \
  50. htlfreeres \
  51. pt-alloc \
  52. pt-attr \
  53. pt-attr-destroy \
  54. pt-attr-getdetachstate \
  55. pt-attr-getguardsize \
  56. pt-attr-getinheritsched \
  57. pt-attr-getschedparam \
  58. pt-attr-getschedpolicy \
  59. pt-attr-getscope \
  60. pt-attr-getstack \
  61. pt-attr-getstackaddr \
  62. pt-attr-getstacksize \
  63. pt-attr-init \
  64. pt-attr-setdetachstate \
  65. pt-attr-setguardsize \
  66. pt-attr-setinheritsched \
  67. pt-attr-setschedparam \
  68. pt-attr-setschedpolicy \
  69. pt-attr-setscope \
  70. pt-attr-setstack \
  71. pt-attr-setstackaddr \
  72. pt-attr-setstacksize \
  73. pt-barrier \
  74. pt-barrier-destroy \
  75. pt-barrier-init \
  76. pt-barrier-wait \
  77. pt-barrierattr-destroy \
  78. pt-barrierattr-getpshared \
  79. pt-barrierattr-init \
  80. pt-barrierattr-setpshared \
  81. pt-block \
  82. pt-block-intr \
  83. pt-cancel \
  84. pt-cleanup \
  85. pt-cond \
  86. pt-cond-brdcast \
  87. pt-cond-destroy \
  88. pt-cond-init \
  89. pt-cond-signal \
  90. pt-cond-timedwait \
  91. pt-cond-wait \
  92. pt-condattr-destroy \
  93. pt-condattr-getclock \
  94. pt-condattr-getpshared \
  95. pt-condattr-init \
  96. pt-condattr-setclock \
  97. pt-condattr-setpshared \
  98. pt-create \
  99. pt-dealloc \
  100. pt-destroy-specific \
  101. pt-detach \
  102. pt-docancel \
  103. pt-exit \
  104. pt-getattr \
  105. pt-getconcurrency \
  106. pt-getcpuclockid \
  107. pt-getname-np \
  108. pt-getschedparam \
  109. pt-getspecific \
  110. pt-hurd-cond-timedwait \
  111. pt-hurd-cond-wait \
  112. pt-init-specific \
  113. pt-join \
  114. pt-key-create \
  115. pt-key-delete \
  116. pt-kill \
  117. pt-machdep \
  118. pt-mutex-checklocked \
  119. pt-mutex-consistent \
  120. pt-mutex-destroy \
  121. pt-mutex-getprioceiling \
  122. pt-mutex-init \
  123. pt-mutex-lock \
  124. pt-mutex-setprioceiling \
  125. pt-mutex-timedlock \
  126. pt-mutex-transfer-np \
  127. pt-mutex-trylock \
  128. pt-mutex-unlock \
  129. pt-mutexattr-destroy \
  130. pt-mutexattr-getprioceiling \
  131. pt-mutexattr-getprotocol \
  132. pt-mutexattr-getpshared \
  133. pt-mutexattr-getrobust \
  134. pt-mutexattr-gettype \
  135. pt-mutexattr-init \
  136. pt-mutexattr-setprioceiling \
  137. pt-mutexattr-setprotocol \
  138. pt-mutexattr-setpshared \
  139. pt-mutexattr-setrobust \
  140. pt-mutexattr-settype \
  141. pt-nthreads \
  142. pt-once \
  143. pt-pthread_self \
  144. pt-rwlock-attr \
  145. pt-rwlock-destroy \
  146. pt-rwlock-init \
  147. pt-rwlock-rdlock \
  148. pt-rwlock-timedrdlock \
  149. pt-rwlock-timedwrlock \
  150. pt-rwlock-tryrdlock \
  151. pt-rwlock-trywrlock \
  152. pt-rwlock-unlock \
  153. pt-rwlock-wrlock \
  154. pt-rwlockattr-destroy \
  155. pt-rwlockattr-getpshared \
  156. pt-rwlockattr-init \
  157. pt-rwlockattr-setpshared \
  158. pt-self pt-equal \
  159. pt-setcancelstate \
  160. pt-setcanceltype \
  161. pt-setconcurrency \
  162. pt-setname-np \
  163. pt-setschedparam \
  164. pt-setschedprio \
  165. pt-setspecific \
  166. pt-setup \
  167. pt-sigmask \
  168. pt-sigstate \
  169. pt-sigstate-destroy \
  170. pt-sigstate-init \
  171. pt-spin-inlines \
  172. pt-stack-alloc \
  173. pt-startup \
  174. pt-sysdep \
  175. pt-testcancel \
  176. pt-thread-alloc \
  177. pt-thread-start \
  178. pt-thread-terminate \
  179. pt-timedblock \
  180. pt-timedblock-intr \
  181. pt-wakeup \
  182. pt-yield \
  183. sem-destroy \
  184. sem-getvalue \
  185. sem-init \
  186. sem-post \
  187. sem-timedwait \
  188. sem-trywait \
  189. sem-wait \
  190. sem-waitfast \
  191. sem_close \
  192. sem_open \
  193. sem_routines \
  194. sem_unlink \
  195. # routines
  196. extra-libs := libpthread
  197. extra-libs-others := $(extra-libs)
  198. install-lib := libpthread.so
  199. install-lib-ldscripts := libpthread_syms.a
  200. include ../Makeconfig
  201. all: # Make this the default target; it will be defined in Rules.
  202. subdir_install: $(inst_libdir)/libpthread2.a $(inst_libdir)/libpthread_syms.a
  203. # XXX: If $(inst_libdir)/libpthread2.a is installed and
  204. # $(inst_libdir)/libpthread is not, we can have some issues.
  205. .PHONY: $(inst_libdir)/libpthread.a $(inst_libdir)/libpthread_pic.a
  206. # XXX: These rules are a hack. But it is better than messing with
  207. # ../Makeconf at the moment. Note that the linker scripts
  208. # $(srcdir)/libpthread.a and $(srcdir)/libpthread_pic.a get overwritten
  209. # when building in $(srcdir) and not a separate build directory.
  210. $(inst_libdir)/libpthread2.a: $(inst_libdir)/libpthread.a
  211. mv $< $@
  212. $(INSTALL_DATA) $(srcdir)/libpthread.a $<
  213. $(inst_libdir)/libpthread2_pic.a: $(inst_libdir)/libpthread_pic.a
  214. mv $< $@
  215. $(INSTALL_DATA) $(srcdir)/libpthread_pic.a $<
  216. $(inst_libdir)/libpthread_syms.a: $(srcdir)/libpthread_syms.a $(+force)
  217. $(do-install)
  218. libc-link.so = $(common-objpfx)libc.so
  219. extra-B-pthread.so = -B$(common-objpfx)htl/
  220. LDFLAGS-pthread.so = -Wl,--enable-new-dtags,-z,nodelete,-z,initfirst
  221. include ../Rules
  222. # Make sure we link with the thread library.
  223. ifeq ($(build-shared),yes)
  224. $(addprefix $(objpfx), \
  225. $(filter-out $(tests-static) $(xtests-static) $(tests-reverse) \
  226. $(tests-nolibpthread), \
  227. $(tests) $(tests-internal) $(xtests) $(test-srcs) $(tests-container))): \
  228. $(objpfx)libpthread.so
  229. # $(objpfx)../libc.so is used instead of $(common-objpfx)libc.so,
  230. # since otherwise libpthread.so comes before libc.so when linking.
  231. $(addprefix $(objpfx), $(tests-reverse)): \
  232. $(objpfx)../libc.so $(objpfx)libpthread.so
  233. $(objpfx)../libc.so: $(common-objpfx)libc.so ;
  234. $(addprefix $(objpfx),$(tests-static) $(xtests-static)): $(srcdir)/libpthread_syms.a $(objpfx)libpthread.a
  235. else
  236. $(addprefix $(objpfx),$(tests) $(test-srcs)): $(srcdir)/libpthread_syms.a $(objpfx)libpthread.a
  237. endif