1# $NetBSD: Makefile.inc,v 1.12 2024/05/09 19:54:38 riastradh Exp $ 2 3COMPILER_RT_DIR= ${NETBSDSRCDIR}/sys/external/bsd/compiler_rt 4COMPILER_RT_SRCDIR= ${COMPILER_RT_DIR}/dist 5 6.if ${MACHINE_CPU} == "powerpc" 7COMPILER_RT_CPU_DIR= ${COMPILER_RT_SRCDIR}/lib/builtins/ppc 8COMPILER_RT_ARCH_DIR= ${COMPILER_RT_SRCDIR}/lib/builtins/ppc 9.else 10COMPILER_RT_CPU_DIR= ${COMPILER_RT_SRCDIR}/lib/builtins/${MACHINE_CPU} 11COMPILER_RT_ARCH_DIR= ${COMPILER_RT_SRCDIR}/lib/builtins/${MACHINE_ARCH} 12.endif 13 14.PATH: ${COMPILER_RT_CPU_DIR} 15.PATH: ${COMPILER_RT_ARCH_DIR} 16.PATH: ${COMPILER_RT_SRCDIR}/lib/builtins 17 18# Needs scaling support 19GENERIC_SRCS+= \ 20 muldc3.c \ 21 mulsc3.c \ 22 mulxc3.c \ 23 divdc3.c \ 24 divsc3.c \ 25 divxc3.c 26 27.if ${MACHINE_CPU} == "powerpc" || ${LIBC_MACHINE_ARCH:U} == "sparc64" || ${LIBC_MACHINE_CPU:U} == "aarch64" 28GENERIC_SRCS+= \ 29 divtc3.c \ 30 multc3.c 31.endif 32 33.for src in ${GENERIC_SRCS} 34. if exists(${COMPILER_RT_CPU_DIR}/${src:R}.S) || \ 35 exists(${COMPILER_RT_ARCH_DIR}/${src:R}.S) 36SRCS+= ${src:R}.S 37. else 38SRCS+= ${src} 39COPTS.${src}+= -Wno-error=missing-prototypes 40. endif 41.endfor 42 43.include "${COMPILER_RT_DIR}/abi.mk" 44