Home | History | Annotate | Line # | Download | only in libcrypt
Makefile revision 1.32
      1 #	$NetBSD: Makefile,v 1.32 2021/10/31 09:16:08 nia 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 COPTS.argon2.c+=	-Wno-error=cast-qual
     32 COPTS.core.c+=		-Wno-error=type-limits
     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 
     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