1# $FreeBSD$ 2# Use this to help generate the asm *.[Ss] files after an import. It is not 3# perfect by any means, but does what is needed. 4# Do a 'make -f Makefile.asm all' and it will generate *.s. Move them 5# to the i386 subdir, and correct any exposed paths and $ FreeBSD $ tags. 6 7.include "Makefile.inc" 8 9.if ${MACHINE_CPUARCH} == "amd64" 10 11.PATH: ${LCRYPTO_SRC}/crypto \ 12 ${LCRYPTO_SRC}/crypto/aes/asm \ 13 ${LCRYPTO_SRC}/crypto/bn/asm \ 14 ${LCRYPTO_SRC}/crypto/camellia/asm \ 15 ${LCRYPTO_SRC}/crypto/ec/asm \ 16 ${LCRYPTO_SRC}/crypto/md5/asm \ 17 ${LCRYPTO_SRC}/crypto/modes/asm \ 18 ${LCRYPTO_SRC}/crypto/rc4/asm \ 19 ${LCRYPTO_SRC}/crypto/sha/asm \ 20 ${LCRYPTO_SRC}/crypto/whrlpool/asm 21 22# aes 23SRCS= aes-x86_64.pl aesni-mb-x86_64.pl aesni-sha1-x86_64.pl \ 24 aesni-sha256-x86_64.pl aesni-x86_64.pl bsaes-x86_64.pl \ 25 vpaes-x86_64.pl 26 27# bn 28SRCS+= rsaz-avx2.pl rsaz-x86_64.pl x86_64-gf2m.pl x86_64-mont.pl \ 29 x86_64-mont5.pl 30 31# camellia 32SRCS+= cmll-x86_64.pl 33 34# ec 35SRCS+= ecp_nistz256-x86_64.pl 36 37# md5 38SRCS+= md5-x86_64.pl 39 40# modes 41SRCS+= aesni-gcm-x86_64.pl ghash-x86_64.pl 42 43# rc4 44SRCS+= rc4-md5-x86_64.pl rc4-x86_64.pl 45 46# sha 47SRCS+= sha1-mb-x86_64.pl sha1-x86_64.pl sha256-mb-x86_64.pl sha512-x86_64.pl 48 49# whrlpool 50SRCS+= wp-x86_64.pl 51 52ASM= ${SRCS:S/.pl/.S/} 53ASM+= sha256-x86_64.S x86_64cpuid.S 54 55all: ${ASM} 56 57CLEANFILES+= ${SRCS:M*.pl:S/.pl$/.cmt/} ${SRCS:M*.pl:S/.pl$/.S/} 58CLEANFILES+= sha256-x86_64.cmt sha256-x86_64.S x86_64cpuid.cmt x86_64cpuid.S 59.SUFFIXES: .pl .cmt 60 61.pl.cmt: 62 ( cd `dirname ${.IMPSRC}`/.. ; perl ${.IMPSRC} ${.OBJDIR}/${.TARGET} ) 63 64.cmt.S: 65 ( echo ' # $$'FreeBSD'$$'; cat ${.IMPSRC} ) > ${.TARGET} 66 67sha256-x86_64.cmt: sha512-x86_64.pl 68 ( cd `dirname ${.ALLSRC}`/.. ; perl ${.ALLSRC} ${.OBJDIR}/${.TARGET} ) 69 70x86_64cpuid.cmt: x86_64cpuid.pl 71 ( cd `dirname ${.ALLSRC}` ; perl ${.ALLSRC} ${.OBJDIR}/${.TARGET} ) 72 73.elif ${MACHINE_CPUARCH} == "i386" 74 75.PATH: ${LCRYPTO_SRC}/crypto \ 76 ${LCRYPTO_SRC}/crypto/aes/asm \ 77 ${LCRYPTO_SRC}/crypto/bf/asm \ 78 ${LCRYPTO_SRC}/crypto/bn/asm \ 79 ${LCRYPTO_SRC}/crypto/camellia/asm \ 80 ${LCRYPTO_SRC}/crypto/des/asm \ 81 ${LCRYPTO_SRC}/crypto/md5/asm \ 82 ${LCRYPTO_SRC}/crypto/modes/asm \ 83 ${LCRYPTO_SRC}/crypto/rc4/asm \ 84 ${LCRYPTO_SRC}/crypto/rc5/asm \ 85 ${LCRYPTO_SRC}/crypto/ripemd/asm \ 86 ${LCRYPTO_SRC}/crypto/sha/asm \ 87 ${LCRYPTO_SRC}/crypto/whrlpool/asm 88 89PERLPATH= -I${LCRYPTO_SRC}/crypto/des/asm -I${LCRYPTO_SRC}/crypto/perlasm 90 91# aes 92SRCS= aes-586.pl aesni-x86.pl vpaes-x86.pl 93 94# blowfish 95SRCS+= bf-586.pl bf-686.pl 96 97# bn 98SRCS+= bn-586.pl co-586.pl x86-gf2m.pl x86-mont.pl 99 100# camellia 101SRCS+= cmll-x86.pl 102 103# des 104SRCS+= crypt586.pl des-586.pl 105 106# md5 107SRCS+= md5-586.pl 108 109# modes 110SRCS+= ghash-x86.pl 111 112# rc4 113SRCS+= rc4-586.pl 114 115# rc5 116SRCS+= rc5-586.pl 117 118# ripemd 119SRCS+= rmd-586.pl 120 121# sha 122SRCS+= sha1-586.pl sha256-586.pl sha512-586.pl 123 124# whrlpool 125SRCS+= wp-mmx.pl 126 127# cpuid 128SRCS+= x86cpuid.pl 129 130ASM= ${SRCS:S/.pl/.s/} 131 132all: ${ASM} 133 134CLEANFILES+= ${SRCS:M*.pl:S/.pl$/.s/} 135.SUFFIXES: .pl 136 137.pl.s: 138 ( echo ' # $$'FreeBSD'$$' ;\ 139 perl ${PERLPATH} ${.IMPSRC} elf ${CFLAGS} ) > ${.TARGET} 140.endif 141 142.include <bsd.prog.mk> 143