1 # $NetBSD: Makefile,v 1.4 2026/01/28 20:01:39 christos Exp $ 2 3 .include <bsd.own.mk> 4 5 BITS?=32 6 .if ${BITS} == 32 7 EXCLUDE=(*ppc64*) ;; 8 .endif 9 # the new one does not work for 32 bits and produces abi = 2 objects for 64 10 # so we keep the original under -v1 (aes-gcm-ppc.pl) 11 12 CRYPTODIST=${NETBSDSRCDIR}/crypto 13 .include "${NETBSDSRCDIR}/crypto/Makefile.openssl" 14 XLATE=${OPENSSLSRC}/crypto/perlasm/ppc-xlate.pl 15 16 regen: 17 for i in $$(find ${OPENSSLSRC} -name \*ppc\*.pl); do \ 18 case $$i in \ 19 ${EXCLUDE} \ 20 (*aes-gcm-ppc.pl) ;; \ 21 (*xlate.pl) ;; \ 22 (*sha512*) perl $$i ${BITS} sha512 > sha512; \ 23 sed -e 's/bc 25,0,/bdnz+ /' \ 24 -e 's/bclr 14,2/beqlr/' \ 25 -e 's/bclr 6,2/bnelr/' \ 26 -e 's/bclr 14,0/bltlr/' \ 27 -e 's/bclr 12,0/bltlr/' \ 28 < sha512 > $$(basename $$i .pl).S; \ 29 perl $$i ${BITS} sha256 > sha256; \ 30 sed -e 's/bc 25,0,/bdnz+ /' \ 31 -e 's/bclr 14,2/beqlr/' \ 32 -e 's/bclr 6,2/bnelr/' \ 33 -e 's/bclr 14,0/bltlr/' \ 34 -e 's/bclr 12,0/bltlr/' \ 35 < sha256 > $$(basename $$i .pl | sed -e s/512/256/).S; \ 36 rm -f sha512 sha256;; \ 37 (*keccak1600-ppc64.pl) \ 38 if [ ${BITS} = 32 ]; then \ 39 continue; \ 40 fi; \ 41 perl $$i ${BITS} | perl ${XLATE} linux${BITS} | \ 42 sed -e 's/bc 25,0,/bdnz+ /' \ 43 -e 's/bclr 14,2/beqlr/' \ 44 -e 's/bclr 6,2/bnelr/' \ 45 -e 's/bclr 14,0/bltlr/' \ 46 -e 's/bclr 12,0/bltlr/' \ 47 > $$(basename $$i .pl).S ;; \ 48 (*) perl $$i ${BITS} | perl ${XLATE} linux${BITS} | \ 49 sed -e 's/bc 25,0,/bdnz+ /' \ 50 -e 's/bclr 14,2/beqlr/' \ 51 -e 's/bclr 6,2/bnelr/' \ 52 -e 's/bclr 14,0/bltlr/' \ 53 -e 's/bclr 12,0/bltlr/' \ 54 > $$(basename $$i .pl | sed -e s/-v1//).S ;; \ 55 esac; \ 56 done 57