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