xref: /freebsd/lib/libthr/Makefile (revision c6063d0da8e1f8d8452b0c2ee1c7ad718c1a7052)
1bb535300SJeff Roberson# $FreeBSD$
2bb535300SJeff Roberson#
3bb535300SJeff Roberson# All library objects contain FreeBSD revision strings by default; they may be
4bb535300SJeff Roberson# excluded as a space-saving measure.  To produce a library that does
5bb535300SJeff Roberson# not contain these strings, add -DSTRIP_FBSDID (see <sys/cdefs.h>) to CFLAGS
6bb535300SJeff Roberson# below.  Note, there are no IDs for syscall stubs whose sources are generated.
7bb535300SJeff Roberson# To included legacy CSRG sccsid strings, add -DLIBC_SCCS and -DSYSLIBC_SCCS
8bb535300SJeff Roberson# (for system call stubs) to CFLAGS below.  -DSYSLIBC_SCCS affects just the
9bb535300SJeff Roberson# system call stubs.
105740a2b6SRuslan Ermilov
11241715e7SRuslan ErmilovSHLIBDIR?= /lib
12241715e7SRuslan Ermilov
13*c6063d0dSWarner Losh.include <src.opts.mk>
14d9ca85fcSRuslan ErmilovMK_SSP=	no
1500fb440cSDaniel Eischen
16bb535300SJeff RobersonLIB=thr
17419ecd5dSDaniel EischenSHLIB_MAJOR= 3
18e03efb02SRuslan ErmilovWARNS?=	3
19a091d823SDavid XuCFLAGS+=-DPTHREAD_KERNEL
20bb535300SJeff RobersonCFLAGS+=-I${.CURDIR}/../libc/include -I${.CURDIR}/thread \
21bb535300SJeff Roberson	-I${.CURDIR}/../../include
22f4fbf9c8SNathan WhitehornCFLAGS+=-I${.CURDIR}/arch/${MACHINE_CPUARCH}/include
23a091d823SDavid XuCFLAGS+=-I${.CURDIR}/sys
24e6f19330SDoug RabsonCFLAGS+=-I${.CURDIR}/../../libexec/rtld-elf
2510f3ae58SWarner LoshCFLAGS+=-I${.CURDIR}/../../libexec/rtld-elf/${MACHINE_CPUARCH}
26d245d9e1SDavid XuCFLAGS+=-I${.CURDIR}/../libthread_db
27a091d823SDavid XuCFLAGS+=-Winline
283832fd24SDavid Xu
29f4213b90SDavid Xu.ifndef NO_THREAD_UNWIND_STACK
300935fc89SDavid XuCFLAGS+=-fexceptions
313832fd24SDavid XuCFLAGS+=-D_PTHREAD_FORCED_UNWIND
323832fd24SDavid Xu.endif
333832fd24SDavid Xu
346d772c3bSKonstantin BelousovLDFLAGS+=-Wl,-znodelete
35a091d823SDavid Xu
36a9b9744fSDag-Erling SmørgravVERSION_DEF=${.CURDIR}/../libc/Versions.def
37a9b9744fSDag-Erling SmørgravSYMBOL_MAPS=${.CURDIR}/pthread.map
38bb535300SJeff Roberson
395335c6bcSRobert WatsonMAN=	libthr.3
405335c6bcSRobert Watson
41bb535300SJeff Roberson# enable extra internal consistancy checks
4244a31c2dSDavid XuCFLAGS+=-D_PTHREADS_INVARIANTS
43649814ddSDavid Xu#CFLAGS+=-g
44bb535300SJeff Roberson
45a35d8893SRuslan ErmilovPRECIOUSLIB=
46bb535300SJeff Roberson
4710f3ae58SWarner Losh.PATH: ${.CURDIR}/arch/${MACHINE_CPUARCH}/${MACHINE_CPUARCH}
4810f3ae58SWarner Losh
49f4fbf9c8SNathan Whitehorn.include "${.CURDIR}/arch/${MACHINE_CPUARCH}/Makefile.inc"
50a091d823SDavid Xu.include "${.CURDIR}/sys/Makefile.inc"
51a091d823SDavid Xu.include "${.CURDIR}/thread/Makefile.inc"
52bb535300SJeff Roberson
53455cc6ecSJung-uk Kim.if ${MK_INSTALLLIB} != "no"
5455ac4c35SDavid XuSYMLINKS+=lib${LIB}.a ${LIBDIR}/libpthread.a
55455cc6ecSJung-uk Kim.endif
5655ac4c35SDavid Xu.if !defined(NO_PIC)
5784e709f1SRuslan ErmilovSYMLINKS+=lib${LIB}.so ${LIBDIR}/libpthread.so
5855ac4c35SDavid Xu.endif
595740a2b6SRuslan Ermilov.if ${MK_PROFILE} != "no"
6055ac4c35SDavid XuSYMLINKS+=lib${LIB}_p.a ${LIBDIR}/libpthread_p.a
6155ac4c35SDavid Xu.endif
6255ac4c35SDavid Xu
63a5fc5b62SWarner Losh.if ${MK_SYSCALL_COMPAT} != "no"
64c30c187dSDavid XuCFLAGS+=-DSYSCALL_COMPAT
65c30c187dSDavid Xu.endif
66c30c187dSDavid Xu
67bb535300SJeff Roberson.include <bsd.lib.mk>
68