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