Home | History | Annotate | Line # | Download | only in lib
      1  1.49  riastrad #	$NetBSD: Makefile,v 1.49 2026/04/29 13:41:38 riastradh Exp $
      2  1.45  riastrad 
      3  1.45  riastrad # libssh is not meant for applications to link against -- it's a
      4  1.45  riastrad # private library of the ssh/sshd/&c. executables we ship.  So don't
      5  1.49  riastrad # expose the .so symlink or .a static library for applications to link
      6  1.49  riastrad # against.
      7  1.49  riastrad #
      8  1.49  riastrad # (We do, however, build compat libssh intentionally for other ABIs --
      9  1.49  riastrad # not because other-ABI applications might be linked against it, but
     10  1.49  riastrad # because other-ABI applications might _load_ other-ABI pam_ssh.so
     11  1.49  riastrad # which is legitimately linked against the private libssh.)
     12  1.45  riastrad #
     13  1.45  riastrad # Note that while NOLINKLIB suppresses _installing_ the .so symlink,
     14  1.45  riastrad # the .so symlink is still created in the objdir so bin/ssh can still
     15  1.45  riastrad # use it to link.
     16  1.45  riastrad NOLINKLIB=		# defined
     17   1.1  christos 
     18   1.1  christos .include <bsd.own.mk>
     19   1.1  christos 
     20  1.14  christos .include "../Makefile.inc"
     21  1.14  christos 
     22  1.30     joerg CWARNFLAGS.clang+=	-Wno-error=sizeof-array-div
     23  1.32    mgorny CWARNFLAGS.clang+=	-Wno-error=format-nonliteral
     24   1.1  christos LIB=	ssh
     25  1.10  christos SRCS=\
     26  1.34  christos addr.c \
     27  1.10  christos addrmatch.c \
     28  1.10  christos atomicio.c \
     29  1.10  christos authfd.c \
     30  1.10  christos authfile.c \
     31  1.14  christos bcrypt_pbkdf.c \
     32  1.17  christos bitmap.c \
     33  1.14  christos blowfish.c \
     34  1.10  christos canohost.c \
     35  1.27  christos chacha.c \
     36  1.10  christos channels.c \
     37  1.14  christos cipher-chachapoly.c \
     38  1.10  christos cipher.c \
     39  1.10  christos cleanup.c \
     40  1.10  christos compat.c \
     41  1.10  christos dispatch.c \
     42  1.10  christos dns.c \
     43  1.14  christos ed25519.c \
     44  1.10  christos fatal.c \
     45  1.25  christos freezero.c \
     46  1.14  christos hmac.c \
     47  1.10  christos hostfile.c \
     48  1.10  christos kex.c \
     49  1.47       nia kexc25519.c \
     50  1.39  christos kex-names.c \
     51  1.27  christos kexgen.c \
     52  1.40  christos kexmlkem768x25519.c \
     53  1.34  christos kexsntrup761x25519.c \
     54  1.12  christos krl.c \
     55  1.10  christos log.c \
     56  1.10  christos mac.c \
     57  1.10  christos match.c \
     58  1.10  christos misc.c \
     59  1.10  christos monitor_fdpass.c \
     60  1.10  christos msg.c \
     61  1.10  christos nchan.c \
     62  1.10  christos packet.c \
     63  1.14  christos poly1305.c \
     64  1.10  christos progressmeter.c \
     65  1.10  christos readpass.c \
     66  1.23  christos recallocarray.c \
     67  1.14  christos smult_curve25519_ref.c \
     68  1.34  christos sntrup761.c \
     69  1.27  christos ssh-ed25519.c \
     70  1.31  christos ssh-ed25519-sk.c \
     71  1.27  christos ssh-pkcs11.c \
     72  1.33  christos ssh-sk-client.c \
     73  1.14  christos sshbuf-getput-basic.c \
     74  1.14  christos sshbuf-misc.c \
     75  1.31  christos sshbuf-io.c \
     76  1.14  christos sshbuf.c \
     77  1.14  christos ssherr.c \
     78  1.48  christos ssherr-libcrypto.c \
     79  1.14  christos sshkey.c \
     80  1.10  christos ttymodes.c \
     81  1.10  christos uidswap.c \
     82  1.15  christos umac.c \
     83  1.15  christos umac128.c \
     84  1.19  christos utf8.c \
     85  1.44  christos xmalloc.c 
     86  1.25  christos 
     87  1.14  christos OPENSSL_SRCS=\
     88  1.47       nia dh.c \
     89  1.14  christos digest-openssl.c \
     90  1.47       nia kexdh.c \
     91  1.47       nia kexecdh.c \
     92  1.47       nia kexgex.c \
     93  1.47       nia kexgexc.c \
     94  1.47       nia sshbuf-getput-crypto.c \
     95  1.14  christos ssh-ecdsa.c \
     96  1.31  christos ssh-ecdsa-sk.c \
     97  1.14  christos ssh-rsa.c
     98  1.14  christos 
     99  1.16  christos SRCS+=	fmt_scaled.c
    100   1.1  christos SRCS+=	readpassphrase.c getpeereid.c getrrsetbyname.c
    101  1.25  christos COPTS.monitor_fdpass.c+=-Wno-stack-protector
    102  1.34  christos COPTS.sntrup761.c+=	-Wno-stack-protector
    103   1.1  christos 
    104  1.47       nia .ifdef WITH_OPENSSL
    105  1.14  christos SRCS+=		${OPENSSL_SRCS}
    106  1.47       nia LIBDPLIBS+=	crypto	${NETBSDSRCDIR}/crypto/external/${EXTERNAL_OPENSSL_SUBDIR}/lib/libcrypto
    107  1.14  christos .else
    108  1.47       nia SRCS+=		cipher-aesctr.c digest-libc.c rijndael.c
    109  1.14  christos .endif
    110  1.14  christos 
    111  1.14  christos CPPFLAGS+= -DHAVE_BLF_H
    112  1.14  christos 
    113   1.1  christos CPPFLAGS+=	-I${SSHDIST}
    114   1.1  christos .PATH:		${SSHDIST}
    115   1.1  christos 
    116  1.47       nia LIBDPLIBS+=	crypt	${NETBSDSRCDIR}/lib/libcrypt \
    117   1.1  christos 		z	${NETBSDSRCDIR}/lib/libz
    118   1.1  christos 
    119   1.7      adam .for f in dns channels hostfile ssh-pkcs11
    120   1.1  christos COPTS.${f}.c+=	-Wno-pointer-sign
    121   1.1  christos .endfor
    122   1.9       mrg 
    123   1.9       mrg # XXX
    124   1.9       mrg COPTS.channels.c+=	-fno-strict-aliasing
    125  1.11     joerg 
    126  1.36     lukem COPTS.hostfile.c+=	${CC_WNO_FORMAT_TRUNCATION}
    127  1.36     lukem COPTS.sshkey.c+=	${CC_WNO_FORMAT_TRUNCATION}
    128  1.35  christos COPTS.cipher.c+=	-Wno-error=deprecated-declarations
    129  1.35  christos COPTS.dh.c+=		-Wno-error=deprecated-declarations
    130  1.47       nia COPTS.digest-libc.c+=	-Wno-error=cast-function-type
    131  1.35  christos COPTS.kex.c+=		-Wno-error=deprecated-declarations
    132  1.35  christos COPTS.kexdh.c+=		-Wno-error=deprecated-declarations
    133  1.35  christos COPTS.kexecdh.c+=	-Wno-error=deprecated-declarations
    134  1.35  christos COPTS.kexgexc.c+=	-Wno-error=deprecated-declarations
    135  1.35  christos COPTS.ssh-ecdsa-sk.c+=	-Wno-error=deprecated-declarations
    136  1.35  christos COPTS.ssh-ecdsa.c+=	-Wno-error=deprecated-declarations
    137  1.35  christos COPTS.ssh-pkcs11.c+=	-Wno-error=deprecated-declarations
    138  1.35  christos COPTS.ssh-rsa.c+=	-Wno-error=deprecated-declarations
    139  1.35  christos COPTS.sshbuf-getput-crypto.c+=	-Wno-error=deprecated-declarations
    140  1.35  christos COPTS.sshkey.c+=	-Wno-error=deprecated-declarations
    141  1.35  christos COPTS.umac.c+=		-Wno-error=deprecated-declarations
    142  1.35  christos COPTS.umac128.c+=	-Wno-error=deprecated-declarations
    143  1.48  christos COPTS.ssherr-libcrypto.c+=	-Wno-error=deprecated-declarations
    144  1.41  christos COPTS.kexmlkem768x25519.c+=${${ACTIVE_CC} == "clang":? -Wno-error=missing-noreturn:}
    145  1.41  christos 
    146  1.41  christos 
    147  1.29       mrg 
    148  1.11     joerg .include <bsd.lib.mk>
    149