[BACK]Return to Makefile CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / lib / libcrypt

File: [cvs.NetBSD.org] / src / lib / libcrypt / Makefile (download)

Revision 1.29, Wed Oct 13 14:28:32 2021 UTC (7 weeks, 6 days ago) by nia
Branch: MAIN
Changes since 1.28: +5 -1 lines

libcrypt: work around compiler bugs to get MKARGON2 working on vax

#	$NetBSD: Makefile,v 1.29 2021/10/13 14:28:32 nia Exp $

.include <bsd.own.mk>

USE_SHLIBDIR=	yes

.if (defined(MKARGON2) && ${MKARGON2} != "no")
HAVE_ARGON2=1
.endif

LIB=	crypt

SRCS=	crypt.c md5crypt.c bcrypt.c crypt-sha1.c util.c pw_gensalt.c
SRCS+=	hmac_sha1.c

.if defined(HAVE_ARGON2)
ARGON2DIR=	${NETBSDSRCDIR}/external/apache2/argon2
.PATH: ${ARGON2DIR}/dist/phc-winner-argon2/src \
	${ARGON2DIR}/dist/phc-winner-argon2/src/blake2 \
	${ARGON2DIR}/dist/phc-winner-argon2/include
CPPFLAGS+=	-DHAVE_ARGON2 -DARGON2_NO_THREADS
CPPFLAGS+=	-I${ARGON2DIR}/dist/phc-winner-argon2/include
SRCS+=		crypt-argon2.c
# libargon2 sources
.  for src in argon2.c core.c blake2b.c encoding.c ref.c
SRCS+=		${src}
COPTS.${src}+=	-Wno-error
COPTS.${src}+=	-fvisibility=hidden
.  endfor
.  if ${MACHINE} == "vax"
COPTS.blake2b.c+=	-O0
.  endif
.endif

WARNS?=	5

MAN=	crypt.3 pw_gensalt.3
MLINKS= crypt.3 encrypt.3 crypt.3 setkey.3


.if make(*.test)
.SUFFIXES: .test
.c.test:
	${CC} -o $@ -DUNIT_TEST -DMAIN ${LDSTATIC} ${.IMPSRC} ${LDADD}
LDADD+= -L${.OBJDIR} -l${LIB} -L${.OBJDIR}/../../libc
DPADD+= lib${LIB}.a
LDSTATIC?= -static
.include <bsd.prog.mk>
.else
.include <bsd.lib.mk>
.endif