Home | History | Annotate | Line # | Download | only in lib
Makefile revision 1.45
      1 #	$NetBSD: Makefile,v 1.45 2025/12/16 04:32:03 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 NOCOMPAT=		# defined
     13 NOLINKLIB=		# defined
     14 
     15 .include <bsd.own.mk>
     16 
     17 .include "../Makefile.inc"
     18 
     19 CWARNFLAGS.clang+=	-Wno-error=sizeof-array-div
     20 CWARNFLAGS.clang+=	-Wno-error=format-nonliteral
     21 LIB=	ssh
     22 SRCS=\
     23 addr.c \
     24 addrmatch.c \
     25 atomicio.c \
     26 authfd.c \
     27 authfile.c \
     28 bcrypt_pbkdf.c \
     29 bitmap.c \
     30 blowfish.c \
     31 canohost.c \
     32 chacha.c \
     33 channels.c \
     34 cipher-chachapoly.c \
     35 cipher.c \
     36 cleanup.c \
     37 compat.c \
     38 dh.c \
     39 dispatch.c \
     40 dns.c \
     41 ed25519.c \
     42 fatal.c \
     43 freezero.c \
     44 hash.c \
     45 hmac.c \
     46 hostfile.c \
     47 kex.c \
     48 kex-names.c \
     49 kexdh.c \
     50 kexecdh.c \
     51 kexgen.c \
     52 kexgex.c \
     53 kexgexc.c \
     54 kexmlkem768x25519.c \
     55 kexsntrup761x25519.c \
     56 krl.c \
     57 log.c \
     58 mac.c \
     59 match.c \
     60 misc.c \
     61 monitor_fdpass.c \
     62 msg.c \
     63 nchan.c \
     64 packet.c \
     65 poly1305.c \
     66 progressmeter.c \
     67 readpass.c \
     68 recallocarray.c \
     69 smult_curve25519_ref.c \
     70 sntrup761.c \
     71 ssh-ed25519.c \
     72 ssh-ed25519-sk.c \
     73 ssh-pkcs11.c \
     74 ssh-sk-client.c \
     75 sshbuf-getput-basic.c \
     76 sshbuf-getput-crypto.c \
     77 sshbuf-misc.c \
     78 sshbuf-io.c \
     79 sshbuf.c \
     80 ssherr.c \
     81 sshkey.c \
     82 ttymodes.c \
     83 uidswap.c \
     84 umac.c \
     85 umac128.c \
     86 utf8.c \
     87 xmalloc.c 
     88 
     89 OPENSSL_SRCS=\
     90 digest-openssl.c \
     91 kexc25519.c \
     92 ssh-ecdsa.c \
     93 ssh-ecdsa-sk.c \
     94 ssh-rsa.c
     95 
     96 SRCS+=	fmt_scaled.c
     97 SRCS+=	readpassphrase.c getpeereid.c getrrsetbyname.c
     98 COPTS.monitor_fdpass.c+=-Wno-stack-protector
     99 COPTS.sntrup761.c+=	-Wno-stack-protector
    100 
    101 .if WITH_OPENSSL
    102 SRCS+=		${OPENSSL_SRCS}
    103 .else
    104 SRCS+=		digest-libc.c
    105 .endif
    106 
    107 CPPFLAGS+= -DHAVE_BLF_H
    108 
    109 CPPFLAGS+=	-I${SSHDIST}
    110 .PATH:		${SSHDIST}
    111 
    112 LIBDPLIBS+=	crypto	${NETBSDSRCDIR}/crypto/external/${EXTERNAL_OPENSSL_SUBDIR}/lib/libcrypto \
    113 		crypt	${NETBSDSRCDIR}/lib/libcrypt \
    114 		z	${NETBSDSRCDIR}/lib/libz
    115 
    116 .for f in dns channels hostfile ssh-pkcs11
    117 COPTS.${f}.c+=	-Wno-pointer-sign
    118 .endfor
    119 
    120 # XXX
    121 COPTS.channels.c+=	-fno-strict-aliasing
    122 
    123 COPTS.hostfile.c+=	${CC_WNO_FORMAT_TRUNCATION}
    124 COPTS.sshkey.c+=	${CC_WNO_FORMAT_TRUNCATION}
    125 COPTS.cipher.c+=	-Wno-error=deprecated-declarations
    126 COPTS.dh.c+=		-Wno-error=deprecated-declarations
    127 COPTS.kex.c+=		-Wno-error=deprecated-declarations
    128 COPTS.kexdh.c+=		-Wno-error=deprecated-declarations
    129 COPTS.kexecdh.c+=	-Wno-error=deprecated-declarations
    130 COPTS.kexgexc.c+=	-Wno-error=deprecated-declarations
    131 COPTS.ssh-ecdsa-sk.c+=	-Wno-error=deprecated-declarations
    132 COPTS.ssh-ecdsa.c+=	-Wno-error=deprecated-declarations
    133 COPTS.ssh-pkcs11.c+=	-Wno-error=deprecated-declarations
    134 COPTS.ssh-rsa.c+=	-Wno-error=deprecated-declarations
    135 COPTS.sshbuf-getput-crypto.c+=	-Wno-error=deprecated-declarations
    136 COPTS.sshkey.c+=	-Wno-error=deprecated-declarations
    137 COPTS.umac.c+=		-Wno-error=deprecated-declarations
    138 COPTS.umac128.c+=	-Wno-error=deprecated-declarations
    139 COPTS.kexmlkem768x25519.c+=${${ACTIVE_CC} == "clang":? -Wno-error=missing-noreturn:}
    140 
    141 
    142 
    143 .include <bsd.lib.mk>
    144