1 # $NetBSD: Makefile,v 1.14 2025/04/23 20:14:59 christos Exp $ 2 3 .include "bsd.own.mk" 4 5 CRYPTODIST=${NETBSDSRCDIR}/crypto 6 .include "${NETBSDSRCDIR}/crypto/Makefile.openssl" 7 8 .if make(regen) && ${HAVE_LLVM:U} == "yes" 9 CC+= -fno-integrated-as 10 .endif 11 12 regen: 13 for i in $$(find ${OPENSSLSRC} -name \*${MACHINE_ARCH}.pl) \ 14 $$(find ${OPENSSLSRC}/crypto/bn/asm -name ${MACHINE_ARCH}-\*.pl) \ 15 ${OPENSSLSRC}/crypto/bn/asm/rsaz-avx2.pl \ 16 ${OPENSSLSRC}/crypto/bn/asm/rsaz-avx512.pl \ 17 ${OPENSSLSRC}/crypto/${MACHINE_ARCH}cpuid.pl ; do \ 18 j=$$(basename $$i .pl).S; \ 19 case $$j in \ 20 (sha512-x86_64.S) \ 21 perl $$i sha256-x86_64.S; perl $$i sha512-x86_64.S;; \ 22 (*) \ 23 (echo "#include <machine/asm.h>"; CC=${CC:Q} perl $$i elf | sed \ 24 -e 's/.hidden OPENSSL_cpuid_setup/.globl OPENSSL_cpuid_setup/' \ 25 -e 's/call OPENSSL_cpuid_setup/call PIC_PLT(OPENSSL_cpuid_setup)/' \ 26 -e 's/rdseedq/rdseed/') > $$j;; \ 27 esac; \ 28 done 29