1 # $NetBSD: Makefile,v 1.55 2008/10/26 00:00:27 mrg Exp $
8 .if defined
(PTHREAD_MACHINE_ARCH
) && !empty
(PTHREAD_MACHINE_ARCH
) && \
9 exists
(${.CURDIR
}/arch
/${PTHREAD_MACHINE_ARCH})
10 ARCHSUBDIR
= ${PTHREAD_MACHINE_ARCH}
11 .elif exists
(${.CURDIR
}/arch
/${MACHINE_ARCH})
12 ARCHSUBDIR
= ${MACHINE_ARCH}
13 .elif exists
(${.CURDIR
}/arch
/${MACHINE_CPU})
14 ARCHSUBDIR
= ${MACHINE_CPU}
17 @echo
"WARNING: no ARCHSUBDIR for ${MACHINE_ARCH}/${MACHINE_CPU}; skipping..."
20 INCS
= pthread.h pthread_types.h pthread_queue.h
23 .if defined
(ARCHSUBDIR
)
25 ARCHDIR
= ${.CURDIR
}/arch
/${ARCHSUBDIR}
28 CPPFLAGS
+= -I
${ARCHDIR} -I
${.CURDIR
} -I
${.OBJDIR
} -D_LIBC
29 CPPFLAGS
+= -D__LIBPTHREAD_SOURCE__
31 # XXX: This crappy poke at libc's internals needs to be fixed.
32 CPPFLAGS
+=-I
${NETBSDSRCDIR}/sys
-I
${.CURDIR
}/..
/libc
37 # NOTE: When you create a new file for libpthread, make sure that pthread.c
38 # gets a reference to a symbol in that file. Otherwise, Unix's stupid static
39 # library semantics will end up discarding potentially important objects.
43 SRCS
+= pthread_barrier.c
44 SRCS
+= pthread_cancelstub.c
48 SRCS
+= pthread_mutex.c
49 SRCS
+= pthread_rwlock.c
50 SRCS
+= pthread_specific.c
55 # Architecture-dependent files
56 .if exists
(${ARCHDIR}/pthread_md.S
)
60 .if defined
(PTHREAD__COMPAT
)
61 SRCS
+= pthread_compat.c
62 .PATH.c
: ${.CURDIR
}/..
/..
/common
/lib
/libc
/arch
/${ARCHSUBDIR}/atomic
63 .PATH.S
: ${.CURDIR
}/..
/..
/common
/lib
/libc
/arch
/${ARCHSUBDIR}/atomic
64 .PATH.c
: ${.CURDIR
}/..
/..
/common
/lib
/libc
/atomic
65 .PATH.c
: ${.CURDIR
}/..
/libc
/misc
66 .
include "../../common/lib/libc/arch/${ARCHSUBDIR}/atomic/Makefile.inc"
69 # The TSD routines are used in the implementation of profiling, and so
70 # can't be profiled themselves.
71 COPTS.pthread_specific.c
+= -fomit-frame-pointer
-falign-functions
=32
72 pthread_specific.po
: pthread_specific.o
74 cp pthread_specific.o pthread_specific.po
76 # Internal spinlock routines are performance critical. Don't profile them,
77 # it's incompatibile with -fomit-frame-pointer.
78 COPTS.pthread_lock.c
+= -fomit-frame-pointer
-falign-functions
=32
79 pthread_lock.po
: pthread_lock.o
81 cp pthread_lock.o pthread_lock.po
83 COPTS.pthread_mutex.c
+= -fomit-frame-pointer
-falign-functions
=32
84 pthread_mutex.po
: pthread_mutex.o
86 cp pthread_mutex.o pthread_mutex.po
88 COPTS.pthread.c
+= -Wno-stack-protector
90 MAN
+= affinity
.3 pthread
.3 \
92 pthread_attr_getname_np
.3 \
93 pthread_attr_setcreatesuspend_np
.3 \
94 pthread_attr_setname_np
.3 \
95 pthread_barrier_destroy
.3 pthread_barrier_init
.3 \
96 pthread_barrier_wait
.3 pthread_barrierattr
.3 \
97 pthread_cancel
.3 pthread_cleanup_push
.3 \
98 pthread_cond_broadcast
.3 pthread_cond_destroy
.3 pthread_cond_init
.3 \
100 pthread_condattr
.3 pthread_create
.3 pthread_detach
.3 pthread_equal
.3 \
102 pthread_getname_np
.3 \
103 pthread_getspecific
.3 pthread_join
.3 \
104 pthread_key_create
.3 pthread_key_delete
.3 pthread_kill
.3 \
105 pthread_mutex_destroy
.3 pthread_mutex_init
.3 pthread_mutex_lock
.3 \
106 pthread_mutex_unlock
.3 pthread_mutexattr
.3 \
107 pthread_once
.3 pthread_rwlock_destroy
.3 pthread_rwlock_init
.3 \
108 pthread_rwlock_rdlock
.3 pthread_rwlock_unlock
.3 \
109 pthread_rwlock_wrlock
.3 pthread_rwlockattr
.3 \
110 pthread_schedparam
.3 pthread_self
.3 \
111 pthread_setname_np
.3 \
112 pthread_setspecific
.3 pthread_sigmask
.3 pthread_spin_destroy
.3 \
113 pthread_spin_init
.3 pthread_spin_lock
.3 pthread_spin_unlock
.3 \
114 pthread_suspend_np
.3 pthread_testcancel
.3
116 MLINKS
+= affinity
.3 pthread_setaffinity_np
.3
117 MLINKS
+= affinity
.3 pthread_getaffinity_np
.3
118 MLINKS
+= pthread_attr
.3 pthread_attr_init
.3
119 MLINKS
+= pthread_attr
.3 pthread_attr_destroy
.3
120 MLINKS
+= pthread_attr
.3 pthread_attr_setdetachstate
.3
121 MLINKS
+= pthread_attr
.3 pthread_attr_getdetachstate
.3
122 MLINKS
+= pthread_attr
.3 pthread_attr_setschedparam
.3
123 MLINKS
+= pthread_attr
.3 pthread_attr_getschedparam
.3
124 MLINKS
+= pthread_barrierattr
.3 pthread_barrierattr_init
.3
125 MLINKS
+= pthread_barrierattr
.3 pthread_barrierattr_destroy
.3
126 MLINKS
+= pthread_cleanup_push
.3 pthread_cleanup_pop
.3
127 MLINKS
+= pthread_cond_broadcast
.3 pthread_cond_signal
.3
128 MLINKS
+= pthread_cond_wait
.3 pthread_cond_timedwait
.3
129 MLINKS
+= pthread_condattr
.3 pthread_condattr_init
.3
130 MLINKS
+= pthread_condattr
.3 pthread_condattr_destroy
.3
131 MLINKS
+= pthread_mutex_lock
.3 pthread_mutex_trylock
.3
132 MLINKS
+= pthread_mutexattr
.3 pthread_mutexattr_init
.3
133 MLINKS
+= pthread_mutexattr
.3 pthread_mutexattr_destroy
.3
134 MLINKS
+= pthread_mutexattr
.3 pthread_mutexattr_settype
.3
135 MLINKS
+= pthread_mutexattr
.3 pthread_mutexattr_gettype
.3
136 MLINKS
+= pthread_rwlock_rdlock
.3 pthread_rwlock_timedrdlock
.3
137 MLINKS
+= pthread_rwlock_rdlock
.3 pthread_rwlock_tryrdlock
.3
138 MLINKS
+= pthread_rwlock_wrlock
.3 pthread_rwlock_timedwrlock
.3
139 MLINKS
+= pthread_rwlock_wrlock
.3 pthread_rwlock_trywrlock
.3
140 MLINKS
+= pthread_rwlockattr
.3 pthread_rwlockattr_init
.3
141 MLINKS
+= pthread_rwlockattr
.3 pthread_rwlockattr_destroy
.3
142 MLINKS
+= pthread_schedparam
.3 pthread_setschedparam
.3
143 MLINKS
+= pthread_schedparam
.3 pthread_getschedparam
.3
144 MLINKS
+= pthread_spin_lock
.3 pthread_spin_trylock
.3
145 MLINKS
+= pthread_suspend_np
.3 pthread_resume_np
.3
146 MLINKS
+= pthread_testcancel
.3 pthread_setcancelstate
.3
147 MLINKS
+= pthread_testcancel
.3 pthread_setcanceltype
.3
149 .
include <bsd.lib.mk
>
153 .
include <bsd.man.mk
>
154 .
include <bsd.files.mk
>
155 .
include <bsd.inc.mk
>
159 # WARNS=2 sets -Wcast-qual. This causes problems for one of
160 # pthread_setspecific() and pthread_getspecific(), since the constness
161 # of the argument to setspecific() has to be discarded *somewhere*
162 # before returning it from getspecific().
163 CFLAGS
+= -Wno-cast-qual