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