xref: /freebsd/lib/libsys/Makefile (revision af9758deff9abb118ce189cbab0a830b02fc63db)
1PACKAGE=	clibs
2SHLIBDIR?= /lib
3
4.include <src.opts.mk>
5
6LIBC_SRCTOP?= ${.CURDIR}/../libc
7LIBSYS_SRCTOP?=	${.CURDIR}
8
9# Pick the current architecture directory for libsys. In general, this is named
10# MACHINE_CPUARCH, but some ABIs are different enough to require their own
11# libsys, so allow a directory named MACHINE_ARCH to override this (though
12# treat powerpc64le and powerpc64 the same).
13# Note: This is copied from libc/Makefile
14M=${MACHINE_ARCH:S/powerpc64le/powerpc64/}
15.if exists(${LIBC_SRCTOP}/${M})
16LIBC_ARCH=${M}
17.else
18LIBC_ARCH=${MACHINE_CPUARCH}
19.endif
20
21LIB=sys
22SHLIB_MAJOR= 7
23WARNS?=	2
24
25CFLAGS+=-I${LIBSYS_SRCTOP}/include -I${LIBC_SRCTOP}/include
26CFLAGS+=-I${LIBSYS_SRCTOP}/${LIBC_ARCH}
27CFLAGS+=-I${LIBC_SRCTOP}/${LIBC_ARCH}
28
29.PATH: ${LIBC_SRCTOP}/string
30SRCS+=	memcpy.c memset.c strlcpy.c
31
32CLEANFILES+=tags
33INSTALL_PIC_ARCHIVE=
34#XXX? BUILD_NOSSP_PIC_ARCHIVE=
35PRECIOUSLIB=
36
37# Use a more efficient TLS model for libc since we can reasonably assume that
38# it will be loaded during program startup.
39CFLAGS+= -ftls-model=initial-exec
40
41#
42# Link with static libcompiler_rt.a.
43#
44LDFLAGS+= -nodefaultlibs
45LIBADD+=	compiler_rt
46
47.if ${MK_SSP} != "no" && \
48    (${LIBC_ARCH} == "i386" || ${LIBC_ARCH:Mpowerpc*} != "")
49LIBADD+=        ssp_nonshared
50.endif
51
52#.if ${MK_SSP} != "no" && \
53#    (${LIBC_ARCH} == "i386" || ${LIBC_ARCH:Mpowerpc*} != "")
54#LIBADD+=	ssp_nonshared
55#.endif
56
57# Define (empty) variables so that make doesn't give substitution
58# errors if the included makefiles don't change these:
59MDASM=
60MIASM=
61NOASM=
62
63SYM_MAPS+=	${LIBSYS_SRCTOP}/Symbol.map
64SRCS+=	auxv.c
65
66.include "${LIBSYS_SRCTOP}/Makefile.sys"
67
68SYM_MAPS+=	${LIBSYS_SRCTOP}/Symbol.thr.map
69.PATH: ${LIBSYS_SRCTOP}/${MACHINE_CPUARCH}
70.sinclude "${LIBSYS_SRCTOP}/${MACHINE_CPUARCH}/Makefile.thr"
71.if !${SRCS:M_umtx_op_err.S}
72SRCS+=_umtx_op_err.c
73.endif
74
75VERSION_DEF=${LIBC_SRCTOP}/Versions.def
76SYMBOL_MAPS=${SYM_MAPS}
77
78.include <bsd.lib.mk>
79