NetBSD/lib/libpthread/Makefile

160 lines
5.3 KiB
Makefile
Raw Normal View History

# $NetBSD: Makefile,v 1.35 2005/12/13 22:07:20 christos Exp $
2003-01-18 13:32:11 +03:00
#
WARNS= 2
# Define PT_FIXEDSTACKSIZE_LG to set a fixed stacksize
#CPPFLAGS+=-DPT_FIXEDSTACKSIZE_LG=18
2003-01-18 13:32:11 +03:00
.include <bsd.own.mk>
.if exists(${.CURDIR}/arch/${MACHINE_ARCH})
ARCHSUBDIR= ${MACHINE_ARCH}
.elif exists(${.CURDIR}/arch/${MACHINE_CPU})
ARCHSUBDIR= ${MACHINE_CPU}
.else
.BEGIN:
@echo "WARNING: no ARCHSUBDIR for ${MACHINE_ARCH}/${MACHINE_CPU}; skipping..."
2003-01-18 13:32:11 +03:00
.endif
INCS= pthread.h pthread_types.h pthread_queue.h
INCSDIR=/usr/include
2003-01-18 13:32:11 +03:00
.if defined(ARCHSUBDIR)
ARCHDIR= ${.CURDIR}/arch/${ARCHSUBDIR}
.PATH: ${ARCHDIR}
CPPFLAGS+= -I${ARCHDIR} -I${.CURDIR} -I${.OBJDIR} -D_LIBC
CPPFLAGS+= -D__LIBPTHREAD_SOURCE__ -DPTHREAD_MLOCK_KLUDGE
2003-01-18 13:32:11 +03:00
# XXX: This crappy poke at libc's internals needs to be fixed.
# We need to put this *after our own includes, so that our "assym.h"
# gets picked, instead of the libc one
CPPFLAGS+=-I${NETBSDSRCDIR}/sys -I${.CURDIR}/../libc
2003-01-18 13:32:11 +03:00
DPSRCS+= assym.h
CLEANFILES+= assym.h
2003-01-18 13:32:11 +03:00
assym.h: ${ARCHDIR}/genassym.cf pthread.h pthread_int.h pthread_md.h
${_MKTARGET_CREATE}
${TOOL_GENASSYM} -- ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} \
2003-01-18 13:32:11 +03:00
< ${ARCHDIR}/genassym.cf > assym.h.tmp && \
mv -f assym.h.tmp assym.h
LIB= pthread
#
# NOTE: When you create a new file for libpthread, make sure that pthread.c
# gets a reference to a symbol in that file. Otherwise, Unix's stupid static
# library semantics will end up discarding potentially important objects.
#
SRCS= pthread.c
SRCS+= pthread_alarms.c
SRCS+= pthread_attr.c
2003-01-18 13:32:11 +03:00
SRCS+= pthread_barrier.c
SRCS+= pthread_cancelstub.c
SRCS+= pthread_cond.c
SRCS+= pthread_lock.c
SRCS+= pthread_mutex.c
SRCS+= pthread_run.c
SRCS+= pthread_rwlock.c
SRCS+= pthread_sa.c
SRCS+= pthread_sig.c
SRCS+= pthread_sleep.c
2003-01-18 13:32:11 +03:00
SRCS+= pthread_specific.c
SRCS+= pthread_stack.c
SRCS+= pthread_tsd.c
2003-01-18 13:32:11 +03:00
SRCS+= pthread_debug.c
SRCS+= res_state.c
2003-01-18 13:32:11 +03:00
SRCS+= sched.c
SRCS+= sem.c
2003-01-18 13:32:11 +03:00
# Architecture-dependent files
SRCS+= pthread_switch.S _context_u.S
.if exists(${ARCHDIR}/pthread_md.c)
SRCS+= pthread_md.c
.endif
# The TSD routines are used in the implementation of profiling, and so
# can't be profiled themselves.
pthread_specific.po: pthread_specific.o
${_MKTARGET_CREATE}
cp pthread_specific.o pthread_specific.po
_context_u.po: _context_u.o
${_MKTARGET_CREATE}
cp _context_u.o _context_u.po
MAN+= pthread.3 \
pthread_attr.3 pthread_attr_setcreatesuspend_np.3 \
2003-06-04 01:34:00 +04:00
pthread_barrier_destroy.3 pthread_barrier_init.3 \
pthread_barrier_wait.3 pthread_barrierattr.3 \
pthread_cancel.3 pthread_cleanup_push.3 \
pthread_cond_broadcast.3 pthread_cond_destroy.3 pthread_cond_init.3 \
pthread_cond_wait.3 \
pthread_condattr.3 pthread_create.3 pthread_detach.3 pthread_equal.3 \
pthread_exit.3 pthread_getspecific.3 pthread_join.3 \
pthread_key_create.3 pthread_key_delete.3 pthread_kill.3 \
pthread_mutex_destroy.3 pthread_mutex_init.3 pthread_mutex_lock.3 \
pthread_mutex_unlock.3 pthread_mutexattr.3 \
pthread_once.3 pthread_rwlock_destroy.3 pthread_rwlock_init.3 \
pthread_rwlock_rdlock.3 pthread_rwlock_unlock.3 \
pthread_rwlock_wrlock.3 pthread_rwlockattr.3 \
pthread_schedparam.3 pthread_self.3 \
pthread_setspecific.3 pthread_sigmask.3 pthread_spin_destroy.3 \
pthread_spin_init.3 pthread_spin_lock.3 pthread_spin_unlock.3 \
2004-12-14 04:47:13 +03:00
pthread_suspend_np.3 pthread_testcancel.3 \
sched_yield.3
2003-06-04 01:34:00 +04:00
MLINKS+= pthread_attr.3 pthread_attr_init.3
MLINKS+= pthread_attr.3 pthread_attr_destroy.3
MLINKS+= pthread_attr.3 pthread_attr_setdetachstate.3
MLINKS+= pthread_attr.3 pthread_attr_getdetachstate.3
MLINKS+= pthread_attr.3 pthread_attr_setschedparam.3
MLINKS+= pthread_attr.3 pthread_attr_getschedparam.3
MLINKS+= pthread_barrierattr.3 pthread_barrierattr_init.3
MLINKS+= pthread_barrierattr.3 pthread_barrierattr_destroy.3
2003-06-04 01:34:00 +04:00
MLINKS+= pthread_cleanup_push.3 pthread_cleanup_pop.3
MLINKS+= pthread_cond_broadcast.3 pthread_cond_signal.3
MLINKS+= pthread_cond_wait.3 pthread_cond_timedwait.3
MLINKS+= pthread_condattr.3 pthread_condattr_init.3
MLINKS+= pthread_condattr.3 pthread_condattr_destroy.3
MLINKS+= pthread_mutex_lock.3 pthread_mutex_trylock.3
MLINKS+= pthread_mutexattr.3 pthread_mutexattr_init.3
MLINKS+= pthread_mutexattr.3 pthread_mutexattr_destroy.3
MLINKS+= pthread_mutexattr.3 pthread_mutexattr_settype.3
MLINKS+= pthread_mutexattr.3 pthread_mutexattr_gettype.3
MLINKS+= pthread_rwlock_rdlock.3 pthread_rwlock_timedrdlock.3
MLINKS+= pthread_rwlock_rdlock.3 pthread_rwlock_tryrdlock.3
MLINKS+= pthread_rwlock_wrlock.3 pthread_rwlock_timedwrlock.3
MLINKS+= pthread_rwlock_wrlock.3 pthread_rwlock_trywrlock.3
MLINKS+= pthread_rwlockattr.3 pthread_rwlockattr_init.3
MLINKS+= pthread_rwlockattr.3 pthread_rwlockattr_destroy.3
MLINKS+= pthread_schedparam.3 pthread_setschedparam.3
MLINKS+= pthread_schedparam.3 pthread_getschedparam.3
MLINKS+= pthread_spin_lock.3 pthread_spin_trylock.3
MLINKS+= pthread_suspend_np.3 pthread_resume_np.3
2003-06-04 01:34:00 +04:00
MLINKS+= pthread_testcancel.3 pthread_setcancelstate.3
MLINKS+= pthread_testcancel.3 pthread_setcanceltype.3
2003-01-18 13:32:11 +03:00
pthread_switch.S _context_u.S: assym.h
debuglog: debuglog.o
$(CC) -o debuglog debuglog.o -lpthread
.include <bsd.lib.mk>
.else
.include <bsd.man.mk>
.include <bsd.files.mk>
.include <bsd.inc.mk>
2003-01-18 13:32:11 +03:00
.endif
# WARNS=2 sets -Wcast-qual. This causes problems for one of
# pthread_setspecific() and pthread_getspecific(), since the constness
# of the argument to setspecific() has to be discarded *somewhere*
# before returning it from getspecific().
CFLAGS+= -Wno-cast-qual