Move guts of the Makefile into Makefile.inc so it can be re-used.

This commit is contained in:
christos 2022-05-17 18:55:41 +00:00
parent 3987c5ad40
commit 5fc96d7ad8
2 changed files with 24 additions and 14 deletions

View File

@ -1,23 +1,11 @@
# $NetBSD: Makefile,v 1.4 2021/11/22 14:34:35 nia Exp $
# $NetBSD: Makefile,v 1.5 2022/05/17 18:55:41 christos Exp $
LIBISPRIVATE= pic
.include <bsd.own.mk>
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
LIB= argon2
SRCS= argon2.c core.c blake2b.c thread.c encoding.c ref.c
CFLAGS+= -pthread
CPPFLAGS+= -I${ARGON2DIR}/dist/phc-winner-argon2/include
.if ${MACHINE} == "vax"
COPTS.blake2b.c+= -O0
.endif
.include "${.CURDIR}/Makefile.inc"
.include <bsd.lib.mk>

View File

@ -0,0 +1,22 @@
# $NetBSD: Makefile.inc,v 1.1 2022/05/17 18:55:41 christos Exp $
ARGON2DIR= ${NETBSDSRCDIR}/external/apache2/argon2/dist/phc-winner-argon2
.PATH.c: ${ARGON2DIR}/src ${ARGON2DIR}/src/blake2
SRCS+= argon2.c core.c blake2b.c encoding.c ref.c
CPPFLAGS+=-I${ARGON2DIR}/include
.if defined(ARGON2_NO_THREADS)
CPPFLAGS+= -DARGON2_NO_THREADS
.else
SRCS+= thread.c
CFLAGS+= -pthread
LDADD+=-lpthread
DPADD+=${LIBPTHREAD}
.endif
.if ${MACHINE} == "vax"
COPTS.blake2b.c+= -O0
.endif