• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#	$OpenBSD: Makefile.inc,v 1.14 2019/11/25 10:32:35 djm Exp $
2
3REGRESS_FAIL_EARLY?=	yes
4
5.include <bsd.own.mk>
6.include <bsd.obj.mk>
7
8# User-settable options
9UNITTEST_FAST?= no	# Skip slow tests (e.g. less intensive fuzzing).
10UNITTEST_SLOW?= no	# Include slower tests (e.g. more intensive fuzzing).
11UNITTEST_VERBOSE?= no	# Verbose test output (inc. per-test names).
12
13MALLOC_OPTIONS?=	CFGJRSUX
14TEST_ENV?=		MALLOC_OPTIONS=${MALLOC_OPTIONS}
15
16# XXX detect from ssh binary?
17OPENSSL?=	yes
18
19.if (${OPENSSL:L} == "yes")
20CFLAGS+=	-DWITH_OPENSSL
21.endif
22
23# enable warnings
24WARNINGS=Yes
25
26DEBUG=-g
27CFLAGS+=	-fstack-protector-all
28CDIAGFLAGS=	-Wall
29CDIAGFLAGS+=	-Wextra
30CDIAGFLAGS+=	-Werror
31CDIAGFLAGS+=	-Wchar-subscripts
32CDIAGFLAGS+=	-Wcomment
33CDIAGFLAGS+=	-Wformat
34CDIAGFLAGS+=	-Wformat-security
35CDIAGFLAGS+=	-Wimplicit
36CDIAGFLAGS+=	-Winline
37CDIAGFLAGS+=	-Wmissing-declarations
38CDIAGFLAGS+=	-Wmissing-prototypes
39CDIAGFLAGS+=	-Wparentheses
40CDIAGFLAGS+=	-Wpointer-arith
41CDIAGFLAGS+=	-Wreturn-type
42CDIAGFLAGS+=	-Wshadow
43CDIAGFLAGS+=	-Wsign-compare
44CDIAGFLAGS+=	-Wstrict-aliasing
45CDIAGFLAGS+=	-Wstrict-prototypes
46CDIAGFLAGS+=	-Wswitch
47CDIAGFLAGS+=	-Wtrigraphs
48CDIAGFLAGS+=	-Wuninitialized
49CDIAGFLAGS+=	-Wunused
50CDIAGFLAGS+=	-Wno-unused-parameter
51.if ${COMPILER_VERSION:L} != "gcc3"
52CDIAGFLAGS+=	-Wold-style-definition
53.endif
54
55SSHREL=../../../../../usr.bin/ssh
56
57CFLAGS+=-I${.CURDIR}/../test_helper -I${.CURDIR}/${SSHREL}
58
59.if exists(${.CURDIR}/../test_helper/${__objdir})
60LDADD+=-L${.CURDIR}/../test_helper/${__objdir} -ltest_helper
61DPADD+=${.CURDIR}/../test_helper/${__objdir}/libtest_helper.a
62.else
63LDADD+=-L${.CURDIR}/../test_helper -ltest_helper
64DPADD+=${.CURDIR}/../test_helper/libtest_helper.a
65.endif
66
67.PATH: ${.CURDIR}/${SSHREL}
68
69LDADD+= -lutil
70DPADD+= ${LIBUTIL}
71
72.if (${OPENSSL:L} == "yes")
73LDADD+= -lcrypto
74DPADD+= ${LIBCRYPTO}
75.endif
76
77LDADD+= -lfido2 -lcbor -lusbhid
78DPADD+= ${LIBFIDO2} ${LIBCBOR} ${LIBUSBHID}
79
80UNITTEST_ARGS?=
81
82.if (${UNITTEST_VERBOSE:L} != "no")
83UNITTEST_ARGS+= -v
84.endif
85.if (${UNITTEST_FAST:L} != "no")
86UNITTEST_ARGS+= -f
87.elif (${UNITTEST_SLOW:L} != "no")
88UNITTEST_ARGS+= -F
89.endif
90