Home | History | Annotate | Line # | Download | only in libcrypt
      1 #	$NetBSD: Makefile,v 1.36 2023/10/07 12:15:53 rin 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 .endif
     34 
     35 WARNS?=	5
     36 
     37 MAN=	crypt.3 pw_gensalt.3
     38 MLINKS= crypt.3 encrypt.3 crypt.3 setkey.3
     39 
     40 # XXXGCC12 - init_perm() takes a larger array than IE3264[] is, but
     41 # it doesn't need more.
     42 COPTS.crypt.c+=	${CC_WNO_STRINGOP_OVERFLOW}
     43 
     44 .if make(*.test)
     45 .SUFFIXES: .test
     46 .c.test:
     47 	${CC} -o $@ -DUNIT_TEST -DMAIN ${LDSTATIC} ${.IMPSRC} ${LDADD}
     48 LDADD+= -L${.OBJDIR} -l${LIB} -L${.OBJDIR}/../../libc
     49 DPADD+= lib${LIB}.a
     50 LDSTATIC?= -static
     51 .include <bsd.prog.mk>
     52 .else
     53 .include <bsd.lib.mk>
     54 .endif
     55