1 # $NetBSD: Makefile,v 1.33 2021/11/01 03:09:58 agc Exp $ 2 3 USE_FORT?= yes # cryptographic software 4 5 .include <bsd.own.mk> 6 7 USE_SHLIBDIR= yes 8 9 .if (defined(MKARGON2) && ${MKARGON2} != "no") 10 HAVE_ARGON2=1 11 .endif 12 13 LIB= crypt 14 15 SRCS= crypt.c md5crypt.c bcrypt.c crypt-sha1.c util.c pw_gensalt.c 16 SRCS+= hmac_sha1.c 17 18 .if defined(HAVE_ARGON2) 19 ARGON2DIR= ${NETBSDSRCDIR}/external/apache2/argon2 20 .PATH: ${ARGON2DIR}/dist/phc-winner-argon2/src \ 21 ${ARGON2DIR}/dist/phc-winner-argon2/src/blake2 \ 22 ${ARGON2DIR}/dist/phc-winner-argon2/include 23 CPPFLAGS+= -DHAVE_ARGON2 -DARGON2_NO_THREADS 24 CPPFLAGS+= -I${ARGON2DIR}/dist/phc-winner-argon2/include 25 SRCS+= crypt-argon2.c 26 # libargon2 sources 27 . for src in argon2.c core.c blake2b.c encoding.c ref.c 28 SRCS+= ${src} 29 COPTS.${src}+= -fvisibility=hidden 30 . endfor 31 . if ${MACHINE} == "vax" 32 COPTS.blake2b.c+= -O0 33 . endif 34 .endif 35 36 WARNS?= 5 37 38 MAN= crypt.3 pw_gensalt.3 39 MLINKS= crypt.3 encrypt.3 crypt.3 setkey.3 40 41 42 .if make(*.test) 43 .SUFFIXES: .test 44 .c.test: 45 ${CC} -o $@ -DUNIT_TEST -DMAIN ${LDSTATIC} ${.IMPSRC} ${LDADD} 46 LDADD+= -L${.OBJDIR} -l${LIB} -L${.OBJDIR}/../../libc 47 DPADD+= lib${LIB}.a 48 LDSTATIC?= -static 49 .include <bsd.prog.mk> 50 .else 51 .include <bsd.lib.mk> 52 .endif 53