nptl: Add pthread_mutex_getprioceiling and pthread_mutex_setprioceiling support
[uclibc-ng.git] / libpthread / nptl / Makefile.in
blobbd220ba8f334117262d6b8bc2b1d61d33f9b33b9
1 # Makefile for uClibc NPTL
3 # Copyright (C) 2005-2006 Steven J. Hill <sjhill@realitydiluted.com>
5 # Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
8 subdirs += libpthread/nptl
10 libpthread_DIR = $(top_srcdir)libpthread/nptl
11 libpthread_OUT = $(top_builddir)libpthread/nptl
13 include $(libpthread_DIR)/sysdeps/Makefile.in
15 libc-shared-routines-y = libc-cancellation.c
16 libc-static-routines-y = alloca_cutoff.c libc-cancellation.c
17 libpthread-shared-only-routines-y = version.c
18 libpthread-static-only-routines-y = pthread_atfork.c
19 libpthread-routines- += $(notdir $(wildcard $(libpthread_DIR)/gen_*.c)) # dummy generated files
20 libpthread-routines- += allocatestack.c # dummy included by pthread_create.c
21 libpthread-routines-$(UCLIBC_SUSV4_LEGACY) += pthread_getconcurrency.c \
22 pthread_setconcurrency.c
23 libpthread_CSRC = $(filter-out $(libpthread-routines-) \
24 $(libc-shared-routines-y) \
25 $(libc-static-routines-y) \
26 $(libpthread-shared-only-routines-y) \
27 $(libpthread-static-only-routines-y) \
28 $(notdir $(libpthread_OBJS:.o=.c)), \
29 $(notdir $(wildcard $(libpthread_DIR)/*.c)))
31 libpthread_OBJS += $(addprefix $(libpthread_OUT)/,$(libpthread_CSRC:.c=.o))
32 libpthread-so-y += $(addprefix $(libpthread_OUT)/,$(libpthread-shared-only-routines-y:.c=.oS))
33 libpthread-so-y += $(libpthread_OBJS:.o=.oS)
34 libpthread-nonshared-y := $(addprefix $(libpthread_OUT)/,$(libpthread-static-only-routines-y:.c=.oS))
35 libpthread-static-y := $(addprefix $(libpthread_OUT)/,$(libpthread-static-only-routines-y:.c=.o))
36 libpthread-static-y += $(libpthread_OBJS)
37 ifeq ($(DOPIC),y)
38 libpthread-a-y := $(libpthread-static-y:.o=.os)
39 else
40 libpthread-a-y := $(libpthread-static-y)
41 endif
43 libc-shared-routines-y := $(filter-out $(notdir $(libpthread_libc_OBJS:.o=.c)), $(libc-shared-routines-y))
44 libc-static-routines-y := $(filter-out $(notdir $(libpthread_libc_OBJS:.o=.c)), $(libc-static-routines-y))
45 libc-shared-routines-y := $(addprefix $(libpthread_OUT)/,$(libc-shared-routines-y:.c=.oS))
46 libc-static-routines-y := $(addprefix $(libpthread_OUT)/,$(libc-static-routines-y:.c=.o))
47 libc-shared-y += $(libc-shared-routines-y) $(libpthread_libc_OBJS:.o=.oS)
48 ifeq ($(DOPIC),y)
49 libc-static-y += $(libc-static-routines-y:.o=.os) $(libpthread_libc_a_OBJS:.o=.os) $(libpthread_ld_tls_COBJ:.o=.os)
50 else
51 libc-static-y += $(libc-static-routines-y) $(libpthread_libc_a_OBJS) $(libpthread_ld_tls_COBJ)
52 endif
54 librt-pt-routines-y := $(patsubst %.c,$(libpthread_pthread_OUT)/%.o,$(filter-out $(notdir $(libpthread_librt_OBJS:.o=.c)), $(librt-pt-routines-y)))
55 librt-pt-shared-only-routines-y := $(patsubst %.c,$(libpthread_pthread_OUT)/%.o,$(filter-out $(notdir $(libpthread_librt_OBJS:.o=.c)), $(librt-pt-shared-only-routines-y)))
56 librt_OBJS = $(libpthread_librt_OBJS) $(librt-pt-routines-y)
57 ifeq ($(DOPIC),y)
58 librt-a-y += $(librt_OBJS:.o=.os)
59 else
60 librt-a-y += $(librt_OBJS)
61 endif
62 librt-so-y += $(librt_OBJS:.o=.oS) $(librt-pt-shared-only-routines-y:.o=.oS)
64 $(libpthread_OUT)/pthread-errnos.h: $(top_srcdir)extra/scripts/gen-as-const.awk
65 $(libpthread_OUT)/pthread-errnos.h: $(libpthread_DIR)/pthread-errnos.sym
66 @$(disp_gen)
67 $(do_awk) $(top_srcdir)extra/scripts/gen-as-const.awk $< \
68 | $(CC) $(CFLAGS) -x c - -S -o - \
69 | $(SED) $(PTHREAD_GENERATE_MANGLE) > $@
70 @if test ! -s $@ ; then rm -f $@ ; false ; fi
72 pregen-headers-$(UCLIBC_HAS_THREADS_NATIVE) += $(libpthread_OUT)/pthread-errnos.h
74 headers-$(UCLIBC_HAS_THREADS_NATIVE) += $(nptl_headers_bootstrap)
76 libpthread_H := $(addprefix $(top_builddir)include/,semaphore.h)
77 libpthread_include_H := $(addprefix $(top_builddir)include/,pthread.h)
78 libpthread_include_BITS_H := $(addprefix $(top_builddir)include/bits/,libc-lock.h stdio-lock.h)
79 libpthread_include_STD_IMPL_OS_ARCH_BITS_H := $(addprefix $(top_builddir)include/bits/,pthreadtypes.h semaphore.h)
81 $(libpthread_include_STD_IMPL_OS_ARCH_BITS_H): $(top_builddir)include/bits/%:
82 $(do_ln) $(call rel_srcdir)$(PTDIR)/sysdeps/unix/sysv/linux/$(TARGET_ARCH)/bits/$(@F) $@
83 $(libpthread_include_BITS_H): $(top_builddir)include/bits/%:
84 $(do_ln) $(call rel_srcdir)$(PTDIR)/sysdeps/pthread/bits/$(@F) $@
85 $(libpthread_include_H): $(top_builddir)include/%:
86 $(do_ln) $(call rel_srcdir)$(PTDIR)/sysdeps/pthread/$(@F) $@
87 $(libpthread_H): $(top_builddir)include/%:
88 $(do_ln) $(call rel_srcdir)$(PTDIR)/$(@F) $@
90 nptl_headers_bootstrap = $(libpthread_H) $(libpthread_include_H) $(libpthread_include_BITS_H) $(libpthread_include_STD_IMPL_OS_ARCH_BITS_H)
92 objclean-y += CLEAN_libpthread/nptl
93 headers_clean-y += HEADERCLEAN_libpthread/nptl
95 HEADERCLEAN_libpthread/nptl:
96 $(do_rm) $(nptl_headers_bootstrap) \
97 $(libpthread_OUT)/pthread-errnos.h
99 CLEAN_libpthread/nptl:
100 $(do_rm) $(addprefix $(libpthread_OUT)/*., o os oS a)
102 CFLAGS-dir_nptl := -DNOT_IN_libc -DIS_IN_libpthread
103 CFLAGS-libpthread/nptl := $(CFLAGS-dir_nptl) $(SSP_ALL_CFLAGS)
105 # Since cancellation handling is in large parts handled using exceptions
106 # we have to compile some files with exception handling enabled, some
107 # even with asynchronous unwind tables.
109 # init.c contains sigcancel_handler().
110 CFLAGS-init.c = -fexceptions -fasynchronous-unwind-tables
111 # The unwind code itself,
112 CFLAGS-unwind.c = -fexceptions
113 CFLAGS-unwind-forcedunwind.c = -fexceptions -fasynchronous-unwind-tables
115 # The following three functions must be async-cancel safe.
116 CFLAGS-pthread_cancel.c = -fexceptions -fasynchronous-unwind-tables
117 CFLAGS-pthread_setcancelstate.c = -fexceptions -fasynchronous-unwind-tables
118 CFLAGS-pthread_setcanceltype.c = -fexceptions -fasynchronous-unwind-tables
120 # These are internal functions which similar functionality as setcancelstate
121 # and setcanceltype.
122 CFLAGS-cancellation.c = -fasynchronous-unwind-tables
123 CFLAGS-libc-cancellation.c = -fasynchronous-unwind-tables
125 # Calling pthread_exit() must cause the registered cancel handlers to
126 # be executed. Therefore exceptions have to be thrown through this
127 # function.
128 CFLAGS-pthread_exit.c = -fexceptions
130 # The following are cancellation points. Some of the functions can
131 # block and therefore temporarily enable asynchronous cancellation.
132 # Those must be compiled asynchronous unwind tables.
133 CFLAGS-pthread_testcancel.c = -fexceptions
134 CFLAGS-pthread_join.c = -fexceptions -fasynchronous-unwind-tables
135 CFLAGS-pthread_timedjoin.c = -fexceptions -fasynchronous-unwind-tables
136 CFLAGS-pthread_once.c = $(uses-callbacks) -fexceptions \
137 -fasynchronous-unwind-tables
138 CFLAGS-pthread_cond_wait.c = -fexceptions -fasynchronous-unwind-tables
139 CFLAGS-pthread_cond_timedwait.c = -fexceptions -fasynchronous-unwind-tables
140 CFLAGS-sem_wait.c = -fexceptions -fasynchronous-unwind-tables
141 CFLAGS-sem_timedwait.c = -fexceptions -fasynchronous-unwind-tables
143 # These are the function wrappers we have to duplicate here.
144 CFLAGS-accept.c = -fexceptions -fasynchronous-unwind-tables
145 CFLAGS-clock_nanosleep.c = -fexceptions -fasynchronous-unwind-tables
146 CFLAGS-close.c = -fexceptions -fasynchronous-unwind-tables
147 CFLAGS-connect.c = -fexceptions -fasynchronous-unwind-tables
148 CFLAGS-creat.c = -fexceptions -fasynchronous-unwind-tables
149 CFLAGS-fdatasync.c = -fexceptions -fasynchronous-unwind-tables
150 CFLAGS-fsync.c = -fexceptions -fasynchronous-unwind-tables
151 CFLAGS-lockf.c = -fexceptions
152 CFLAGS-msgrcv.c = -fexceptions -fasynchronous-unwind-tables
153 CFLAGS-msgsnd.c = -fexceptions -fasynchronous-unwind-tables
154 CFLAGS-msync.c = -fexceptions -fasynchronous-unwind-tables
155 CFLAGS-nanosleep.c = -fexceptions -fasynchronous-unwind-tables
156 CFLAGS-open64.c = -fexceptions -fasynchronous-unwind-tables
157 CFLAGS-open.c = -fexceptions -fasynchronous-unwind-tables
158 CFLAGS-pause.c = -fexceptions -fasynchronous-unwind-tables
159 CFLAGS-poll.c = -fexceptions -fasynchronous-unwind-tables
160 CFLAGS-ppoll.c = -fexceptions -fasynchronous-unwind-tables
161 CFLAGS-pread_write.c = -fexceptions -fasynchronous-unwind-tables
162 CFLAGS-pselect.c = -fexceptions -fasynchronous-unwind-tables
163 CFLAGS-read.c = -fexceptions -fasynchronous-unwind-tables
164 CFLAGS-readv.c = -fexceptions -fasynchronous-unwind-tables
165 CFLAGS-recv.c = -fexceptions -fasynchronous-unwind-tables
166 CFLAGS-recvfrom.c = -fexceptions -fasynchronous-unwind-tables
167 CFLAGS-recvmsg.c = -fexceptions -fasynchronous-unwind-tables
168 CFLAGS-recvmmsg.c = -fexceptions -fasynchronous-unwind-tables
169 CFLAGS-__rt_sigtimedwait.c = -fexceptions -fasynchronous-unwind-tables
170 CFLAGS-__rt_sigwaitinfo.c = -fexceptions -fasynchronous-unwind-tables
171 CFLAGS-select.c = -fexceptions -fasynchronous-unwind-tables
172 CFLAGS-send.c = -fexceptions -fasynchronous-unwind-tables
173 CFLAGS-sendmsg.c = -fexceptions -fasynchronous-unwind-tables
174 CFLAGS-sendmmsg.c = -fexceptions -fasynchronous-unwind-tables
175 CFLAGS-sendto.c = -fexceptions -fasynchronous-unwind-tables
176 CFLAGS-sigpause.c = -fexceptions
177 CFLAGS-sigsuspend.c = -fexceptions -fasynchronous-unwind-tables
178 CFLAGS-sigtimedwait.c = -fexceptions -fasynchronous-unwind-tables
179 CFLAGS-sigwait.c = -fexceptions -fasynchronous-unwind-tables
180 CFLAGS-sigwaitinfo.c = -fexceptions -fasynchronous-unwind-tables
181 CFLAGS-__syscall_fcntl64.c = -fexceptions -fasynchronous-unwind-tables
182 CFLAGS-__syscall_fcntl.c = -fexceptions -fasynchronous-unwind-tables
183 CFLAGS-tcdrain.c = -fexceptions -fasynchronous-unwind-tables
184 CFLAGS-usleep.c = -fexceptions -fasynchronous-unwind-tables
185 CFLAGS-wait4.c = -fexceptions -fasynchronous-unwind-tables
186 CFLAGS-wait.c = -fexceptions -fasynchronous-unwind-tables
187 CFLAGS-waitid.c = -fexceptions -fasynchronous-unwind-tables
188 CFLAGS-waitpid.c = -fexceptions -fasynchronous-unwind-tables
189 CFLAGS-write.c = -fexceptions -fasynchronous-unwind-tables
190 CFLAGS-writev.c = -fexceptions -fasynchronous-unwind-tables
193 # The rest of this file is uClibc specific.
195 CFLAGS-pthread_barrier_init.c = -D_GNU_SOURCE
196 CFLAGS-pthread_barrier_destroy.c = -D_GNU_SOURCE
197 CFLAGS-pthread_barrierattr_init.c = -D_GNU_SOURCE
198 CFLAGS-pthread_barrierattr_destroy.c = -D_GNU_SOURCE
199 CFLAGS-pthread_barrierattr_getpshared.c = -D_GNU_SOURCE
200 CFLAGS-pthread_barrierattr_setpshared.c = -D_GNU_SOURCE
201 CFLAGS-sem_open.c = -D_GNU_SOURCE
203 CFLAGS-OMIT-alloca_cutoff.c = $(CFLAGS-dir_nptl)
204 CFLAGS-OMIT-libc-lowlevelock.c = $(CFLAGS-dir_nptl)
205 CFLAGS-OMIT-libc-cancellation.c = $(CFLAGS-dir_nptl)