2002-05-03 00:14:39 +00:00
|
|
|
# $FreeBSD$
|
2016-05-10 20:31:09 +00:00
|
|
|
# Use this to help generate the asm *.S files after an import. It is not
|
2002-05-03 00:14:39 +00:00
|
|
|
# perfect by any means, but does what is needed.
|
2016-05-10 20:31:09 +00:00
|
|
|
# Do a 'make -f Makefile.asm all' and it will generate *.S. Move them
|
|
|
|
# to the arch subdir, and correct any exposed paths and $ FreeBSD $ tags.
|
2002-05-03 00:14:39 +00:00
|
|
|
|
|
|
|
.include "Makefile.inc"
|
|
|
|
|
2016-10-26 20:02:22 +00:00
|
|
|
.if defined(ASM_aarch64)
|
|
|
|
|
|
|
|
.PATH: ${LCRYPTO_SRC}/crypto \
|
|
|
|
${LCRYPTO_SRC}/crypto/aes/asm \
|
|
|
|
${LCRYPTO_SRC}/crypto/modes/asm \
|
|
|
|
${LCRYPTO_SRC}/crypto/sha/asm
|
|
|
|
|
|
|
|
PERLPATH= -I${LCRYPTO_SRC}/crypto/perlasm
|
|
|
|
|
|
|
|
# aes
|
|
|
|
SRCS= aesv8-armx.pl
|
|
|
|
|
|
|
|
# modes
|
|
|
|
SRCS+= ghashv8-armx.pl
|
|
|
|
|
|
|
|
# sha
|
|
|
|
SRCS+= sha1-armv8.pl sha512-armv8.pl
|
|
|
|
|
|
|
|
ASM= ${SRCS:R:S/$/.S/} sha256-armv8.S
|
|
|
|
|
|
|
|
all: ${ASM}
|
|
|
|
|
|
|
|
CLEANFILES= ${ASM} ${SRCS:R:S/$/.s/} sha256-armv8.s
|
|
|
|
.SUFFIXES: .pl
|
|
|
|
|
|
|
|
sha256-armv8.S: sha512-armv8.pl
|
|
|
|
env CC=cc perl ${.ALLSRC} 64 ${.TARGET:R:S/$/.s/}
|
|
|
|
( echo '/* $$'FreeBSD'$$ */' ;\
|
|
|
|
echo '/* Do not modify. This file is auto-generated from ${.ALLSRC:T:R:S/$/.pl/}. */' ;\
|
|
|
|
cat ${.TARGET:R:S/$/.s/}) > ${.TARGET}
|
|
|
|
|
|
|
|
.pl.S:
|
|
|
|
env CC=cc perl ${.IMPSRC} 64 ${.TARGET:R:S/$/.s/}
|
|
|
|
( echo '/* $$'FreeBSD'$$ */' ;\
|
|
|
|
echo '/* Do not modify. This file is auto-generated from ${.IMPSRC:T:R:S/$/.pl/}. */' ;\
|
|
|
|
cat ${.TARGET:R:S/$/.s/}) > ${.TARGET}
|
|
|
|
|
|
|
|
.elif defined(ASM_amd64)
|
2012-07-12 19:30:53 +00:00
|
|
|
|
|
|
|
.PATH: ${LCRYPTO_SRC}/crypto \
|
|
|
|
${LCRYPTO_SRC}/crypto/aes/asm \
|
|
|
|
${LCRYPTO_SRC}/crypto/bn/asm \
|
|
|
|
${LCRYPTO_SRC}/crypto/camellia/asm \
|
2015-10-30 20:51:33 +00:00
|
|
|
${LCRYPTO_SRC}/crypto/ec/asm \
|
2012-07-12 19:30:53 +00:00
|
|
|
${LCRYPTO_SRC}/crypto/md5/asm \
|
|
|
|
${LCRYPTO_SRC}/crypto/modes/asm \
|
|
|
|
${LCRYPTO_SRC}/crypto/rc4/asm \
|
|
|
|
${LCRYPTO_SRC}/crypto/sha/asm \
|
|
|
|
${LCRYPTO_SRC}/crypto/whrlpool/asm
|
|
|
|
|
|
|
|
# aes
|
2015-10-30 20:51:33 +00:00
|
|
|
SRCS= aes-x86_64.pl aesni-mb-x86_64.pl aesni-sha1-x86_64.pl \
|
|
|
|
aesni-sha256-x86_64.pl aesni-x86_64.pl bsaes-x86_64.pl \
|
2012-07-12 19:30:53 +00:00
|
|
|
vpaes-x86_64.pl
|
|
|
|
|
|
|
|
# bn
|
2015-10-30 20:51:33 +00:00
|
|
|
SRCS+= rsaz-avx2.pl rsaz-x86_64.pl x86_64-gf2m.pl x86_64-mont.pl \
|
|
|
|
x86_64-mont5.pl
|
2012-07-12 19:30:53 +00:00
|
|
|
|
|
|
|
# camellia
|
|
|
|
SRCS+= cmll-x86_64.pl
|
|
|
|
|
2015-10-30 20:51:33 +00:00
|
|
|
# ec
|
|
|
|
SRCS+= ecp_nistz256-x86_64.pl
|
|
|
|
|
2012-07-12 19:30:53 +00:00
|
|
|
# md5
|
|
|
|
SRCS+= md5-x86_64.pl
|
|
|
|
|
|
|
|
# modes
|
2015-10-30 20:51:33 +00:00
|
|
|
SRCS+= aesni-gcm-x86_64.pl ghash-x86_64.pl
|
2012-07-12 19:30:53 +00:00
|
|
|
|
|
|
|
# rc4
|
|
|
|
SRCS+= rc4-md5-x86_64.pl rc4-x86_64.pl
|
|
|
|
|
|
|
|
# sha
|
2016-05-11 19:59:05 +00:00
|
|
|
SRCS+= sha1-mb-x86_64.pl sha1-x86_64.pl sha256-mb-x86_64.pl
|
2012-07-12 19:30:53 +00:00
|
|
|
|
|
|
|
# whrlpool
|
|
|
|
SRCS+= wp-x86_64.pl
|
|
|
|
|
2016-05-11 19:59:05 +00:00
|
|
|
# cpuid
|
|
|
|
SRCS+= x86_64cpuid.pl
|
2012-07-12 19:30:53 +00:00
|
|
|
|
2016-05-11 19:59:05 +00:00
|
|
|
SHA_ASM= sha256-x86_64 sha512-x86_64
|
|
|
|
SHA_SRC= sha512-x86_64.pl
|
|
|
|
SHA_TMP= ${SHA_ASM:S/$/.s/}
|
2012-07-12 19:30:53 +00:00
|
|
|
|
2016-05-11 19:59:05 +00:00
|
|
|
ASM= ${SRCS:R:S/$/.S/} ${SHA_ASM:S/$/.S/}
|
2012-07-12 19:30:53 +00:00
|
|
|
|
2016-05-11 19:59:05 +00:00
|
|
|
all: ${ASM}
|
2012-07-12 19:30:53 +00:00
|
|
|
|
2016-05-11 19:59:05 +00:00
|
|
|
CLEANFILES= ${ASM} ${SHA_ASM:S/$/.s/}
|
|
|
|
.SUFFIXES: .pl
|
2012-07-12 19:30:53 +00:00
|
|
|
|
2016-05-11 19:59:05 +00:00
|
|
|
.pl.S:
|
2016-08-22 21:49:17 +00:00
|
|
|
( echo '/* $$'FreeBSD'$$ */' ;\
|
|
|
|
echo '/* Do not modify. This file is auto-generated from ${.IMPSRC:T}. */' ;\
|
2016-05-11 20:06:23 +00:00
|
|
|
env CC=cc perl ${.IMPSRC} elf ) > ${.TARGET}
|
2016-05-11 19:59:05 +00:00
|
|
|
|
|
|
|
${SHA_TMP}: ${SHA_SRC}
|
2016-05-11 20:06:23 +00:00
|
|
|
env CC=cc perl ${.ALLSRC} elf ${.TARGET}
|
2012-07-12 19:30:53 +00:00
|
|
|
|
2016-05-11 19:59:05 +00:00
|
|
|
.for s in ${SHA_ASM}
|
|
|
|
${s}.S: ${s}.s
|
2016-08-22 21:49:17 +00:00
|
|
|
( echo '/* $$'FreeBSD'$$ */' ;\
|
|
|
|
echo '/* Do not modify. This file is auto-generated from ${SHA_SRC}. */' ;\
|
2016-05-11 19:59:05 +00:00
|
|
|
cat ${s}.s ) > ${.TARGET}
|
|
|
|
.endfor
|
2012-07-12 19:30:53 +00:00
|
|
|
|
2016-08-22 20:59:34 +00:00
|
|
|
.elif defined(ASM_arm)
|
|
|
|
|
|
|
|
.PATH: ${LCRYPTO_SRC}/crypto \
|
|
|
|
${LCRYPTO_SRC}/crypto/aes/asm \
|
|
|
|
${LCRYPTO_SRC}/crypto/bn/asm \
|
|
|
|
${LCRYPTO_SRC}/crypto/modes/asm \
|
|
|
|
${LCRYPTO_SRC}/crypto/sha/asm
|
|
|
|
|
|
|
|
PERLPATH= -I${LCRYPTO_SRC}/crypto/perlasm
|
|
|
|
|
|
|
|
# aes
|
|
|
|
SRCS= aesv8-armx.pl bsaes-armv7.pl
|
|
|
|
|
|
|
|
# bn
|
|
|
|
SRCS+= armv4-mont.pl armv4-gf2m.pl
|
|
|
|
|
|
|
|
# modes
|
|
|
|
SRCS+= ghash-armv4.pl ghashv8-armx.pl
|
|
|
|
|
|
|
|
# sha
|
|
|
|
SRCS+= sha1-armv4-large.pl sha256-armv4.pl sha512-armv4.pl
|
|
|
|
|
|
|
|
ASM= aes-armv4.S ${SRCS:R:S/$/.S/}
|
|
|
|
|
|
|
|
all: ${ASM}
|
|
|
|
|
|
|
|
CLEANFILES= ${ASM} ${SRCS:R:S/$/.s/}
|
|
|
|
.SUFFIXES: .pl
|
|
|
|
|
|
|
|
aes-armv4.S: aes-armv4.pl
|
2016-08-22 21:49:17 +00:00
|
|
|
( echo '/* $$'FreeBSD'$$ */' ;\
|
|
|
|
echo '/* Do not modify. This file is auto-generated from ${.ALLSRC:T}. */' ;\
|
2016-08-22 20:59:34 +00:00
|
|
|
env CC=cc perl ${.ALLSRC} elf ) > ${.TARGET}
|
|
|
|
|
|
|
|
.pl.S:
|
|
|
|
env CC=cc perl ${.IMPSRC} elf ${.TARGET:R:S/$/.s/}
|
2016-08-22 21:49:17 +00:00
|
|
|
( echo '/* $$'FreeBSD'$$ */' ;\
|
|
|
|
echo '/* Do not modify. This file is auto-generated from ${.IMPSRC:T:R:S/$/.pl/}. */' ;\
|
2016-08-22 20:59:34 +00:00
|
|
|
cat ${.TARGET:R:S/$/.s/}) > ${.TARGET}
|
|
|
|
|
2016-08-17 22:13:39 +00:00
|
|
|
.elif defined(ASM_i386)
|
2012-07-12 19:30:53 +00:00
|
|
|
|
|
|
|
.PATH: ${LCRYPTO_SRC}/crypto \
|
|
|
|
${LCRYPTO_SRC}/crypto/aes/asm \
|
|
|
|
${LCRYPTO_SRC}/crypto/bf/asm \
|
|
|
|
${LCRYPTO_SRC}/crypto/bn/asm \
|
|
|
|
${LCRYPTO_SRC}/crypto/camellia/asm \
|
|
|
|
${LCRYPTO_SRC}/crypto/des/asm \
|
|
|
|
${LCRYPTO_SRC}/crypto/md5/asm \
|
|
|
|
${LCRYPTO_SRC}/crypto/modes/asm \
|
|
|
|
${LCRYPTO_SRC}/crypto/rc4/asm \
|
|
|
|
${LCRYPTO_SRC}/crypto/rc5/asm \
|
|
|
|
${LCRYPTO_SRC}/crypto/ripemd/asm \
|
|
|
|
${LCRYPTO_SRC}/crypto/sha/asm \
|
|
|
|
${LCRYPTO_SRC}/crypto/whrlpool/asm
|
2002-05-03 00:14:39 +00:00
|
|
|
|
2005-02-25 06:04:12 +00:00
|
|
|
PERLPATH= -I${LCRYPTO_SRC}/crypto/des/asm -I${LCRYPTO_SRC}/crypto/perlasm
|
2002-05-03 00:14:39 +00:00
|
|
|
|
2012-07-12 19:30:53 +00:00
|
|
|
# aes
|
|
|
|
SRCS= aes-586.pl aesni-x86.pl vpaes-x86.pl
|
|
|
|
|
2002-05-03 00:14:39 +00:00
|
|
|
# blowfish
|
2012-07-12 19:30:53 +00:00
|
|
|
SRCS+= bf-586.pl bf-686.pl
|
2002-05-03 00:14:39 +00:00
|
|
|
|
|
|
|
# bn
|
2012-07-12 19:30:53 +00:00
|
|
|
SRCS+= bn-586.pl co-586.pl x86-gf2m.pl x86-mont.pl
|
|
|
|
|
|
|
|
# camellia
|
|
|
|
SRCS+= cmll-x86.pl
|
2002-05-03 00:14:39 +00:00
|
|
|
|
|
|
|
# des
|
2012-07-12 19:30:53 +00:00
|
|
|
SRCS+= crypt586.pl des-586.pl
|
2002-05-03 00:14:39 +00:00
|
|
|
|
|
|
|
# md5
|
|
|
|
SRCS+= md5-586.pl
|
|
|
|
|
2012-07-12 19:30:53 +00:00
|
|
|
# modes
|
|
|
|
SRCS+= ghash-x86.pl
|
|
|
|
|
2002-05-03 00:14:39 +00:00
|
|
|
# rc4
|
|
|
|
SRCS+= rc4-586.pl
|
|
|
|
|
|
|
|
# rc5
|
|
|
|
SRCS+= rc5-586.pl
|
|
|
|
|
|
|
|
# ripemd
|
|
|
|
SRCS+= rmd-586.pl
|
|
|
|
|
|
|
|
# sha
|
2012-07-12 19:30:53 +00:00
|
|
|
SRCS+= sha1-586.pl sha256-586.pl sha512-586.pl
|
|
|
|
|
|
|
|
# whrlpool
|
|
|
|
SRCS+= wp-mmx.pl
|
|
|
|
|
|
|
|
# cpuid
|
|
|
|
SRCS+= x86cpuid.pl
|
2002-05-03 00:14:39 +00:00
|
|
|
|
2016-05-11 19:59:05 +00:00
|
|
|
ASM= ${SRCS:R:S/$/.S/}
|
2002-05-03 00:14:39 +00:00
|
|
|
|
|
|
|
all: ${ASM}
|
|
|
|
|
2016-05-11 19:59:05 +00:00
|
|
|
CLEANFILES= ${ASM}
|
2012-07-12 19:30:53 +00:00
|
|
|
.SUFFIXES: .pl
|
2002-05-03 00:14:39 +00:00
|
|
|
|
2016-05-10 20:31:09 +00:00
|
|
|
.pl.S:
|
2016-08-22 21:49:17 +00:00
|
|
|
( echo '/* $$'FreeBSD'$$ */' ;\
|
|
|
|
echo '/* Do not modify. This file is auto-generated from ${.IMPSRC:T}. */' ;\
|
2016-05-10 20:31:09 +00:00
|
|
|
echo '#ifdef PIC' ;\
|
2016-05-11 20:06:23 +00:00
|
|
|
env CC=cc perl ${PERLPATH} ${.IMPSRC} elf ${CFLAGS} -fpic -DPIC ;\
|
2016-05-10 20:31:09 +00:00
|
|
|
echo '#else' ;\
|
2016-05-11 20:06:23 +00:00
|
|
|
env CC=cc perl ${PERLPATH} ${.IMPSRC} elf ${CFLAGS} ;\
|
2016-05-10 20:31:09 +00:00
|
|
|
echo '#endif') |\
|
|
|
|
sed -E 's|(\.file[[:blank:]]+)".*"|\1"${.TARGET}"|' > ${.TARGET}
|
2012-07-12 19:30:53 +00:00
|
|
|
.endif
|
2002-05-03 00:14:39 +00:00
|
|
|
|
|
|
|
.include <bsd.prog.mk>
|