2024-01-11 01:45:58 +00:00
|
|
|
# $OpenBSD: Makefile.inc,v 1.16 2024/01/11 01:45:58 djm Exp $
|
2018-11-22 04:52:26 +00:00
|
|
|
|
2014-05-15 05:17:15 +00:00
|
|
|
.include <bsd.own.mk>
|
|
|
|
.include <bsd.obj.mk>
|
|
|
|
|
2018-10-17 23:28:05 +00:00
|
|
|
# User-settable options
|
|
|
|
UNITTEST_FAST?= no # Skip slow tests (e.g. less intensive fuzzing).
|
|
|
|
UNITTEST_SLOW?= no # Include slower tests (e.g. more intensive fuzzing).
|
|
|
|
UNITTEST_VERBOSE?= no # Verbose test output (inc. per-test names).
|
|
|
|
|
2018-11-22 04:52:26 +00:00
|
|
|
MALLOC_OPTIONS?= CFGJRSUX
|
|
|
|
TEST_ENV?= MALLOC_OPTIONS=${MALLOC_OPTIONS}
|
|
|
|
|
|
|
|
# XXX detect from ssh binary?
|
|
|
|
OPENSSL?= yes
|
2024-01-11 01:45:58 +00:00
|
|
|
DSAKEY?= yes
|
|
|
|
|
|
|
|
.if (${DSAKEY:L} == "yes")
|
|
|
|
CFLAGS+= -DWITH_DSA
|
|
|
|
.endif
|
2018-11-22 04:52:26 +00:00
|
|
|
|
|
|
|
.if (${OPENSSL:L} == "yes")
|
|
|
|
CFLAGS+= -DWITH_OPENSSL
|
|
|
|
.endif
|
|
|
|
|
2014-05-15 05:17:15 +00:00
|
|
|
# enable warnings
|
|
|
|
WARNINGS=Yes
|
|
|
|
|
|
|
|
DEBUG=-g
|
|
|
|
CFLAGS+= -fstack-protector-all
|
|
|
|
CDIAGFLAGS= -Wall
|
|
|
|
CDIAGFLAGS+= -Wextra
|
|
|
|
CDIAGFLAGS+= -Werror
|
|
|
|
CDIAGFLAGS+= -Wchar-subscripts
|
|
|
|
CDIAGFLAGS+= -Wcomment
|
|
|
|
CDIAGFLAGS+= -Wformat
|
|
|
|
CDIAGFLAGS+= -Wformat-security
|
|
|
|
CDIAGFLAGS+= -Wimplicit
|
|
|
|
CDIAGFLAGS+= -Winline
|
|
|
|
CDIAGFLAGS+= -Wmissing-declarations
|
|
|
|
CDIAGFLAGS+= -Wmissing-prototypes
|
|
|
|
CDIAGFLAGS+= -Wparentheses
|
|
|
|
CDIAGFLAGS+= -Wpointer-arith
|
|
|
|
CDIAGFLAGS+= -Wreturn-type
|
|
|
|
CDIAGFLAGS+= -Wshadow
|
|
|
|
CDIAGFLAGS+= -Wsign-compare
|
|
|
|
CDIAGFLAGS+= -Wstrict-aliasing
|
|
|
|
CDIAGFLAGS+= -Wstrict-prototypes
|
|
|
|
CDIAGFLAGS+= -Wswitch
|
|
|
|
CDIAGFLAGS+= -Wtrigraphs
|
|
|
|
CDIAGFLAGS+= -Wuninitialized
|
|
|
|
CDIAGFLAGS+= -Wunused
|
2017-12-21 00:41:22 +00:00
|
|
|
CDIAGFLAGS+= -Wno-unused-parameter
|
2017-04-17 11:02:31 +00:00
|
|
|
.if ${COMPILER_VERSION:L} != "gcc3"
|
2014-05-15 05:17:15 +00:00
|
|
|
CDIAGFLAGS+= -Wold-style-definition
|
|
|
|
.endif
|
|
|
|
|
|
|
|
SSHREL=../../../../../usr.bin/ssh
|
|
|
|
|
|
|
|
CFLAGS+=-I${.CURDIR}/../test_helper -I${.CURDIR}/${SSHREL}
|
|
|
|
|
|
|
|
.if exists(${.CURDIR}/../test_helper/${__objdir})
|
|
|
|
LDADD+=-L${.CURDIR}/../test_helper/${__objdir} -ltest_helper
|
|
|
|
DPADD+=${.CURDIR}/../test_helper/${__objdir}/libtest_helper.a
|
|
|
|
.else
|
|
|
|
LDADD+=-L${.CURDIR}/../test_helper -ltest_helper
|
|
|
|
DPADD+=${.CURDIR}/../test_helper/libtest_helper.a
|
|
|
|
.endif
|
|
|
|
|
2017-12-21 00:41:22 +00:00
|
|
|
.PATH: ${.CURDIR}/${SSHREL}
|
2014-05-15 05:17:15 +00:00
|
|
|
|
2018-11-22 04:52:26 +00:00
|
|
|
LDADD+= -lutil
|
|
|
|
DPADD+= ${LIBUTIL}
|
|
|
|
|
|
|
|
.if (${OPENSSL:L} == "yes")
|
2014-05-15 05:17:15 +00:00
|
|
|
LDADD+= -lcrypto
|
|
|
|
DPADD+= ${LIBCRYPTO}
|
2018-11-22 04:52:26 +00:00
|
|
|
.endif
|
2018-10-17 23:28:05 +00:00
|
|
|
|
2019-11-25 10:32:35 +00:00
|
|
|
LDADD+= -lfido2 -lcbor -lusbhid
|
|
|
|
DPADD+= ${LIBFIDO2} ${LIBCBOR} ${LIBUSBHID}
|
|
|
|
|
2018-10-17 23:28:05 +00:00
|
|
|
UNITTEST_ARGS?=
|
|
|
|
|
|
|
|
.if (${UNITTEST_VERBOSE:L} != "no")
|
|
|
|
UNITTEST_ARGS+= -v
|
|
|
|
.endif
|
|
|
|
.if (${UNITTEST_FAST:L} != "no")
|
|
|
|
UNITTEST_ARGS+= -f
|
|
|
|
.elif (${UNITTEST_SLOW:L} != "no")
|
|
|
|
UNITTEST_ARGS+= -F
|
|
|
|
.endif
|