Makefile.inc 2.0 KB

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