1#	$NetBSD: Makefile,v 1.1.1.1 2018/02/03 22:43:38 christos Exp $
2
3.include "bsd.own.mk"
4
5CRYPTODIST=${NETBSDSRCDIR}/crypto
6.include "${NETBSDSRCDIR}/crypto/Makefile.openssl"
7
8.if make(regen) && ${HAVE_LLVM:U} == "yes"
9CC+= -fno-integrated-as
10.endif
11
12regen:
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/${MACHINE_ARCH}cpuid.pl ; do \
17                (set +x; echo "#include <machine/asm.h>"; CC=${CC:Q} perl $$i elf | sed \
18		    -e 's/.hidden	OPENSSL_cpuid_setup/.globl	OPENSSL_cpuid_setup/' \
19		    -e 's/call	OPENSSL_cpuid_setup/call	PIC_PLT(OPENSSL_cpuid_setup)/' \
20		    -e 's/rdseedq/rdseed/') \
21		> $$(basename $$i .pl).S; \
22	done
23