xref: /minix/lib/libm/compiler_rt/Makefile.inc (revision 0a6a1f1d)
1# $NetBSD: Makefile.inc,v 1.9 2014/10/22 10:33:27 joerg Exp $
2
3COMPILER_RT_SRCDIR=	${NETBSDSRCDIR}/sys/external/bsd/compiler_rt/dist
4
5.if ${MACHINE_CPU} == "powerpc"
6COMPILER_RT_CPU_DIR=	${COMPILER_RT_SRCDIR}/lib/builtins/ppc
7COMPILER_RT_ARCH_DIR=	${COMPILER_RT_SRCDIR}/lib/builtins/ppc
8.else
9COMPILER_RT_CPU_DIR=	${COMPILER_RT_SRCDIR}/lib/builtins/${MACHINE_CPU}
10COMPILER_RT_ARCH_DIR=	${COMPILER_RT_SRCDIR}/lib/builtins/${MACHINE_ARCH}
11.endif
12
13.if !defined(__MINIX)
14.PATH: ${COMPILER_RT_CPU_DIR}
15.PATH: ${COMPILER_RT_ARCH_DIR}
16.endif # !defined(__MINIX)
17.PATH: ${COMPILER_RT_SRCDIR}/lib/builtins
18
19# Needs scaling support
20GENERIC_SRCS+= \
21	muldc3.c \
22	mulsc3.c \
23	mulxc3.c \
24	divdc3.c \
25	divsc3.c \
26	divxc3.c
27
28.if ${MACHINE_CPU} == "powerpc"
29GENERIC_SRCS+= \
30	divtc3.c \
31	multc3.c
32.endif
33
34.if !defined(__MINIX)
35.for src in ${GENERIC_SRCS}
36.  if exists(${COMPILER_RT_CPU_DIR}/${src:R}.S) || \
37      exists(${COMPILER_RT_ARCH_DIR}/${src:R}.S)
38SRCS+=	${src:R}.S
39.  else
40SRCS+=	${src}
41COPTS.${src}+=	-Wno-error=missing-prototypes
42.  endif
43.endfor
44.else
45# For MINIX: do not pull in the assembly symbols, as they are not PIC ready
46.for src in ${GENERIC_SRCS}
47SRCS+=	${src}
48COPTS.${src}+=	-Wno-error=missing-prototypes
49.endfor
50.endif # !defined(__MINIX)
51