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