2 # Use this to help generate the asm *.S 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 arch subdir, and correct any exposed paths and $ FreeBSD $ tags.
7 .include "Makefile.inc"
9 .if ${MACHINE_CPUARCH} == "amd64"
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/md5/asm \
16 ${LCRYPTO_SRC}/crypto/modes/asm \
17 ${LCRYPTO_SRC}/crypto/rc4/asm \
18 ${LCRYPTO_SRC}/crypto/rc5/asm \
19 ${LCRYPTO_SRC}/crypto/sha/asm \
20 ${LCRYPTO_SRC}/crypto/whrlpool/asm
23 SRCS= aes-x86_64.pl aesni-sha1-x86_64.pl aesni-x86_64.pl bsaes-x86_64.pl \
27 SRCS+= modexp512-x86_64.pl x86_64-gf2m.pl x86_64-mont.pl x86_64-mont5.pl
36 SRCS+= ghash-x86_64.pl
39 SRCS+= rc4-md5-x86_64.pl rc4-x86_64.pl
50 SHA_ASM= sha256-x86_64 sha512-x86_64
51 SHA_SRC= sha512-x86_64.pl
52 SHA_TMP= ${SHA_ASM:S/$/.s/}
54 ASM= ${SRCS:R:S/$/.S/} ${SHA_ASM:S/$/.S/}
58 CLEANFILES= ${ASM} ${SHA_ASM:S/$/.s/}
62 ( echo '# $$'FreeBSD'$$' ;\
63 echo '# Do not modify. This file is auto-generated from ${.IMPSRC:T}.' ;\
64 env CC=cc perl ${.IMPSRC} elf ) > ${.TARGET}
66 ${SHA_TMP}: ${SHA_SRC}
67 env CC=cc perl ${.ALLSRC} elf ${.TARGET}
71 ( echo ' # $$'FreeBSD'$$' ;\
72 echo ' # Do not modify. This file is auto-generated from ${SHA_SRC}.' ;\
73 cat ${s}.s ) > ${.TARGET}
76 .elif ${MACHINE_CPUARCH} == "i386"
78 .PATH: ${LCRYPTO_SRC}/crypto \
79 ${LCRYPTO_SRC}/crypto/aes/asm \
80 ${LCRYPTO_SRC}/crypto/bf/asm \
81 ${LCRYPTO_SRC}/crypto/bn/asm \
82 ${LCRYPTO_SRC}/crypto/camellia/asm \
83 ${LCRYPTO_SRC}/crypto/cast/asm \
84 ${LCRYPTO_SRC}/crypto/des/asm \
85 ${LCRYPTO_SRC}/crypto/md5/asm \
86 ${LCRYPTO_SRC}/crypto/modes/asm \
87 ${LCRYPTO_SRC}/crypto/rc4/asm \
88 ${LCRYPTO_SRC}/crypto/rc5/asm \
89 ${LCRYPTO_SRC}/crypto/ripemd/asm \
90 ${LCRYPTO_SRC}/crypto/sha/asm \
91 ${LCRYPTO_SRC}/crypto/whrlpool/asm
93 PERLPATH= -I${LCRYPTO_SRC}/crypto/des/asm -I${LCRYPTO_SRC}/crypto/perlasm
96 SRCS= aes-586.pl aesni-x86.pl vpaes-x86.pl
99 SRCS+= bf-586.pl bf-686.pl
102 SRCS+= bn-586.pl co-586.pl x86-gf2m.pl x86-mont.pl
111 SRCS+= crypt586.pl des-586.pl
129 SRCS+= sha1-586.pl sha256-586.pl sha512-586.pl
137 ASM= ${SRCS:R:S/$/.S/}
145 ( echo '# $$'FreeBSD'$$' ;\
146 echo '# Do not modify. This file is auto-generated from ${.IMPSRC:T}.' ;\
148 env CC=cc perl ${PERLPATH} ${.IMPSRC} elf ${CFLAGS} -fpic -DPIC ;\
150 env CC=cc perl ${PERLPATH} ${.IMPSRC} elf ${CFLAGS} ;\
152 sed -E 's|(\.file[[:blank:]]+)".*"|\1"${.TARGET}"|' > ${.TARGET}
155 .include <bsd.prog.mk>