1 # $NetBSD: Makefile,v 1.35 2023/09/04 23:00:48 mrg 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 CPPFLAGS+= -include ${.CURDIR}/namespace.h 19 20 .if defined(HAVE_ARGON2) 21 ARGON2DIR= ${NETBSDSRCDIR}/external/apache2/argon2 22 .PATH: ${ARGON2DIR}/dist/phc-winner-argon2/src \ 23 ${ARGON2DIR}/dist/phc-winner-argon2/src/blake2 \ 24 ${ARGON2DIR}/dist/phc-winner-argon2/include 25 CPPFLAGS+= -DHAVE_ARGON2 -DARGON2_NO_THREADS 26 CPPFLAGS+= -I${ARGON2DIR}/dist/phc-winner-argon2/include 27 SRCS+= crypt-argon2.c 28 # libargon2 sources 29 . for src in argon2.c core.c blake2b.c encoding.c ref.c 30 SRCS+= ${src} 31 COPTS.${src}+= -fvisibility=hidden 32 . endfor 33 . if ${MACHINE} == "vax" 34 COPTS.blake2b.c+= -O0 35 . endif 36 .endif 37 38 WARNS?= 5 39 40 MAN= crypt.3 pw_gensalt.3 41 MLINKS= crypt.3 encrypt.3 crypt.3 setkey.3 42 43 # XXXGCC12 - init_perm() takes a larger array than IE3264[] is, but 44 # it doesn't need more. 45 COPTS.crypt.c+= ${CC_WNO_STRINGOP_OVERFLOW} 46 47 .if make(*.test) 48 .SUFFIXES: .test 49 .c.test: 50 ${CC} -o $@ -DUNIT_TEST -DMAIN ${LDSTATIC} ${.IMPSRC} ${LDADD} 51 LDADD+= -L${.OBJDIR} -l${LIB} -L${.OBJDIR}/../../libc 52 DPADD+= lib${LIB}.a 53 LDSTATIC?= -static 54 .include <bsd.prog.mk> 55 .else 56 .include <bsd.lib.mk> 57 .endif 58