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