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