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