Home | History | Annotate | Line # | Download | only in aes
Makefile revision 1.9
      1  1.9  riastrad #	$NetBSD: Makefile,v 1.9 2025/11/23 22:44:14 riastradh Exp $
      2  1.1  riastrad 
      3  1.1  riastrad .include <bsd.own.mk>
      4  1.1  riastrad 
      5  1.1  riastrad TESTSDIR=	${TESTSBASE}/sys/crypto/aes
      6  1.1  riastrad 
      7  1.1  riastrad TESTS_C=	t_aes
      8  1.1  riastrad 
      9  1.3  riastrad AFLAGS+=	-D_LOCORE
     10  1.3  riastrad 
     11  1.1  riastrad .PATH:	${NETBSDSRCDIR}/sys/crypto/aes
     12  1.1  riastrad CPPFLAGS+=	-I${NETBSDSRCDIR}/sys
     13  1.1  riastrad 
     14  1.1  riastrad SRCS.t_aes+=	t_aes.c
     15  1.1  riastrad 
     16  1.1  riastrad SRCS.t_aes+=	aes_bear.c
     17  1.1  riastrad SRCS.t_aes+=	aes_ct.c
     18  1.1  riastrad SRCS.t_aes+=	aes_ct_dec.c
     19  1.1  riastrad SRCS.t_aes+=	aes_ct_enc.c
     20  1.9  riastrad 
     21  1.9  riastrad SRCS.t_aes+=	aes_bear64.c
     22  1.9  riastrad SRCS.t_aes+=	aes_ct64.c
     23  1.9  riastrad SRCS.t_aes+=	aes_ct64_dec.c
     24  1.9  riastrad SRCS.t_aes+=	aes_ct64_enc.c
     25  1.9  riastrad 
     26  1.8  riastrad SRCS.t_aes+=	aes_keysched.c
     27  1.1  riastrad SRCS.t_aes+=	aes_selftest.c
     28  1.1  riastrad 
     29  1.5  riastrad .if !empty(MACHINE_ARCH:Mearmv7*) || !empty(MACHINE_ARCH:Maarch64*)
     30  1.1  riastrad 
     31  1.1  riastrad .PATH:	${NETBSDSRCDIR}/sys/crypto/aes/arch/arm
     32  1.1  riastrad CPPFLAGS+=	-I${NETBSDSRCDIR}/sys/crypto/aes/arch/arm
     33  1.1  riastrad 
     34  1.1  riastrad .if !empty(MACHINE_ARCH:Maarch64*)	# XXX no AESE/AESD in 32-bit mode yet
     35  1.1  riastrad SRCS.t_aes+=	aes_armv8.c
     36  1.1  riastrad SRCS.t_aes+=	aes_armv8_64.S
     37  1.1  riastrad .endif
     38  1.1  riastrad 
     39  1.6  jakllsch CLANG_NO_NONPORTABLE_VECTOR_INITIALIZATION= ${${ACTIVE_CC} == "clang":? -Wno-nonportable-vector-initialization :}
     40  1.6  jakllsch 
     41  1.1  riastrad SRCS.t_aes+=	aes_neon.c
     42  1.6  jakllsch COPTS.aes_neon.c+=${CLANG_NO_NONPORTABLE_VECTOR_INITIALIZATION}
     43  1.1  riastrad SRCS.t_aes+=	aes_neon_impl.c
     44  1.1  riastrad SRCS.t_aes+=	aes_neon_subr.c
     45  1.6  jakllsch COPTS.aes_neon_subr.c+=${CLANG_NO_NONPORTABLE_VECTOR_INITIALIZATION}
     46  1.5  riastrad .if !empty(MACHINE_ARCH:Mearmv7*)
     47  1.1  riastrad SRCS.t_aes+=	aes_neon_32.S
     48  1.1  riastrad .endif
     49  1.1  riastrad 
     50  1.5  riastrad .if !empty(MACHINE_ARCH:Mearmv7*) && empty(MACHINE_ARCH:Mearmv7hf*)
     51  1.5  riastrad COPTS.aes_neon.c+=	-mfloat-abi=softfp -mfpu=neon
     52  1.5  riastrad COPTS.aes_neon_subr.c+=	-mfloat-abi=softfp -mfpu=neon
     53  1.5  riastrad AOPTS.aes_neon_32.S+=	-D__SOFTFP__
     54  1.5  riastrad .endif
     55  1.5  riastrad 
     56  1.1  riastrad .endif				# earmv7/aarch64
     57  1.1  riastrad 
     58  1.1  riastrad .if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64"
     59  1.1  riastrad 
     60  1.1  riastrad .PATH:	${NETBSDSRCDIR}/sys/crypto/aes/arch/x86
     61  1.1  riastrad CPPFLAGS+=	-I${NETBSDSRCDIR}/sys/crypto/aes/arch/x86
     62  1.1  riastrad 
     63  1.1  riastrad .if ${MACHINE_ARCH} == "x86_64"		# XXX no AES-NI in 32-bit mode yet
     64  1.1  riastrad SRCS.t_aes+=	aes_ni.c
     65  1.1  riastrad SRCS.t_aes+=	aes_ni_64.S
     66  1.1  riastrad .endif
     67  1.1  riastrad 
     68  1.1  riastrad SRCS.t_aes+=	aes_sse2.c
     69  1.1  riastrad SRCS.t_aes+=	aes_sse2_dec.c
     70  1.1  riastrad SRCS.t_aes+=	aes_sse2_enc.c
     71  1.1  riastrad SRCS.t_aes+=	aes_sse2_impl.c
     72  1.1  riastrad SRCS.t_aes+=	aes_sse2_subr.c
     73  1.2  riastrad COPTS.aes_sse2.c+=	-msse -msse2
     74  1.2  riastrad COPTS.aes_sse2_dec.c+=	-msse -msse2
     75  1.2  riastrad COPTS.aes_sse2_enc.c+=	-msse -msse2
     76  1.2  riastrad COPTS.aes_sse2_subr.c+=	-msse -msse2
     77  1.1  riastrad 
     78  1.1  riastrad SRCS.t_aes+=	aes_ssse3.c
     79  1.1  riastrad SRCS.t_aes+=	aes_ssse3_impl.c
     80  1.1  riastrad SRCS.t_aes+=	aes_ssse3_subr.c
     81  1.2  riastrad COPTS.aes_ssse3.c+=		-msse -msse2 -msse3 -mssse3
     82  1.2  riastrad COPTS.aes_ssse3_subr.c+=	-msse -msse2 -msse3 -mssse3
     83  1.1  riastrad 
     84  1.1  riastrad SRCS.t_aes+=	aes_via.c
     85  1.1  riastrad 
     86  1.1  riastrad .endif				# x86
     87  1.1  riastrad 
     88  1.1  riastrad WARNS=		5
     89  1.1  riastrad 
     90  1.7       mrg # Many of these are probably GCC bugs, see
     91  1.7       mrg #   https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110878
     92  1.7       mrg COPTS.aes_armv8.c+=	${CC_WNO_STRINGOP_OVERREAD} ${CC_WNO_STRINGOP_OVERFLOW}
     93  1.7       mrg COPTS.aes_bear.c+=	${CC_WNO_STRINGOP_OVERFLOW} ${CC_WNO_ARRAY_BOUNDS}
     94  1.9  riastrad COPTS.aes_bear64.c+=	${CC_WNO_STRINGOP_OVERFLOW} ${CC_WNO_ARRAY_BOUNDS}
     95  1.7       mrg COPTS.aes_neon_subr.c+=	${CC_WNO_ARRAY_BOUNDS}
     96  1.7       mrg 
     97  1.7       mrg COPTS.aes_ni.c+=	${CC_WNO_STRINGOP_OVERREAD} ${CC_WNO_STRINGOP_OVERFLOW}
     98  1.7       mrg COPTS.aes_sse2_subr.c+=	${CC_WNO_ARRAY_BOUNDS}
     99  1.7       mrg COPTS.aes_ssse3_subr.c+=${CC_WNO_ARRAY_BOUNDS}
    100  1.7       mrg COPTS.aes_via.c+=	${CC_WNO_ARRAY_BOUNDS}
    101  1.7       mrg 
    102  1.1  riastrad .include <bsd.test.mk>
    103