xref: /freebsd/lib/libc/aarch64/string/Makefile.inc (revision e6bfd18d21b225af6a0ed67ceeaf1293b7b9eba5)
1# $FreeBSD$
2#
3# String handling from the Arm Optimized Routines
4# https://github.com/ARM-software/optimized-routines
5#
6
7AARCH64_STRING_FUNCS= \
8	memchr \
9	memcmp \
10	memcpy \
11	memmove \
12	memrchr \
13	memset \
14	stpcpy \
15	strchr \
16	strchrnul \
17	strcmp \
18	strcpy \
19	strlen \
20	strncmp \
21	strnlen \
22	strrchr
23
24#
25# Add the above functions. Generate an asm file that includes the needed
26# Arm Optimized Routines file defining the function name to the libc name.
27# Some file need multiple macros defined or a weak symbol added we can
28# override the generated file in these cases.
29#
30.for FUNC in ${AARCH64_STRING_FUNCS}
31.if !exists(${FUNC}.S)
32${FUNC}.S:
33	printf '/* %sgenerated by libc/aarch64/string/Makefile.inc */\n' @ > ${.TARGET}
34	printf '#define	__%s_aarch64 %s\n' ${FUNC} ${FUNC} >> ${.TARGET}
35	printf '#include "aarch64/%s.S"\n' ${FUNC} >> ${.TARGET}
36CLEANFILES+=	${FUNC}.S
37.endif
38
39MDSRCS+=	${FUNC}.S
40CFLAGS.${FUNC}.S+=-I${SRCTOP}/contrib/arm-optimized-routines/string
41.endfor
42