1# $OpenBSD: Makefile,v 1.111 2024/05/17 00:30:24 djm Exp $ 2 3.PATH: ${.CURDIR}/.. 4 5SRCS= sshd.c servconf.c sshpty.c srclimit.c groupaccess.c auth2-methods.c 6SRCS+= dns.c fatal.c compat.c utf8.c authfd.c canohost.c kex-names.c 7SRCS+= ${SRCS_BASE} ${SRCS_KEY} ${SRCS_KEYP} ${SRCS_KRL} \ 8 ${SRCS_MAC} ${SRCS_UTL} ${SRCS_SK_CLIENT} 9 10PROG= sshd 11BINMODE=511 12BINDIR= /usr/sbin 13MAN= sshd.8 sshd_config.5 14 15.include <bsd.own.mk> # for KERBEROS and AFS 16 17KERBEROS5=no 18 19.if (${KERBEROS5:L} == "yes") 20CFLAGS+=-DKRB5 -I${DESTDIR}/usr/include/kerberosV -DGSSAPI 21SRCS+= auth-krb5.c auth2-gss.c gss-serv.c gss-serv-krb5.c 22.endif 23 24.include <bsd.prog.mk> 25 26.if (${KERBEROS5:L} == "yes") 27LDADD+= -lgssapi -lkrb5 -lasn1 28LDADD+= -lwind -lroken -lcom_err -lpthread -lheimbase -lkafs 29DPADD+= ${LIBGSSAPI} ${LIBKRB5} 30.endif 31 32.if (${OPENSSL:L} == "yes") 33LDADD+= -lcrypto 34DPADD+= ${LIBCRYPTO} 35.endif 36 37LDADD+= -lutil 38DPADD+= ${LIBUTIL} 39 40.if (${ZLIB:L} == "yes") 41LDADD+= -lz 42DPADD+= ${LIBZ} 43.endif 44 45# The random relink kit, used on OpenBSD by /etc/rc 46 47CLEANFILES+= ${PROG}.tar install.sh 48 49install.sh: Makefile 50 echo "set -o errexit" > $@ 51 echo "${CC} ${LDFLAGS} ${LDSTATIC} -o ${PROG}" \ 52 "\`echo " ${OBJS} "| tr ' ' '\\\n' | sort -R\`" ${LDADD} >> $@ 53 echo "./${PROG} -V # test it works" >> $@ 54 echo "install -c -s -o root -g bin -m ${BINMODE} ${PROG} " \ 55 "${BINDIR}/${PROG}" >> $@ 56 57${PROG}.tar: ${OBJS} install.sh 58 tar cf $@ ${OBJS} install.sh 59 60afterinstall: ${PROG}.tar 61 install -d -o root -g wheel -m 755 \ 62 ${DESTDIR}/usr/share/relink/${BINDIR}/${PROG} 63 install -o ${BINOWN} -g ${BINGRP} -m 640 \ 64 ${PROG}.tar ${DESTDIR}/usr/share/relink/${BINDIR}/${PROG}/${PROG}.tar 65