xref: /freebsd/lib/libsys/Makefile (revision 1edb7116f450c1a1793f2fd25f6bdc16735ef888)
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
24MK_SSP=		no
25
26CFLAGS+=-I${LIBSYS_SRCTOP}/include -I${LIBC_SRCTOP}/include
27CFLAGS+=-I${LIBSYS_SRCTOP}/${LIBC_ARCH}
28CFLAGS+=-I${LIBC_SRCTOP}/${LIBC_ARCH}
29
30.PATH: ${LIBC_SRCTOP}/string
31SRCS+=	memcpy.c memset.c strlcpy.c
32
33CLEANFILES+=tags
34INSTALL_PIC_ARCHIVE=
35#XXX? BUILD_NOSSP_PIC_ARCHIVE=
36PRECIOUSLIB=
37
38# Use a more efficient TLS model for libc since we can reasonably assume that
39# it will be loaded during program startup.
40CFLAGS+= -ftls-model=initial-exec
41
42#
43# Link with static libcompiler_rt.a.
44#
45LDFLAGS+= -nodefaultlibs
46LIBADD+=	compiler_rt
47
48.if ${MK_SSP} != "no" && \
49    (${LIBC_ARCH} == "i386" || ${LIBC_ARCH:Mpowerpc*} != "")
50LIBADD+=        ssp_nonshared
51.endif
52
53#.if ${MK_SSP} != "no" && \
54#    (${LIBC_ARCH} == "i386" || ${LIBC_ARCH:Mpowerpc*} != "")
55#LIBADD+=	ssp_nonshared
56#.endif
57
58# Define (empty) variables so that make doesn't give substitution
59# errors if the included makefiles don't change these:
60MDASM=
61MIASM=
62NOASM=
63
64SYM_MAPS+=	${LIBSYS_SRCTOP}/Symbol.map
65SRCS+=	auxv.c
66
67.include "${LIBSYS_SRCTOP}/Makefile.sys"
68
69SYM_MAPS+=	${LIBSYS_SRCTOP}/Symbol.thr.map
70.PATH: ${LIBSYS_SRCTOP}/${MACHINE_CPUARCH}
71.sinclude "${LIBSYS_SRCTOP}/${MACHINE_CPUARCH}/Makefile.thr"
72.if !${SRCS:M_umtx_op_err.S}
73SRCS+=_umtx_op_err.c
74.endif
75
76VERSION_DEF=${LIBC_SRCTOP}/Versions.def
77SYMBOL_MAPS=${SYM_MAPS}
78
79.include <bsd.lib.mk>
80