1 # $NetBSD: Makefile,v 1.46 2025/12/17 00:49:54 riastradh Exp $ 2 3 # libssh is not meant for applications to link against -- it's a 4 # private library of the ssh/sshd/&c. executables we ship. So don't 5 # install compat versions (we don't ship ssh/sshd/&c. as compat 6 # executables, only as native ones) or expose the .so symlink or .a 7 # static library for applications to link against. 8 # 9 # Note that while NOLINKLIB suppresses _installing_ the .so symlink, 10 # the .so symlink is still created in the objdir so bin/ssh can still 11 # use it to link. 12 NOLINKLIB= # defined 13 14 .include <bsd.own.mk> 15 16 .include "../Makefile.inc" 17 18 CWARNFLAGS.clang+= -Wno-error=sizeof-array-div 19 CWARNFLAGS.clang+= -Wno-error=format-nonliteral 20 LIB= ssh 21 SRCS=\ 22 addr.c \ 23 addrmatch.c \ 24 atomicio.c \ 25 authfd.c \ 26 authfile.c \ 27 bcrypt_pbkdf.c \ 28 bitmap.c \ 29 blowfish.c \ 30 canohost.c \ 31 chacha.c \ 32 channels.c \ 33 cipher-chachapoly.c \ 34 cipher.c \ 35 cleanup.c \ 36 compat.c \ 37 dh.c \ 38 dispatch.c \ 39 dns.c \ 40 ed25519.c \ 41 fatal.c \ 42 freezero.c \ 43 hash.c \ 44 hmac.c \ 45 hostfile.c \ 46 kex.c \ 47 kex-names.c \ 48 kexdh.c \ 49 kexecdh.c \ 50 kexgen.c \ 51 kexgex.c \ 52 kexgexc.c \ 53 kexmlkem768x25519.c \ 54 kexsntrup761x25519.c \ 55 krl.c \ 56 log.c \ 57 mac.c \ 58 match.c \ 59 misc.c \ 60 monitor_fdpass.c \ 61 msg.c \ 62 nchan.c \ 63 packet.c \ 64 poly1305.c \ 65 progressmeter.c \ 66 readpass.c \ 67 recallocarray.c \ 68 smult_curve25519_ref.c \ 69 sntrup761.c \ 70 ssh-ed25519.c \ 71 ssh-ed25519-sk.c \ 72 ssh-pkcs11.c \ 73 ssh-sk-client.c \ 74 sshbuf-getput-basic.c \ 75 sshbuf-getput-crypto.c \ 76 sshbuf-misc.c \ 77 sshbuf-io.c \ 78 sshbuf.c \ 79 ssherr.c \ 80 sshkey.c \ 81 ttymodes.c \ 82 uidswap.c \ 83 umac.c \ 84 umac128.c \ 85 utf8.c \ 86 xmalloc.c 87 88 OPENSSL_SRCS=\ 89 digest-openssl.c \ 90 kexc25519.c \ 91 ssh-ecdsa.c \ 92 ssh-ecdsa-sk.c \ 93 ssh-rsa.c 94 95 SRCS+= fmt_scaled.c 96 SRCS+= readpassphrase.c getpeereid.c getrrsetbyname.c 97 COPTS.monitor_fdpass.c+=-Wno-stack-protector 98 COPTS.sntrup761.c+= -Wno-stack-protector 99 100 .if WITH_OPENSSL 101 SRCS+= ${OPENSSL_SRCS} 102 .else 103 SRCS+= digest-libc.c 104 .endif 105 106 CPPFLAGS+= -DHAVE_BLF_H 107 108 CPPFLAGS+= -I${SSHDIST} 109 .PATH: ${SSHDIST} 110 111 LIBDPLIBS+= crypto ${NETBSDSRCDIR}/crypto/external/${EXTERNAL_OPENSSL_SUBDIR}/lib/libcrypto \ 112 crypt ${NETBSDSRCDIR}/lib/libcrypt \ 113 z ${NETBSDSRCDIR}/lib/libz 114 115 .for f in dns channels hostfile ssh-pkcs11 116 COPTS.${f}.c+= -Wno-pointer-sign 117 .endfor 118 119 # XXX 120 COPTS.channels.c+= -fno-strict-aliasing 121 122 COPTS.hostfile.c+= ${CC_WNO_FORMAT_TRUNCATION} 123 COPTS.sshkey.c+= ${CC_WNO_FORMAT_TRUNCATION} 124 COPTS.cipher.c+= -Wno-error=deprecated-declarations 125 COPTS.dh.c+= -Wno-error=deprecated-declarations 126 COPTS.kex.c+= -Wno-error=deprecated-declarations 127 COPTS.kexdh.c+= -Wno-error=deprecated-declarations 128 COPTS.kexecdh.c+= -Wno-error=deprecated-declarations 129 COPTS.kexgexc.c+= -Wno-error=deprecated-declarations 130 COPTS.ssh-ecdsa-sk.c+= -Wno-error=deprecated-declarations 131 COPTS.ssh-ecdsa.c+= -Wno-error=deprecated-declarations 132 COPTS.ssh-pkcs11.c+= -Wno-error=deprecated-declarations 133 COPTS.ssh-rsa.c+= -Wno-error=deprecated-declarations 134 COPTS.sshbuf-getput-crypto.c+= -Wno-error=deprecated-declarations 135 COPTS.sshkey.c+= -Wno-error=deprecated-declarations 136 COPTS.umac.c+= -Wno-error=deprecated-declarations 137 COPTS.umac128.c+= -Wno-error=deprecated-declarations 138 COPTS.kexmlkem768x25519.c+=${${ACTIVE_CC} == "clang":? -Wno-error=missing-noreturn:} 139 140 141 142 .include <bsd.lib.mk> 143