blob: e7549470c520f11226e25648a27ddab3e82abc95 [file] [log] [blame]
Damien Miller10479cc2018-04-10 10:19:02 +10001# uncomment if you run a non bourne compatible shell. Ie. csh
Tim Ricea7a5d6d2002-05-09 07:05:59 -07002#SHELL = @SH@
Damien Millerb797b922001-02-04 23:27:00 +11003
Damien Millerf58c6722002-05-13 13:15:42 +10004AUTORECONF=autoreconf
5
Damien Miller7f6ea021999-10-28 13:25:17 +10006prefix=@prefix@
7exec_prefix=@exec_prefix@
8bindir=@bindir@
9sbindir=@sbindir@
Damien Millere2324551999-11-19 17:18:57 +110010libexecdir=@libexecdir@
Damien Millerd97c2ce2001-09-18 15:06:21 +100011datadir=@datadir@
Tim Ricebcf8be32006-10-23 14:44:47 -070012datarootdir=@datarootdir@
Damien Miller94388161999-10-29 09:57:31 +100013mandir=@mandir@
Ben Lindstrombc709922001-04-18 18:04:21 +000014mansubdir=@mansubdir@
Damien Miller296a5461999-11-13 10:48:51 +110015sysconfdir=@sysconfdir@
Damien Millerb13c73e2000-01-17 22:02:17 +110016piddir=@piddir@
17srcdir=@srcdir@
18top_srcdir=@top_srcdir@
Damien Miller7f6ea021999-10-28 13:25:17 +100019
Damien Miller7d7c60d2000-01-26 14:37:48 +110020DESTDIR=
Damien Millerc0d73901999-12-27 09:23:58 +110021VPATH=@srcdir@
Damien Millerc7b38ce1999-11-09 10:28:04 +110022SSH_PROGRAM=@bindir@/ssh
Damien Miller606f8802000-09-16 15:39:56 +110023ASKPASS_PROGRAM=$(libexecdir)/ssh-askpass
Damien Millerd7686fd2001-02-10 00:40:03 +110024SFTP_SERVER=$(libexecdir)/sftp-server
Ben Lindstromdb41d232002-06-07 03:11:38 +000025SSH_KEYSIGN=$(libexecdir)/ssh-keysign
Damien Miller7ea845e2010-02-12 09:21:02 +110026SSH_PKCS11_HELPER=$(libexecdir)/ssh-pkcs11-helper
djm@openbsd.org07da39f2019-10-31 21:22:01 +000027SSH_SK_HELPER=$(libexecdir)/ssh-sk-helper
Damien Millerf58c6722002-05-13 13:15:42 +100028PRIVSEP_PATH=@PRIVSEP_PATH@
Damien Millerd3f6ad22002-06-25 10:24:47 +100029SSH_PRIVSEP_USER=@SSH_PRIVSEP_USER@
Damien Miller7d901272003-01-13 16:55:22 +110030STRIP_OPT=@STRIP_OPT@
Damien Miller41c8de22014-08-30 16:23:06 +100031TEST_SHELL=@TEST_SHELL@
Damien Millerd7686fd2001-02-10 00:40:03 +110032
Damien Miller05eda432002-02-10 18:32:28 +110033PATHS= -DSSHDIR=\"$(sysconfdir)\" \
Damien Millerd7686fd2001-02-10 00:40:03 +110034 -D_PATH_SSH_PROGRAM=\"$(SSH_PROGRAM)\" \
35 -D_PATH_SSH_ASKPASS_DEFAULT=\"$(ASKPASS_PROGRAM)\" \
Ben Lindstrombc709922001-04-18 18:04:21 +000036 -D_PATH_SFTP_SERVER=\"$(SFTP_SERVER)\" \
Ben Lindstromdb41d232002-06-07 03:11:38 +000037 -D_PATH_SSH_KEY_SIGN=\"$(SSH_KEYSIGN)\" \
Damien Miller7ea845e2010-02-12 09:21:02 +110038 -D_PATH_SSH_PKCS11_HELPER=\"$(SSH_PKCS11_HELPER)\" \
djm@openbsd.org07da39f2019-10-31 21:22:01 +000039 -D_PATH_SSH_SK_HELPER=\"$(SSH_SK_HELPER)\" \
Damien Miller62116dc2001-12-24 01:41:47 +110040 -D_PATH_SSH_PIDDIR=\"$(piddir)\" \
Darren Tucker29c71512013-03-05 21:50:09 +110041 -D_PATH_PRIVSEP_CHROOT_DIR=\"$(PRIVSEP_PATH)\"
Damien Millerc7b38ce1999-11-09 10:28:04 +110042
Damien Miller7f6ea021999-10-28 13:25:17 +100043CC=@CC@
Damien Miller166bd442000-03-16 10:48:25 +110044LD=@LD@
Ben Lindstrom28bfc0d2000-12-18 19:58:57 +000045CFLAGS=@CFLAGS@
Damien Millerb2180552019-11-29 12:32:23 +110046CFLAGS_NOPIE=@CFLAGS_NOPIE@
Damien Miller3c027682001-03-14 11:39:45 +110047CPPFLAGS=-I. -I$(srcdir) @CPPFLAGS@ $(PATHS) @DEFS@
Damien Millerb2180552019-11-29 12:32:23 +110048PICFLAG=@PICFLAG@
Damien Millerd3dcfaf1999-11-09 13:52:33 +110049LIBS=@LIBS@
Darren Tucker964de182013-02-22 10:39:59 +110050K5LIBS=@K5LIBS@
51GSSLIBS=@GSSLIBS@
Damien Miller71adf122011-01-25 12:16:15 +110052SSHLIBS=@SSHLIBS@
Damien Miller1b06dc32006-08-31 03:24:41 +100053SSHDLIBS=@SSHDLIBS@
Darren Tucker16bcc1c2004-11-07 20:14:34 +110054LIBEDIT=@LIBEDIT@
djm@openbsd.org6bff9522019-11-14 21:27:29 +000055LIBFIDO2=@LIBFIDO2@
Damien Miller7f6ea021999-10-28 13:25:17 +100056AR=@AR@
Darren Tucker167bd9c2003-09-07 12:34:54 +100057AWK=@AWK@
Damien Miller7f6ea021999-10-28 13:25:17 +100058RANLIB=@RANLIB@
Damien Millerd8087f61999-11-25 12:31:26 +110059INSTALL=@INSTALL@
Tim Riced0d7a8b2003-01-08 17:22:59 -080060SED=@SED@
Damien Miller8d1fd572000-05-17 21:34:07 +100061ENT=@ENT@
Damien Millera19cf472000-11-29 13:28:50 +110062XAUTH_PATH=@XAUTH_PATH@
Ben Lindstrom3c06f6a2001-01-31 21:52:01 +000063LDFLAGS=-L. -Lopenbsd-compat/ @LDFLAGS@
Damien Miller44384812019-11-29 15:10:21 +110064LDFLAGS_NOPIE=-L. -Lopenbsd-compat/ @LDFLAGS_NOPIE@
Damien Millerbac2d8a2000-09-05 16:13:06 +110065EXEEXT=@EXEEXT@
Damien Miller30a69e72011-01-04 08:16:27 +110066MANFMT=@MANFMT@
Darren Tucker6c8a2462017-12-01 17:11:47 +110067MKDIR_P=@MKDIR_P@
Damien Miller7f6ea021999-10-28 13:25:17 +100068
Damien Miller8ef5bf92019-11-28 13:12:30 +110069.SUFFIXES: .lo
70
djm@openbsd.org07da39f2019-10-31 21:22:01 +000071TARGETS=ssh$(EXEEXT) sshd$(EXEEXT) ssh-add$(EXEEXT) ssh-keygen$(EXEEXT) ssh-keyscan${EXEEXT} ssh-keysign${EXEEXT} ssh-pkcs11-helper$(EXEEXT) ssh-agent$(EXEEXT) scp$(EXEEXT) sftp-server$(EXEEXT) sftp$(EXEEXT) ssh-sk-helper$(EXEEXT)
Damien Miller7f6ea021999-10-28 13:25:17 +100072
markus@openbsd.org1b11ea72018-02-23 15:58:37 +000073XMSS_OBJS=\
Damien Miller612faa32018-02-26 12:17:55 +110074 ssh-xmss.o \
75 sshkey-xmss.o \
76 xmss_commons.o \
77 xmss_fast.o \
78 xmss_hash.o \
79 xmss_hash_address.o \
80 xmss_wots.o
markus@openbsd.org1b11ea72018-02-23 15:58:37 +000081
Damien Millere5b9f0f2014-05-15 14:58:07 +100082LIBOPENSSH_OBJS=\
markus@openbsd.orgf582f0e2015-01-19 20:30:23 +000083 ssh_api.o \
Damien Millere5b9f0f2014-05-15 14:58:07 +100084 ssherr.o \
85 sshbuf.o \
Damien Millerdd8b1dd2014-07-02 17:38:31 +100086 sshkey.o \
Damien Millere5b9f0f2014-05-15 14:58:07 +100087 sshbuf-getput-basic.o \
88 sshbuf-misc.o \
djm@openbsd.orga165bab2015-01-14 15:02:39 +000089 sshbuf-getput-crypto.o \
90 krl.o \
markus@openbsd.org1b11ea72018-02-23 15:58:37 +000091 bitmap.o \
92 ${XMSS_OBJS}
Damien Millere5b9f0f2014-05-15 14:58:07 +100093
94LIBSSH_OBJS=${LIBOPENSSH_OBJS} \
markus@openbsd.orgcb30cd42018-07-09 21:56:06 +000095 authfd.o authfile.o \
Damien Miller72ef7c12015-01-15 02:21:31 +110096 canohost.o channels.o cipher.o cipher-aes.o cipher-aesctr.o \
djm@openbsd.orgcdccebd2017-04-30 23:15:04 +000097 cipher-ctr.o cleanup.o \
dtucker@openbsd.org56965122019-04-18 07:32:56 +000098 compat.o fatal.o hostfile.o \
djm@openbsd.org245c6a02019-01-19 21:45:31 +000099 log.o match.o moduli.o nchan.o packet.o \
djm@openbsd.org83fa3a02017-07-01 13:50:45 +0000100 readpass.o ttymodes.o xmalloc.o addrmatch.o \
djm@openbsd.org16dd8b22019-07-16 13:18:39 +0000101 atomicio.o dispatch.o mac.o misc.o utf8.o \
djm@openbsd.org02bb0762019-10-31 21:15:14 +0000102 monitor_fdpass.o rijndael.o ssh-dss.o ssh-ecdsa.o ssh-ecdsa-sk.o \
markus@openbsd.org7c096c42019-11-12 19:29:24 +0000103 ssh-ed25519-sk.o ssh-rsa.o dh.o \
Darren Tucker992faad2012-10-05 11:38:24 +1000104 msg.o progressmeter.o dns.o entropy.o gss-genr.o umac.o umac128.o \
djm@openbsd.orga165bab2015-01-14 15:02:39 +0000105 ssh-pkcs11.o smult_curve25519_ref.o \
markus@openbsd.orgf582f0e2015-01-19 20:30:23 +0000106 poly1305.o chacha.o cipher-chachapoly.o \
Damien Miller7b47b402019-12-14 08:20:52 +1100107 ssh-ed25519.o digest-openssl.o digest-libc.o \
djm@openbsd.org6bff9522019-11-14 21:27:29 +0000108 hmac.o sc25519.o ge25519.o fe25519.o ed25519.o verify.o hash.o \
markus@openbsd.orgf582f0e2015-01-19 20:30:23 +0000109 kex.o kexdh.o kexgex.o kexecdh.o kexc25519.o \
djm@openbsd.org92dda342019-01-21 10:29:56 +0000110 kexgexc.o kexgexs.o \
djm@openbsd.orgaaca72d2019-01-21 10:40:11 +0000111 sntrup4591761.o kexsntrup4591761x25519.o kexgen.o \
djm@openbsd.org99aa8032020-01-25 23:02:13 +0000112 sftp-realpath.o platform-pledge.o platform-tracing.o platform-misc.o \
113 sshbuf-io.o
Damien Miller18ccf851999-12-16 13:06:18 +1100114
Damien Miller7b47b402019-12-14 08:20:52 +1100115SKOBJS= ssh-sk-client.o
djm@openbsd.orgdfd59162019-01-21 10:20:12 +0000116
Damien Millerd1940482003-02-24 12:18:46 +1100117SSHOBJS= ssh.o readconf.o clientloop.o sshtty.o \
Damien Miller7b47b402019-12-14 08:20:52 +1100118 sshconnect.o sshconnect2.o mux.o $(SKOBJS)
Damien Millere72b7af1999-12-30 15:08:44 +1100119
markus@openbsd.org6cb6dcf2016-08-13 17:47:40 +0000120SSHDOBJS=sshd.o auth-rhosts.o auth-passwd.o \
Damien Miller878e0292017-08-25 13:25:01 +1000121 audit.o audit-bsm.o audit-linux.o platform.o \
Darren Tucker25f60a72004-08-15 17:23:34 +1000122 sshpty.o sshlogin.o servconf.o serverloop.o \
markus@openbsd.org6cb6dcf2016-08-13 17:47:40 +0000123 auth.o auth2.o auth-options.o session.o \
124 auth2-chall.o groupaccess.o \
Damien Miller87f08be2018-07-20 13:18:28 +1000125 auth-bsdauth.o auth2-hostbased.o auth2-kbdint.o \
Damien Miller7cc194f2014-02-04 11:12:56 +1100126 auth2-none.o auth2-passwd.o auth2-pubkey.o \
djm@openbsd.org0082fba2016-09-28 16:33:06 +0000127 monitor.o monitor_wrap.o auth-krb5.o \
Darren Tucker49aaf4a2003-08-26 11:58:16 +1000128 auth2-gss.o gss-serv.o gss-serv-krb5.o \
Darren Tuckerd9f88912005-02-20 21:01:48 +1100129 loginrec.o auth-pam.o auth-shadow.o auth-sia.o md5crypt.o \
Darren Tuckerb236b272019-11-03 00:10:43 +1100130 sftp-server.o sftp-common.o \
Damien Millere0956e32012-04-04 11:27:54 +1000131 sandbox-null.o sandbox-rlimit.o sandbox-systrace.o sandbox-darwin.o \
Damien Miller4626cba2016-01-08 14:24:56 +1100132 sandbox-seccomp-filter.o sandbox-capsicum.o sandbox-pledge.o \
Damien Miller7b47b402019-12-14 08:20:52 +1100133 sandbox-solaris.o uidswap.o $(SKOBJS)
134
135SCP_OBJS= scp.o progressmeter.o
136
137SSHADD_OBJS= ssh-add.o $(SKOBJS)
138
139SSHAGENT_OBJS= ssh-agent.o ssh-pkcs11-client.o $(SKOBJS)
140
141SSHKEYGEN_OBJS= ssh-keygen.o sshsig.o $(SKOBJS)
142
143SSHKEYSIGN_OBJS=ssh-keysign.o readconf.o uidswap.o $(SKOBJS)
144
145P11HELPER_OBJS= ssh-pkcs11-helper.o ssh-pkcs11.o $(SKOBJS)
146
147SKHELPER_OBJS= ssh-sk-helper.o ssh-sk.o sk-usbhid.o
148
149SSHKEYSCAN_OBJS=ssh-keyscan.o $(SKOBJS)
150
151SFTPSERVER_OBJS=sftp-common.o sftp-server.o sftp-server-main.o
152
153SFTP_OBJS= sftp.o sftp-client.o sftp-common.o sftp-glob.o progressmeter.o
Damien Millere72b7af1999-12-30 15:08:44 +1100154
naddy@openbsd.orgaa4c6402019-11-07 08:38:38 +0000155MANPAGES = moduli.5.out scp.1.out ssh-add.1.out ssh-agent.1.out ssh-keygen.1.out ssh-keyscan.1.out ssh.1.out sshd.8.out sftp-server.8.out sftp.1.out ssh-keysign.8.out ssh-pkcs11-helper.8.out ssh-sk-helper.8.out sshd_config.5.out ssh_config.5.out
156MANPAGES_IN = moduli.5 scp.1 ssh-add.1 ssh-agent.1 ssh-keygen.1 ssh-keyscan.1 ssh.1 sshd.8 sftp-server.8 sftp.1 ssh-keysign.8 ssh-pkcs11-helper.8 ssh-sk-helper.8 sshd_config.5 ssh_config.5
Damien Miller897741e2001-04-16 10:41:46 +1000157MANTYPE = @MANTYPE@
Damien Miller645c5982000-01-03 14:42:09 +1100158
Damien Millerb5b0af42001-06-27 21:52:32 +1000159CONFIGFILES=sshd_config.out ssh_config.out moduli.out
160CONFIGFILES_IN=sshd_config ssh_config moduli
Damien Miller645c5982000-01-03 14:42:09 +1100161
Damien Millera19cf472000-11-29 13:28:50 +1100162PATHSUBS = \
Tim Riced0d7a8b2003-01-08 17:22:59 -0800163 -e 's|/etc/ssh/ssh_config|$(sysconfdir)/ssh_config|g' \
164 -e 's|/etc/ssh/ssh_known_hosts|$(sysconfdir)/ssh_known_hosts|g' \
165 -e 's|/etc/ssh/sshd_config|$(sysconfdir)/sshd_config|g' \
166 -e 's|/usr/libexec|$(libexecdir)|g' \
167 -e 's|/etc/shosts.equiv|$(sysconfdir)/shosts.equiv|g' \
168 -e 's|/etc/ssh/ssh_host_key|$(sysconfdir)/ssh_host_key|g' \
Damien Millere63b7f22011-01-09 09:19:50 +1100169 -e 's|/etc/ssh/ssh_host_ecdsa_key|$(sysconfdir)/ssh_host_ecdsa_key|g' \
Tim Riced0d7a8b2003-01-08 17:22:59 -0800170 -e 's|/etc/ssh/ssh_host_dsa_key|$(sysconfdir)/ssh_host_dsa_key|g' \
171 -e 's|/etc/ssh/ssh_host_rsa_key|$(sysconfdir)/ssh_host_rsa_key|g' \
Damien Millerda3ca352013-12-07 21:43:46 +1100172 -e 's|/etc/ssh/ssh_host_ed25519_key|$(sysconfdir)/ssh_host_ed25519_key|g' \
Tim Riced0d7a8b2003-01-08 17:22:59 -0800173 -e 's|/var/run/sshd.pid|$(piddir)/sshd.pid|g' \
Damien Miller60dcc622008-06-26 15:59:32 +1000174 -e 's|/etc/moduli|$(sysconfdir)/moduli|g' \
Tim Riced0d7a8b2003-01-08 17:22:59 -0800175 -e 's|/etc/ssh/moduli|$(sysconfdir)/moduli|g' \
Darren Tucker12259d92006-08-22 22:24:10 +1000176 -e 's|/etc/ssh/sshrc|$(sysconfdir)/sshrc|g' \
Tim Riced0d7a8b2003-01-08 17:22:59 -0800177 -e 's|/usr/X11R6/bin/xauth|$(XAUTH_PATH)|g' \
178 -e 's|/var/empty|$(PRIVSEP_PATH)|g' \
179 -e 's|/usr/bin:/bin:/usr/sbin:/sbin|@user_path@|g'
Damien Miller886c63a2000-01-20 23:13:36 +1100180
Tim Riced0d7a8b2003-01-08 17:22:59 -0800181FIXPATHSCMD = $(SED) $(PATHSUBS)
Darren Tucker6d8bd572013-06-11 11:26:10 +1000182FIXALGORITHMSCMD= $(SHELL) $(srcdir)/fixalgorithms $(SED) \
183 @UNSUPPORTED_ALGORITHMS@
Damien Miller886c63a2000-01-20 23:13:36 +1100184
Damien Miller182297c2019-09-05 20:34:54 +1000185all: configure-check $(CONFIGFILES) $(MANPAGES) $(TARGETS)
Damien Miller18ccf851999-12-16 13:06:18 +1100186
Damien Millereff041d2003-05-15 21:33:46 +1000187$(LIBSSH_OBJS): Makefile.in config.h
188$(SSHOBJS): Makefile.in config.h
189$(SSHDOBJS): Makefile.in config.h
Darren Tuckerfd7a2de2019-09-06 14:07:10 +1000190configure-check: $(srcdir)/configure
Damien Miller182297c2019-09-05 20:34:54 +1000191
Darren Tuckerfd7a2de2019-09-06 14:07:10 +1000192$(srcdir)/configure: configure.ac aclocal.m4
Damien Millerafdf27f2019-09-05 21:38:40 +1000193 @echo "ERROR: configure is out of date; please run ${AUTORECONF} (and configure)" 1>&2
Damien Miller182297c2019-09-05 20:34:54 +1000194 @exit 1
Damien Miller16e519c2000-05-09 14:28:55 +1000195
Ben Lindstromf5410352000-12-29 21:37:22 +0000196.c.o:
Damien Millere7429f22014-05-15 18:01:01 +1000197 $(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
Ben Lindstromf5410352000-12-29 21:37:22 +0000198
Ben Lindstrome03c85d2001-02-01 14:06:11 +0000199LIBCOMPAT=openbsd-compat/libopenbsd-compat.a
Tim Rice13aae5e2001-10-21 17:53:58 -0700200$(LIBCOMPAT): always
Damien Millerf41d6182001-11-12 10:34:22 +1100201 (cd openbsd-compat && $(MAKE))
Tim Rice13aae5e2001-10-21 17:53:58 -0700202always:
Damien Miller7f6ea021999-10-28 13:25:17 +1000203
Damien Miller16e519c2000-05-09 14:28:55 +1000204libssh.a: $(LIBSSH_OBJS)
205 $(AR) rv $@ $(LIBSSH_OBJS)
206 $(RANLIB) $@
Damien Miller7f6ea021999-10-28 13:25:17 +1000207
Ben Lindstrome03c85d2001-02-01 14:06:11 +0000208ssh$(EXEEXT): $(LIBCOMPAT) libssh.a $(SSHOBJS)
Darren Tucker964de182013-02-22 10:39:59 +1100209 $(LD) -o $@ $(SSHOBJS) $(LDFLAGS) -lssh -lopenbsd-compat $(SSHLIBS) $(LIBS) $(GSSLIBS)
Damien Miller7f6ea021999-10-28 13:25:17 +1000210
Ben Lindstrome03c85d2001-02-01 14:06:11 +0000211sshd$(EXEEXT): libssh.a $(LIBCOMPAT) $(SSHDOBJS)
Darren Tucker964de182013-02-22 10:39:59 +1100212 $(LD) -o $@ $(SSHDOBJS) $(LDFLAGS) -lssh -lopenbsd-compat $(SSHDLIBS) $(LIBS) $(GSSLIBS) $(K5LIBS)
Damien Miller7f6ea021999-10-28 13:25:17 +1000213
Damien Miller7b47b402019-12-14 08:20:52 +1100214scp$(EXEEXT): $(LIBCOMPAT) libssh.a $(SCP_OBJS)
215 $(LD) -o $@ $(SCP_OBJS) $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS)
Damien Miller7f6ea021999-10-28 13:25:17 +1000216
Damien Miller7b47b402019-12-14 08:20:52 +1100217ssh-add$(EXEEXT): $(LIBCOMPAT) libssh.a $(SSHADD_OBJS)
218 $(LD) -o $@ $(SSHADD_OBJS) $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS)
Damien Miller7f6ea021999-10-28 13:25:17 +1000219
Damien Miller7b47b402019-12-14 08:20:52 +1100220ssh-agent$(EXEEXT): $(LIBCOMPAT) libssh.a $(SSHAGENT_OBJS)
221 $(LD) -o $@ $(SSHAGENT_OBJS) $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS)
Damien Miller16e519c2000-05-09 14:28:55 +1000222
Damien Miller7b47b402019-12-14 08:20:52 +1100223ssh-keygen$(EXEEXT): $(LIBCOMPAT) libssh.a $(SSHKEYGEN_OBJS)
224 $(LD) -o $@ $(SSHKEYGEN_OBJS) $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS)
Damien Miller7f6ea021999-10-28 13:25:17 +1000225
Damien Miller7b47b402019-12-14 08:20:52 +1100226ssh-keysign$(EXEEXT): $(LIBCOMPAT) libssh.a $(SSHKEYSIGN_OBJS)
227 $(LD) -o $@ $(SSHKEYSIGN_OBJS) $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS)
Ben Lindstrom1bad2562002-06-06 19:57:33 +0000228
Damien Miller7b47b402019-12-14 08:20:52 +1100229ssh-pkcs11-helper$(EXEEXT): $(LIBCOMPAT) libssh.a $(P11HELPER_OBJS)
230 $(LD) -o $@ $(P11HELPER_OBJS) $(LDFLAGS) -lssh -lopenbsd-compat -lssh -lopenbsd-compat $(LIBS)
Damien Miller7ea845e2010-02-12 09:21:02 +1100231
Damien Miller7b47b402019-12-14 08:20:52 +1100232ssh-sk-helper$(EXEEXT): $(LIBCOMPAT) libssh.a $(SKHELPER_OBJS)
Damien Miller633778d2019-12-14 08:40:33 +1100233 $(LD) -o $@ $(SKHELPER_OBJS) $(LDFLAGS) -lssh -lopenbsd-compat -lssh -lopenbsd-compat $(LIBS) $(LIBFIDO2)
djm@openbsd.org07da39f2019-10-31 21:22:01 +0000234
Damien Miller7b47b402019-12-14 08:20:52 +1100235ssh-keyscan$(EXEEXT): $(LIBCOMPAT) libssh.a $(SSHKEYSCAN_OBJS)
236 $(LD) -o $@ $(SSHKEYSCAN_OBJS) $(LDFLAGS) -lssh -lopenbsd-compat -lssh $(LIBS)
Ben Lindstromb6434ae2000-12-05 01:15:09 +0000237
Damien Miller7b47b402019-12-14 08:20:52 +1100238sftp-server$(EXEEXT): $(LIBCOMPAT) libssh.a $(SFTPSERVER_OBJS)
239 $(LD) -o $@ $(SFTPSERVER_OBJS) $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS)
Damien Miller33804262001-02-04 23:20:18 +1100240
Damien Miller7b47b402019-12-14 08:20:52 +1100241sftp$(EXEEXT): $(LIBCOMPAT) libssh.a $(SFTP_OBJS)
242 $(LD) -o $@ $(SFTP_OBJS) $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS) $(LIBEDIT)
Damien Miller7b28dc52000-09-05 13:34:53 +1100243
andre2ff7b5d2000-06-03 14:57:40 +0000244# test driver for the loginrec code - not built by default
Kevin Stevesbe48f2b2001-04-06 01:58:37 +0000245logintest: logintest.o $(LIBCOMPAT) libssh.a loginrec.o
246 $(LD) -o $@ logintest.o $(LDFLAGS) loginrec.o -lopenbsd-compat -lssh $(LIBS)
andre2ff7b5d2000-06-03 14:57:40 +0000247
Ben Lindstrom38862182001-04-27 00:31:07 +0000248$(MANPAGES): $(MANPAGES_IN)
Damien Miller897741e2001-04-16 10:41:46 +1000249 if test "$(MANTYPE)" = "cat"; then \
Ben Lindstrom38862182001-04-27 00:31:07 +0000250 manpage=$(srcdir)/`echo $@ | sed 's/\.[1-9]\.out$$/\.0/'`; \
Damien Miller897741e2001-04-16 10:41:46 +1000251 else \
Ben Lindstrom38862182001-04-27 00:31:07 +0000252 manpage=$(srcdir)/`echo $@ | sed 's/\.out$$//'`; \
Damien Miller897741e2001-04-16 10:41:46 +1000253 fi; \
254 if test "$(MANTYPE)" = "man"; then \
Darren Tucker6d8bd572013-06-11 11:26:10 +1000255 $(FIXPATHSCMD) $${manpage} | $(FIXALGORITHMSCMD) | \
256 $(AWK) -f $(srcdir)/mdoc2man.awk > $@; \
Damien Miller897741e2001-04-16 10:41:46 +1000257 else \
Darren Tucker6d8bd572013-06-11 11:26:10 +1000258 $(FIXPATHSCMD) $${manpage} | $(FIXALGORITHMSCMD) > $@; \
Damien Miller897741e2001-04-16 10:41:46 +1000259 fi
260
Ben Lindstrom38862182001-04-27 00:31:07 +0000261$(CONFIGFILES): $(CONFIGFILES_IN)
262 conffile=`echo $@ | sed 's/.out$$//'`; \
263 $(FIXPATHSCMD) $(srcdir)/$${conffile} > $@
Damien Miller645c5982000-01-03 14:42:09 +1100264
Darren Tuckerd188a122005-05-29 17:22:29 +1000265# fake rule to stop make trying to compile moduli.o into a binary "moduli.o"
Darren Tuckerb2f9d412003-08-02 23:51:38 +1000266moduli:
267 echo
268
Darren Tucker782390e2003-09-22 10:58:55 +1000269clean: regressclean
Damien Milleref3853b2019-11-29 11:52:23 +1100270 rm -f *.o *.lo *.a $(TARGETS) logintest config.cache config.log
Darren Tucker72c025d2005-01-18 12:05:18 +1100271 rm -f *.out core survey
Damien Miller6bdf70f2017-05-09 14:35:03 +1000272 rm -f regress/check-perm$(EXEEXT)
Damien Millerc59aca82018-07-20 14:53:42 +1000273 rm -f regress/mkdtemp$(EXEEXT)
Damien Millere7429f22014-05-15 18:01:01 +1000274 rm -f regress/unittests/test_helper/*.a
275 rm -f regress/unittests/test_helper/*.o
276 rm -f regress/unittests/sshbuf/*.o
Damien Miller6bdf70f2017-05-09 14:35:03 +1000277 rm -f regress/unittests/sshbuf/test_sshbuf$(EXEEXT)
Damien Millerdd8b1dd2014-07-02 17:38:31 +1000278 rm -f regress/unittests/sshkey/*.o
Damien Miller6bdf70f2017-05-09 14:35:03 +1000279 rm -f regress/unittests/sshkey/test_sshkey$(EXEEXT)
djm@openbsd.orgd333f892015-01-15 07:36:28 +0000280 rm -f regress/unittests/bitmap/*.o
Damien Miller6bdf70f2017-05-09 14:35:03 +1000281 rm -f regress/unittests/bitmap/test_bitmap$(EXEEXT)
Darren Tuckerb1b22dd2017-03-14 14:19:36 +1100282 rm -f regress/unittests/conversion/*.o
Damien Miller6bdf70f2017-05-09 14:35:03 +1000283 rm -f regress/unittests/conversion/test_conversion$(EXEEXT)
Damien Millere89c7802015-02-17 10:04:55 +1100284 rm -f regress/unittests/hostkeys/*.o
Damien Miller6bdf70f2017-05-09 14:35:03 +1000285 rm -f regress/unittests/hostkeys/test_hostkeys$(EXEEXT)
markus@openbsd.orgc78a5782015-01-19 20:45:25 +0000286 rm -f regress/unittests/kex/*.o
Damien Miller6bdf70f2017-05-09 14:35:03 +1000287 rm -f regress/unittests/kex/test_kex$(EXEEXT)
Damien Miller6ee4f1c2016-08-23 16:33:48 +1000288 rm -f regress/unittests/match/*.o
Damien Miller6bdf70f2017-05-09 14:35:03 +1000289 rm -f regress/unittests/match/test_match$(EXEEXT)
Damien Miller6ee4f1c2016-08-23 16:33:48 +1000290 rm -f regress/unittests/utf8/*.o
Damien Miller6bdf70f2017-05-09 14:35:03 +1000291 rm -f regress/unittests/utf8/test_utf8$(EXEEXT)
Darren Tucker8199d032016-07-18 13:47:39 +1000292 rm -f regress/misc/kexfuzz/*.o
Damien Miller6bdf70f2017-05-09 14:35:03 +1000293 rm -f regress/misc/kexfuzz/kexfuzz$(EXEEXT)
Damien Miller48989242019-11-27 16:03:12 +1100294 rm -f regress/misc/sk-dummy/*.o
Damien Milleref3853b2019-11-29 11:52:23 +1100295 rm -f regress/misc/sk-dummy/*.lo
Damien Miller48989242019-11-27 16:03:12 +1100296 rm -f regress/misc/sk-dummy/sk-dummy.so
Damien Millerf41d6182001-11-12 10:34:22 +1100297 (cd openbsd-compat && $(MAKE) clean)
Damien Miller34132e52000-01-14 15:45:46 +1100298
Darren Tucker782390e2003-09-22 10:58:55 +1000299distclean: regressclean
Damien Millera8e06ce2003-11-21 23:48:55 +1100300 rm -f *.o *.a $(TARGETS) logintest config.cache config.log
Damien Miller223897a2006-09-12 21:54:10 +1000301 rm -f *.out core opensshd.init openssh.xml
Damien Millerf22019b2011-05-05 13:48:37 +1000302 rm -f Makefile buildpkg.sh config.h config.status
Damien Miller24f2a422006-07-24 15:30:18 +1000303 rm -f survey.sh openbsd-compat/regress/Makefile *~
Damien Miller7c734052001-10-12 19:15:27 +1000304 rm -rf autom4te.cache
Damien Millerc59aca82018-07-20 14:53:42 +1000305 rm -f regress/check-perm
306 rm -f regress/mkdtemp
Damien Millere7429f22014-05-15 18:01:01 +1000307 rm -f regress/unittests/test_helper/*.a
308 rm -f regress/unittests/test_helper/*.o
309 rm -f regress/unittests/sshbuf/*.o
310 rm -f regress/unittests/sshbuf/test_sshbuf
Damien Millerdd8b1dd2014-07-02 17:38:31 +1000311 rm -f regress/unittests/sshkey/*.o
312 rm -f regress/unittests/sshkey/test_sshkey
djm@openbsd.orgd333f892015-01-15 07:36:28 +0000313 rm -f regress/unittests/bitmap/*.o
314 rm -f regress/unittests/bitmap/test_bitmap
Darren Tuckerb1b22dd2017-03-14 14:19:36 +1100315 rm -f regress/unittests/conversion/*.o
316 rm -f regress/unittests/conversion/test_conversion
Damien Millere89c7802015-02-17 10:04:55 +1100317 rm -f regress/unittests/hostkeys/*.o
318 rm -f regress/unittests/hostkeys/test_hostkeys
markus@openbsd.orgc78a5782015-01-19 20:45:25 +0000319 rm -f regress/unittests/kex/*.o
320 rm -f regress/unittests/kex/test_kex
Damien Miller6ee4f1c2016-08-23 16:33:48 +1000321 rm -f regress/unittests/match/*.o
322 rm -f regress/unittests/match/test_match
323 rm -f regress/unittests/utf8/*.o
324 rm -f regress/unittests/utf8/test_utf8
Damien Miller6aa1bf42018-07-12 14:54:18 +1000325 rm -f regress/misc/kexfuzz/*.o
Damien Miller41c115a2018-09-12 16:50:01 +1000326 rm -f regress/misc/kexfuzz/kexfuzz$(EXEEXT)
Damien Millerf41d6182001-11-12 10:34:22 +1100327 (cd openbsd-compat && $(MAKE) distclean)
Tim Rice6f1f7582004-05-30 21:38:51 -0700328 if test -d pkg ; then \
329 rm -fr pkg ; \
330 fi
Damien Miller8f6bc302001-07-14 13:07:43 +1000331
Damien Millera47f5262003-05-15 13:23:07 +1000332veryclean: distclean
Damien Miller8f6bc302001-07-14 13:07:43 +1000333 rm -f configure config.h.in *.0
Damien Miller34132e52000-01-14 15:45:46 +1100334
Damien Miller7741ce82011-08-06 06:15:15 +1000335cleandir: veryclean
336
Damien Millera47f5262003-05-15 13:23:07 +1000337mrproper: veryclean
338
339realclean: veryclean
Damien Miller34132e52000-01-14 15:45:46 +1100340
Ben Lindstrome2e66a22001-04-18 15:46:01 +0000341catman-do:
Ben Lindstrom38862182001-04-27 00:31:07 +0000342 @for f in $(MANPAGES_IN) ; do \
Ben Lindstrome2e66a22001-04-18 15:46:01 +0000343 base=`echo $$f | sed 's/\..*$$//'` ; \
344 echo "$$f -> $$base.0" ; \
Damien Miller30a69e72011-01-04 08:16:27 +1100345 $(MANFMT) $$f | cat -v | sed -e 's/.\^H//g' \
Ben Lindstrome2e66a22001-04-18 15:46:01 +0000346 >$$base.0 ; \
347 done
Damien Miller34132e52000-01-14 15:45:46 +1100348
Darren Tucker79c0e1d2017-12-11 14:38:33 +1100349depend: depend-rebuild
350 rm -f .depend.bak
351
352depend-rebuild:
Darren Tucker2d96f282017-12-11 16:21:55 +1100353 rm -f config.h
354 touch config.h
Darren Tucker5299a092019-07-19 13:50:25 +1000355 makedepend -w1000 -Y. -f .depend *.c 2>/dev/null
Darren Tucker5e3abff2019-12-11 13:09:34 +1100356 (head -2 .depend; tail +3 .depend | sort) >.depend.tmp
357 mv .depend.tmp .depend
Darren Tucker2d96f282017-12-11 16:21:55 +1100358 rm -f config.h
Darren Tucker79c0e1d2017-12-11 14:38:33 +1100359
360depend-check: depend-rebuild
361 cmp .depend .depend.bak || (echo .depend stale && exit 1)
362
363distprep: catman-do depend-check
Damien Millerf58c6722002-05-13 13:15:42 +1000364 $(AUTORECONF)
Darren Tucker79c0e1d2017-12-11 14:38:33 +1100365 -rm -rf autom4te.cache .depend.bak
Damien Miller262ff172000-06-28 08:24:49 +1000366
Damien Millerf22019b2011-05-05 13:48:37 +1000367install: $(CONFIGFILES) $(MANPAGES) $(TARGETS) install-files install-sysconf host-key check-config
368install-nokeys: $(CONFIGFILES) $(MANPAGES) $(TARGETS) install-files install-sysconf
369install-nosysconf: $(CONFIGFILES) $(MANPAGES) $(TARGETS) install-files
Damien Miller099f5052000-06-22 20:57:11 +1000370
Tim Rice95210192002-07-14 10:02:20 -0700371check-config:
372 -$(DESTDIR)$(sbindir)/sshd -t -f $(DESTDIR)$(sysconfdir)/sshd_config
Damien Millerd3f6ad22002-06-25 10:24:47 +1000373
Damien Millerd8f60022010-02-12 09:34:22 +1100374install-files:
Darren Tucker6c8a2462017-12-01 17:11:47 +1100375 $(MKDIR_P) $(DESTDIR)$(bindir)
376 $(MKDIR_P) $(DESTDIR)$(sbindir)
377 $(MKDIR_P) $(DESTDIR)$(mandir)/$(mansubdir)1
378 $(MKDIR_P) $(DESTDIR)$(mandir)/$(mansubdir)5
379 $(MKDIR_P) $(DESTDIR)$(mandir)/$(mansubdir)8
380 $(MKDIR_P) $(DESTDIR)$(libexecdir)
381 $(MKDIR_P) -m 0755 $(DESTDIR)$(PRIVSEP_PATH)
Tim Riceded8fa02010-03-11 22:32:02 -0800382 $(INSTALL) -m 0755 $(STRIP_OPT) ssh$(EXEEXT) $(DESTDIR)$(bindir)/ssh$(EXEEXT)
383 $(INSTALL) -m 0755 $(STRIP_OPT) scp$(EXEEXT) $(DESTDIR)$(bindir)/scp$(EXEEXT)
384 $(INSTALL) -m 0755 $(STRIP_OPT) ssh-add$(EXEEXT) $(DESTDIR)$(bindir)/ssh-add$(EXEEXT)
385 $(INSTALL) -m 0755 $(STRIP_OPT) ssh-agent$(EXEEXT) $(DESTDIR)$(bindir)/ssh-agent$(EXEEXT)
386 $(INSTALL) -m 0755 $(STRIP_OPT) ssh-keygen$(EXEEXT) $(DESTDIR)$(bindir)/ssh-keygen$(EXEEXT)
387 $(INSTALL) -m 0755 $(STRIP_OPT) ssh-keyscan$(EXEEXT) $(DESTDIR)$(bindir)/ssh-keyscan$(EXEEXT)
388 $(INSTALL) -m 0755 $(STRIP_OPT) sshd$(EXEEXT) $(DESTDIR)$(sbindir)/sshd$(EXEEXT)
Tim Riceded8fa02010-03-11 22:32:02 -0800389 $(INSTALL) -m 4711 $(STRIP_OPT) ssh-keysign$(EXEEXT) $(DESTDIR)$(SSH_KEYSIGN)$(EXEEXT)
390 $(INSTALL) -m 0755 $(STRIP_OPT) ssh-pkcs11-helper$(EXEEXT) $(DESTDIR)$(SSH_PKCS11_HELPER)$(EXEEXT)
djm@openbsd.org07da39f2019-10-31 21:22:01 +0000391 $(INSTALL) -m 0755 $(STRIP_OPT) ssh-sk-helper$(EXEEXT) $(DESTDIR)$(SSH_SK_HELPER)$(EXEEXT)
Tim Riceded8fa02010-03-11 22:32:02 -0800392 $(INSTALL) -m 0755 $(STRIP_OPT) sftp$(EXEEXT) $(DESTDIR)$(bindir)/sftp$(EXEEXT)
393 $(INSTALL) -m 0755 $(STRIP_OPT) sftp-server$(EXEEXT) $(DESTDIR)$(SFTP_SERVER)$(EXEEXT)
Ben Lindstrombc709922001-04-18 18:04:21 +0000394 $(INSTALL) -m 644 ssh.1.out $(DESTDIR)$(mandir)/$(mansubdir)1/ssh.1
395 $(INSTALL) -m 644 scp.1.out $(DESTDIR)$(mandir)/$(mansubdir)1/scp.1
396 $(INSTALL) -m 644 ssh-add.1.out $(DESTDIR)$(mandir)/$(mansubdir)1/ssh-add.1
397 $(INSTALL) -m 644 ssh-agent.1.out $(DESTDIR)$(mandir)/$(mansubdir)1/ssh-agent.1
398 $(INSTALL) -m 644 ssh-keygen.1.out $(DESTDIR)$(mandir)/$(mansubdir)1/ssh-keygen.1
399 $(INSTALL) -m 644 ssh-keyscan.1.out $(DESTDIR)$(mandir)/$(mansubdir)1/ssh-keyscan.1
Damien Miller60dcc622008-06-26 15:59:32 +1000400 $(INSTALL) -m 644 moduli.5.out $(DESTDIR)$(mandir)/$(mansubdir)5/moduli.5
Ben Lindstrom90ac0b52002-06-21 01:38:53 +0000401 $(INSTALL) -m 644 sshd_config.5.out $(DESTDIR)$(mandir)/$(mansubdir)5/sshd_config.5
402 $(INSTALL) -m 644 ssh_config.5.out $(DESTDIR)$(mandir)/$(mansubdir)5/ssh_config.5
Ben Lindstrombc709922001-04-18 18:04:21 +0000403 $(INSTALL) -m 644 sshd.8.out $(DESTDIR)$(mandir)/$(mansubdir)8/sshd.8
Ben Lindstrom5bd6eb72003-03-21 00:34:34 +0000404 $(INSTALL) -m 644 sftp.1.out $(DESTDIR)$(mandir)/$(mansubdir)1/sftp.1
405 $(INSTALL) -m 644 sftp-server.8.out $(DESTDIR)$(mandir)/$(mansubdir)8/sftp-server.8
Ben Lindstromdb41d232002-06-07 03:11:38 +0000406 $(INSTALL) -m 644 ssh-keysign.8.out $(DESTDIR)$(mandir)/$(mansubdir)8/ssh-keysign.8
Damien Miller43001b32010-02-24 18:18:51 +1100407 $(INSTALL) -m 644 ssh-pkcs11-helper.8.out $(DESTDIR)$(mandir)/$(mansubdir)8/ssh-pkcs11-helper.8
naddy@openbsd.orgaa4c6402019-11-07 08:38:38 +0000408 $(INSTALL) -m 644 ssh-sk-helper.8.out $(DESTDIR)$(mandir)/$(mansubdir)8/ssh-sk-helper.8
Darren Tuckerdc8fc622005-02-26 10:12:38 +1100409
410install-sysconf:
Darren Tucker6c8a2462017-12-01 17:11:47 +1100411 $(MKDIR_P) $(DESTDIR)$(sysconfdir)
Tim Rice1363b3c2002-07-12 09:04:06 -0700412 @if [ ! -f $(DESTDIR)$(sysconfdir)/ssh_config ]; then \
Damien Miller7d7c60d2000-01-26 14:37:48 +1100413 $(INSTALL) -m 644 ssh_config.out $(DESTDIR)$(sysconfdir)/ssh_config; \
Damien Miller29abb1b2000-11-11 08:51:40 +1100414 else \
415 echo "$(DESTDIR)$(sysconfdir)/ssh_config already exists, install will not overwrite"; \
Damien Miller0986b552000-11-11 08:36:38 +1100416 fi
Tim Rice1363b3c2002-07-12 09:04:06 -0700417 @if [ ! -f $(DESTDIR)$(sysconfdir)/sshd_config ]; then \
Damien Miller7d7c60d2000-01-26 14:37:48 +1100418 $(INSTALL) -m 644 sshd_config.out $(DESTDIR)$(sysconfdir)/sshd_config; \
Damien Miller29abb1b2000-11-11 08:51:40 +1100419 else \
420 echo "$(DESTDIR)$(sysconfdir)/sshd_config already exists, install will not overwrite"; \
Damien Miller296a5461999-11-13 10:48:51 +1100421 fi
Tim Rice1363b3c2002-07-12 09:04:06 -0700422 @if [ ! -f $(DESTDIR)$(sysconfdir)/moduli ]; then \
Damien Millerb5b0af42001-06-27 21:52:32 +1000423 if [ -f $(DESTDIR)$(sysconfdir)/primes ]; then \
424 echo "moving $(DESTDIR)$(sysconfdir)/primes to $(DESTDIR)$(sysconfdir)/moduli"; \
425 mv "$(DESTDIR)$(sysconfdir)/primes" "$(DESTDIR)$(sysconfdir)/moduli"; \
Damien Milleracf59e62001-06-28 20:23:14 +1000426 else \
Damien Millerb5b0af42001-06-27 21:52:32 +1000427 $(INSTALL) -m 644 moduli.out $(DESTDIR)$(sysconfdir)/moduli; \
428 fi ; \
Damien Miller29abb1b2000-11-11 08:51:40 +1100429 else \
Damien Millerb5b0af42001-06-27 21:52:32 +1000430 echo "$(DESTDIR)$(sysconfdir)/moduli already exists, install will not overwrite"; \
Damien Miller0986b552000-11-11 08:36:38 +1100431 fi
Damien Miller296a5461999-11-13 10:48:51 +1100432
Damien Millerbac2d8a2000-09-05 16:13:06 +1100433host-key: ssh-keygen$(EXEEXT)
Tim Rice1363b3c2002-07-12 09:04:06 -0700434 @if [ -z "$(DESTDIR)" ] ; then \
Darren Tuckercfffbdb2015-09-14 16:24:21 +1000435 ./ssh-keygen -A; \
436 fi
Damien Miller099f5052000-06-22 20:57:11 +1000437
Darren Tuckercfffbdb2015-09-14 16:24:21 +1000438host-key-force: ssh-keygen$(EXEEXT) ssh$(EXEEXT)
Ben Lindstrom65571522000-11-16 02:46:20 +0000439 ./ssh-keygen -t dsa -f $(DESTDIR)$(sysconfdir)/ssh_host_dsa_key -N ""
440 ./ssh-keygen -t rsa -f $(DESTDIR)$(sysconfdir)/ssh_host_rsa_key -N ""
Damien Millerda3ca352013-12-07 21:43:46 +1100441 ./ssh-keygen -t ed25519 -f $(DESTDIR)$(sysconfdir)/ssh_host_ed25519_key -N ""
Darren Tuckercfffbdb2015-09-14 16:24:21 +1000442 if ./ssh -Q key | grep ecdsa >/dev/null ; then \
443 ./ssh-keygen -t ecdsa -f $(DESTDIR)$(sysconfdir)/ssh_host_ecdsa_key -N ""; \
444 fi
Damien Miller4095f892000-03-03 22:13:52 +1100445
Damien Millerbf1c9b21999-12-09 10:16:54 +1100446uninstallall: uninstall
Damien Miller7d7c60d2000-01-26 14:37:48 +1100447 -rm -f $(DESTDIR)$(sysconfdir)/ssh_config
448 -rm -f $(DESTDIR)$(sysconfdir)/sshd_config
449 -rmdir $(DESTDIR)$(sysconfdir)
450 -rmdir $(DESTDIR)$(bindir)
451 -rmdir $(DESTDIR)$(sbindir)
452 -rmdir $(DESTDIR)$(mandir)/$(mansubdir)1
453 -rmdir $(DESTDIR)$(mandir)/$(mansubdir)8
454 -rmdir $(DESTDIR)$(mandir)
455 -rmdir $(DESTDIR)$(libexecdir)
Damien Millerbf1c9b21999-12-09 10:16:54 +1100456
Damien Millera8e06ce2003-11-21 23:48:55 +1100457uninstall:
Damien Millerbac2d8a2000-09-05 16:13:06 +1100458 -rm -f $(DESTDIR)$(bindir)/ssh$(EXEEXT)
459 -rm -f $(DESTDIR)$(bindir)/scp$(EXEEXT)
460 -rm -f $(DESTDIR)$(bindir)/ssh-add$(EXEEXT)
461 -rm -f $(DESTDIR)$(bindir)/ssh-agent$(EXEEXT)
462 -rm -f $(DESTDIR)$(bindir)/ssh-keygen$(EXEEXT)
Ben Lindstromb6434ae2000-12-05 01:15:09 +0000463 -rm -f $(DESTDIR)$(bindir)/ssh-keyscan$(EXEEXT)
Damien Miller33804262001-02-04 23:20:18 +1100464 -rm -f $(DESTDIR)$(bindir)/sftp$(EXEEXT)
Damien Millerbac2d8a2000-09-05 16:13:06 +1100465 -rm -f $(DESTDIR)$(sbindir)/sshd$(EXEEXT)
Damien Millerd7686fd2001-02-10 00:40:03 +1100466 -rm -r $(DESTDIR)$(SFTP_SERVER)$(EXEEXT)
Ben Lindstromdb41d232002-06-07 03:11:38 +0000467 -rm -f $(DESTDIR)$(SSH_KEYSIGN)$(EXEEXT)
Damien Miller7ea845e2010-02-12 09:21:02 +1100468 -rm -f $(DESTDIR)$(SSH_PKCS11_HELPER)$(EXEEXT)
djm@openbsd.org07da39f2019-10-31 21:22:01 +0000469 -rm -f $(DESTDIR)$(SSH_SK_HELPER)$(EXEEXT)
Damien Miller7d7c60d2000-01-26 14:37:48 +1100470 -rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/ssh.1
471 -rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/scp.1
472 -rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/ssh-add.1
473 -rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/ssh-agent.1
474 -rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/ssh-keygen.1
Damien Miller33804262001-02-04 23:20:18 +1100475 -rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/sftp.1
Ben Lindstromb6434ae2000-12-05 01:15:09 +0000476 -rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/ssh-keyscan.1
Damien Miller7d7c60d2000-01-26 14:37:48 +1100477 -rm -f $(DESTDIR)$(mandir)/$(mansubdir)8/sshd.8
Ben Lindstrom3ad650a2001-01-03 06:02:51 +0000478 -rm -f $(DESTDIR)$(mandir)/$(mansubdir)8/sftp-server.8
Ben Lindstromdb41d232002-06-07 03:11:38 +0000479 -rm -f $(DESTDIR)$(mandir)/$(mansubdir)8/ssh-keysign.8
Damien Miller43001b32010-02-24 18:18:51 +1100480 -rm -f $(DESTDIR)$(mandir)/$(mansubdir)8/ssh-pkcs11-helper.8
naddy@openbsd.orgaa4c6402019-11-07 08:38:38 +0000481 -rm -f $(DESTDIR)$(mandir)/$(mansubdir)8/ssh-sk-helper.8
Darren Tucker150a81c2003-09-04 13:41:06 +1000482
Damien Millere7429f22014-05-15 18:01:01 +1000483regress-prep:
Darren Tucker6c8a2462017-12-01 17:11:47 +1100484 $(MKDIR_P) `pwd`/regress/unittests/test_helper
485 $(MKDIR_P) `pwd`/regress/unittests/sshbuf
486 $(MKDIR_P) `pwd`/regress/unittests/sshkey
487 $(MKDIR_P) `pwd`/regress/unittests/bitmap
488 $(MKDIR_P) `pwd`/regress/unittests/conversion
489 $(MKDIR_P) `pwd`/regress/unittests/hostkeys
490 $(MKDIR_P) `pwd`/regress/unittests/kex
491 $(MKDIR_P) `pwd`/regress/unittests/match
492 $(MKDIR_P) `pwd`/regress/unittests/utf8
493 $(MKDIR_P) `pwd`/regress/misc/kexfuzz
Damien Miller323da822019-11-28 09:53:42 +1100494 $(MKDIR_P) `pwd`/regress/misc/sk-dummy
Damien Miller7faaa322015-02-22 07:57:27 +1100495 [ -f `pwd`/regress/Makefile ] || \
Tim Rice75db01d2013-03-22 10:14:32 -0700496 ln -s `cd $(srcdir) && pwd`/regress/Makefile `pwd`/regress/Makefile
Damien Millere7429f22014-05-15 18:01:01 +1000497
Darren Tuckerc71ba792016-07-18 15:43:25 +1000498REGRESSLIBS=libssh.a $(LIBCOMPAT)
499
500regress/modpipe$(EXEEXT): $(srcdir)/regress/modpipe.c $(REGRESSLIBS)
Darren Tuckere8b58f42016-07-18 17:22:49 +1000501 $(CC) $(CFLAGS) $(CPPFLAGS) -o $@ $(srcdir)/regress/modpipe.c \
Tim Rice86211d12013-06-01 18:38:23 -0700502 $(LDFLAGS) -lssh -lopenbsd-compat -lssh -lopenbsd-compat $(LIBS)
Tim Ricec31db8c2013-02-19 19:01:51 -0800503
Darren Tuckerc71ba792016-07-18 15:43:25 +1000504regress/setuid-allowed$(EXEEXT): $(srcdir)/regress/setuid-allowed.c $(REGRESSLIBS)
Darren Tuckere8b58f42016-07-18 17:22:49 +1000505 $(CC) $(CFLAGS) $(CPPFLAGS) -o $@ $(srcdir)/regress/setuid-allowed.c \
Damien Miller6d6fcd12013-12-08 15:53:28 +1100506 $(LDFLAGS) -lssh -lopenbsd-compat -lssh -lopenbsd-compat $(LIBS)
507
Darren Tuckerc71ba792016-07-18 15:43:25 +1000508regress/netcat$(EXEEXT): $(srcdir)/regress/netcat.c $(REGRESSLIBS)
Darren Tuckere8b58f42016-07-18 17:22:49 +1000509 $(CC) $(CFLAGS) $(CPPFLAGS) -o $@ $(srcdir)/regress/netcat.c \
Tim Ricee6b95032015-02-25 09:56:48 -0800510 $(LDFLAGS) -lssh -lopenbsd-compat -lssh -lopenbsd-compat $(LIBS)
Damien Miller293cac52014-12-22 16:30:42 +1100511
Darren Tuckerc71ba792016-07-18 15:43:25 +1000512regress/check-perm$(EXEEXT): $(srcdir)/regress/check-perm.c $(REGRESSLIBS)
Darren Tuckere8b58f42016-07-18 17:22:49 +1000513 $(CC) $(CFLAGS) $(CPPFLAGS) -o $@ $(srcdir)/regress/check-perm.c \
Damien Miller1acc0582016-02-23 16:12:13 +1100514 $(LDFLAGS) -lssh -lopenbsd-compat -lssh -lopenbsd-compat $(LIBS)
515
Damien Millerc59aca82018-07-20 14:53:42 +1000516regress/mkdtemp$(EXEEXT): $(srcdir)/regress/mkdtemp.c $(REGRESSLIBS)
517 $(CC) $(CFLAGS) $(CPPFLAGS) -o $@ $(srcdir)/regress/mkdtemp.c \
518 $(LDFLAGS) -lssh -lopenbsd-compat -lssh -lopenbsd-compat $(LIBS)
519
Damien Millere7429f22014-05-15 18:01:01 +1000520UNITTESTS_TEST_HELPER_OBJS=\
521 regress/unittests/test_helper/test_helper.o \
522 regress/unittests/test_helper/fuzz.o
523
524regress/unittests/test_helper/libtest_helper.a: ${UNITTESTS_TEST_HELPER_OBJS}
525 $(AR) rv $@ $(UNITTESTS_TEST_HELPER_OBJS)
526 $(RANLIB) $@
527
528UNITTESTS_TEST_SSHBUF_OBJS=\
529 regress/unittests/sshbuf/tests.o \
530 regress/unittests/sshbuf/test_sshbuf.o \
531 regress/unittests/sshbuf/test_sshbuf_getput_basic.o \
532 regress/unittests/sshbuf/test_sshbuf_getput_crypto.o \
533 regress/unittests/sshbuf/test_sshbuf_misc.o \
534 regress/unittests/sshbuf/test_sshbuf_fuzz.o \
535 regress/unittests/sshbuf/test_sshbuf_getput_fuzz.o \
536 regress/unittests/sshbuf/test_sshbuf_fixed.o
537
538regress/unittests/sshbuf/test_sshbuf$(EXEEXT): ${UNITTESTS_TEST_SSHBUF_OBJS} \
Damien Millerdd8b1dd2014-07-02 17:38:31 +1000539 regress/unittests/test_helper/libtest_helper.a libssh.a
Damien Millere7429f22014-05-15 18:01:01 +1000540 $(LD) -o $@ $(LDFLAGS) $(UNITTESTS_TEST_SSHBUF_OBJS) \
Damien Millerc5089ec2014-08-20 11:06:20 +1000541 regress/unittests/test_helper/libtest_helper.a \
Damien Millere7429f22014-05-15 18:01:01 +1000542 -lssh -lopenbsd-compat -lssh -lopenbsd-compat $(LIBS)
543
Damien Millerdd8b1dd2014-07-02 17:38:31 +1000544UNITTESTS_TEST_SSHKEY_OBJS=\
545 regress/unittests/sshkey/test_fuzz.o \
546 regress/unittests/sshkey/tests.o \
547 regress/unittests/sshkey/common.o \
548 regress/unittests/sshkey/test_file.o \
Damien Miller7b47b402019-12-14 08:20:52 +1100549 regress/unittests/sshkey/test_sshkey.o \
550 $(SKOBJS)
Damien Millerdd8b1dd2014-07-02 17:38:31 +1000551
552regress/unittests/sshkey/test_sshkey$(EXEEXT): ${UNITTESTS_TEST_SSHKEY_OBJS} \
553 regress/unittests/test_helper/libtest_helper.a libssh.a
554 $(LD) -o $@ $(LDFLAGS) $(UNITTESTS_TEST_SSHKEY_OBJS) \
Damien Milleraa6598e2014-08-21 10:47:54 +1000555 regress/unittests/test_helper/libtest_helper.a \
Damien Millerdd8b1dd2014-07-02 17:38:31 +1000556 -lssh -lopenbsd-compat -lssh -lopenbsd-compat $(LIBS)
557
djm@openbsd.orgd333f892015-01-15 07:36:28 +0000558UNITTESTS_TEST_BITMAP_OBJS=\
Damien Miller45c0fd72015-01-15 22:08:23 +1100559 regress/unittests/bitmap/tests.o
djm@openbsd.orgd333f892015-01-15 07:36:28 +0000560
markus@openbsd.orgc78a5782015-01-19 20:45:25 +0000561regress/unittests/bitmap/test_bitmap$(EXEEXT): ${UNITTESTS_TEST_BITMAP_OBJS} \
562 regress/unittests/test_helper/libtest_helper.a libssh.a
563 $(LD) -o $@ $(LDFLAGS) $(UNITTESTS_TEST_BITMAP_OBJS) \
564 regress/unittests/test_helper/libtest_helper.a \
565 -lssh -lopenbsd-compat -lssh -lopenbsd-compat $(LIBS)
566
Darren Tuckerb1b22dd2017-03-14 14:19:36 +1100567UNITTESTS_TEST_CONVERSION_OBJS=\
568 regress/unittests/conversion/tests.o
569
570regress/unittests/conversion/test_conversion$(EXEEXT): \
571 ${UNITTESTS_TEST_CONVERSION_OBJS} \
572 regress/unittests/test_helper/libtest_helper.a libssh.a
573 $(LD) -o $@ $(LDFLAGS) $(UNITTESTS_TEST_CONVERSION_OBJS) \
574 regress/unittests/test_helper/libtest_helper.a \
575 -lssh -lopenbsd-compat -lssh -lopenbsd-compat $(LIBS)
576
Damien Miller1ca3e212015-01-20 10:11:31 +1100577UNITTESTS_TEST_KEX_OBJS=\
markus@openbsd.orgc78a5782015-01-19 20:45:25 +0000578 regress/unittests/kex/tests.o \
Damien Miller7b47b402019-12-14 08:20:52 +1100579 regress/unittests/kex/test_kex.o \
580 $(SKOBJS)
markus@openbsd.orgc78a5782015-01-19 20:45:25 +0000581
Damien Miller1ca3e212015-01-20 10:11:31 +1100582regress/unittests/kex/test_kex$(EXEEXT): ${UNITTESTS_TEST_KEX_OBJS} \
djm@openbsd.orgd333f892015-01-15 07:36:28 +0000583 regress/unittests/test_helper/libtest_helper.a libssh.a
Damien Miller1ca3e212015-01-20 10:11:31 +1100584 $(LD) -o $@ $(LDFLAGS) $(UNITTESTS_TEST_KEX_OBJS) \
djm@openbsd.orgd333f892015-01-15 07:36:28 +0000585 regress/unittests/test_helper/libtest_helper.a \
586 -lssh -lopenbsd-compat -lssh -lopenbsd-compat $(LIBS)
587
Damien Millere89c7802015-02-17 10:04:55 +1100588UNITTESTS_TEST_HOSTKEYS_OBJS=\
589 regress/unittests/hostkeys/tests.o \
Damien Miller7b47b402019-12-14 08:20:52 +1100590 regress/unittests/hostkeys/test_iterate.o \
591 $(SKOBJS)
Damien Millere89c7802015-02-17 10:04:55 +1100592
593regress/unittests/hostkeys/test_hostkeys$(EXEEXT): \
594 ${UNITTESTS_TEST_HOSTKEYS_OBJS} \
595 regress/unittests/test_helper/libtest_helper.a libssh.a
596 $(LD) -o $@ $(LDFLAGS) $(UNITTESTS_TEST_HOSTKEYS_OBJS) \
597 regress/unittests/test_helper/libtest_helper.a \
598 -lssh -lopenbsd-compat -lssh -lopenbsd-compat $(LIBS)
599
Damien Miller6ee4f1c2016-08-23 16:33:48 +1000600UNITTESTS_TEST_MATCH_OBJS=\
601 regress/unittests/match/tests.o
602
603regress/unittests/match/test_match$(EXEEXT): \
604 ${UNITTESTS_TEST_MATCH_OBJS} \
605 regress/unittests/test_helper/libtest_helper.a libssh.a
606 $(LD) -o $@ $(LDFLAGS) $(UNITTESTS_TEST_MATCH_OBJS) \
607 regress/unittests/test_helper/libtest_helper.a \
608 -lssh -lopenbsd-compat -lssh -lopenbsd-compat $(LIBS)
609
610UNITTESTS_TEST_UTF8_OBJS=\
611 regress/unittests/utf8/tests.o
612
613regress/unittests/utf8/test_utf8$(EXEEXT): \
614 ${UNITTESTS_TEST_UTF8_OBJS} \
615 regress/unittests/test_helper/libtest_helper.a libssh.a
616 $(LD) -o $@ $(LDFLAGS) $(UNITTESTS_TEST_UTF8_OBJS) \
617 regress/unittests/test_helper/libtest_helper.a \
618 -lssh -lopenbsd-compat -lssh -lopenbsd-compat $(LIBS)
619
Damien Milleraf0bb382016-03-04 15:11:55 +1100620MISC_KEX_FUZZ_OBJS=\
Damien Miller7b47b402019-12-14 08:20:52 +1100621 regress/misc/kexfuzz/kexfuzz.o \
622 $(SKOBJS)
Damien Milleraf0bb382016-03-04 15:11:55 +1100623
624regress/misc/kexfuzz/kexfuzz$(EXEEXT): ${MISC_KEX_FUZZ_OBJS} libssh.a
625 $(LD) -o $@ $(LDFLAGS) $(MISC_KEX_FUZZ_OBJS) \
626 -lssh -lopenbsd-compat -lssh -lopenbsd-compat $(LIBS)
627
Damien Miller48989242019-11-27 16:03:12 +1100628# These all need to be compiled -fPIC, so they are treated differently.
Damien Miller323da822019-11-28 09:53:42 +1100629SK_DUMMY_OBJS=\
630 regress/misc/sk-dummy/sk-dummy.lo \
Damien Milleref3853b2019-11-29 11:52:23 +1100631 regress/misc/sk-dummy/fatal.lo \
djm@openbsd.orgd46ac562019-11-29 00:13:29 +0000632 ed25519.lo hash.lo ge25519.lo fe25519.lo sc25519.lo verify.lo
Damien Miller48989242019-11-27 16:03:12 +1100633
Damien Milleref3853b2019-11-29 11:52:23 +1100634.c.lo: Makefile.in config.h
Damien Millerb2180552019-11-29 12:32:23 +1100635 $(CC) $(CFLAGS_NOPIE) $(PICFLAG) $(CPPFLAGS) -c $< -o $@
Damien Miller323da822019-11-28 09:53:42 +1100636
637regress/misc/sk-dummy/sk-dummy.so: $(SK_DUMMY_OBJS)
Damien Miller5ca52c02019-11-28 18:09:07 +1100638 $(CC) $(CFLAGS) $(CPPFLAGS) -fPIC -shared -o $@ $(SK_DUMMY_OBJS) \
Damien Miller44384812019-11-29 15:10:21 +1100639 -L. -Lopenbsd-compat -lopenbsd-compat $(LDFLAGS_NOPIE) $(LIBS)
Damien Miller48989242019-11-27 16:03:12 +1100640
Darren Tucker159e9872019-07-24 14:21:19 +1000641regress-binaries: regress-prep $(LIBCOMPAT) \
Darren Tucker520d4552019-07-24 11:20:18 +1000642 regress/modpipe$(EXEEXT) \
Damien Millere7429f22014-05-15 18:01:01 +1000643 regress/setuid-allowed$(EXEEXT) \
Damien Miller293cac52014-12-22 16:30:42 +1100644 regress/netcat$(EXEEXT) \
Damien Miller1acc0582016-02-23 16:12:13 +1100645 regress/check-perm$(EXEEXT) \
Damien Miller48989242019-11-27 16:03:12 +1100646 regress/mkdtemp$(EXEEXT) \
647 regress/misc/sk-dummy/sk-dummy.so
Darren Tuckere0055af2019-07-23 23:06:22 +1000648
Darren Tucker159e9872019-07-24 14:21:19 +1000649regress-unit-binaries: regress-prep $(REGRESSLIBS) \
Damien Millerdd8b1dd2014-07-02 17:38:31 +1000650 regress/unittests/sshbuf/test_sshbuf$(EXEEXT) \
djm@openbsd.orgd333f892015-01-15 07:36:28 +0000651 regress/unittests/sshkey/test_sshkey$(EXEEXT) \
markus@openbsd.orgc78a5782015-01-19 20:45:25 +0000652 regress/unittests/bitmap/test_bitmap$(EXEEXT) \
Darren Tuckerb1b22dd2017-03-14 14:19:36 +1100653 regress/unittests/conversion/test_conversion$(EXEEXT) \
Damien Millere89c7802015-02-17 10:04:55 +1100654 regress/unittests/hostkeys/test_hostkeys$(EXEEXT) \
Damien Milleraf0bb382016-03-04 15:11:55 +1100655 regress/unittests/kex/test_kex$(EXEEXT) \
Damien Miller6ee4f1c2016-08-23 16:33:48 +1000656 regress/unittests/match/test_match$(EXEEXT) \
657 regress/unittests/utf8/test_utf8$(EXEEXT) \
Damien Milleraf0bb382016-03-04 15:11:55 +1100658 regress/misc/kexfuzz/kexfuzz$(EXEEXT)
Damien Millere7429f22014-05-15 18:01:01 +1000659
Darren Tucker159e9872019-07-24 14:21:19 +1000660tests: file-tests t-exec interop-tests unit
Darren Tuckere93ffd12019-07-29 16:04:01 +1000661 echo all tests passed
Darren Tuckere0055af2019-07-23 23:06:22 +1000662
Darren Tucker159e9872019-07-24 14:21:19 +1000663unit: regress-unit-binaries
664 BUILDDIR=`pwd`; \
665 cd $(srcdir)/regress || exit $$?; \
666 $(MAKE) \
667 .OBJDIR="$${BUILDDIR}/regress" \
668 .CURDIR="`pwd`" \
Darren Tuckere93ffd12019-07-29 16:04:01 +1000669 $@ && echo $@ tests passed
Darren Tucker159e9872019-07-24 14:21:19 +1000670
671interop-tests t-exec file-tests: regress-prep regress-binaries $(TARGETS)
Darren Tucker150a81c2003-09-04 13:41:06 +1000672 BUILDDIR=`pwd`; \
Damien Millerb0e0f762014-01-24 14:27:04 +1100673 TEST_SSH_SCP="$${BUILDDIR}/scp"; \
Darren Tucker150a81c2003-09-04 13:41:06 +1000674 TEST_SSH_SSH="$${BUILDDIR}/ssh"; \
675 TEST_SSH_SSHD="$${BUILDDIR}/sshd"; \
676 TEST_SSH_SSHAGENT="$${BUILDDIR}/ssh-agent"; \
677 TEST_SSH_SSHADD="$${BUILDDIR}/ssh-add"; \
678 TEST_SSH_SSHKEYGEN="$${BUILDDIR}/ssh-keygen"; \
Damien Miller7ea845e2010-02-12 09:21:02 +1100679 TEST_SSH_SSHPKCS11HELPER="$${BUILDDIR}/ssh-pkcs11-helper"; \
djm@openbsd.org07da39f2019-10-31 21:22:01 +0000680 TEST_SSH_SSHSKHELPER="$${BUILDDIR}/ssh-sk-helper"; \
Darren Tucker150a81c2003-09-04 13:41:06 +1000681 TEST_SSH_SSHKEYSCAN="$${BUILDDIR}/ssh-keyscan"; \
682 TEST_SSH_SFTP="$${BUILDDIR}/sftp"; \
683 TEST_SSH_SFTPSERVER="$${BUILDDIR}/sftp-server"; \
Damien Miller48989242019-11-27 16:03:12 +1100684 TEST_SSH_PKCS11_HELPER="$${BUILDDIR}/ssh-pkcs11-helper"; \
685 TEST_SSH_SK_HELPER="$${BUILDDIR}/ssh-sk-helper"; \
686 TEST_SSH_SFTPSERVER="$${BUILDDIR}/sftp-server"; \
Damien Millerc2cefb02008-03-13 12:41:31 +1100687 TEST_SSH_PLINK="plink"; \
688 TEST_SSH_PUTTYGEN="puttygen"; \
Damien Miller42743cb2008-07-05 09:50:23 +1000689 TEST_SSH_CONCH="conch"; \
Darren Tucker5d376902008-06-11 04:15:05 +1000690 TEST_SSH_IPV6="@TEST_SSH_IPV6@" ; \
Darren Tucker47b8c992016-12-08 15:48:34 +1100691 TEST_SSH_UTF8="@TEST_SSH_UTF8@" ; \
Tim Ricecce927c2011-01-12 19:06:31 -0800692 TEST_SSH_ECC="@TEST_SSH_ECC@" ; \
Darren Tucker150a81c2003-09-04 13:41:06 +1000693 cd $(srcdir)/regress || exit $$?; \
694 $(MAKE) \
695 .OBJDIR="$${BUILDDIR}/regress" \
696 .CURDIR="`pwd`" \
Darren Tucker11857652003-09-04 18:04:16 +1000697 BUILDDIR="$${BUILDDIR}" \
Darren Tucker575fac32018-04-13 13:13:33 +1000698 OBJ="$${BUILDDIR}/regress/" \
Darren Tucker150a81c2003-09-04 13:41:06 +1000699 PATH="$${BUILDDIR}:$${PATH}" \
Darren Tucker882abfd2013-11-09 00:17:41 +1100700 TEST_ENV=MALLOC_OPTIONS="@TEST_MALLOC_OPTIONS@" \
Darren Tucker732b4632016-03-14 16:04:23 +1100701 TEST_MALLOC_OPTIONS="@TEST_MALLOC_OPTIONS@" \
Damien Millerb0e0f762014-01-24 14:27:04 +1100702 TEST_SSH_SCP="$${TEST_SSH_SCP}" \
Darren Tucker150a81c2003-09-04 13:41:06 +1000703 TEST_SSH_SSH="$${TEST_SSH_SSH}" \
704 TEST_SSH_SSHD="$${TEST_SSH_SSHD}" \
705 TEST_SSH_SSHAGENT="$${TEST_SSH_SSHAGENT}" \
706 TEST_SSH_SSHADD="$${TEST_SSH_SSHADD}" \
707 TEST_SSH_SSHKEYGEN="$${TEST_SSH_SSHKEYGEN}" \
Damien Miller7ea845e2010-02-12 09:21:02 +1100708 TEST_SSH_SSHPKCS11HELPER="$${TEST_SSH_SSHPKCS11HELPER}" \
Darren Tucker150a81c2003-09-04 13:41:06 +1000709 TEST_SSH_SSHKEYSCAN="$${TEST_SSH_SSHKEYSCAN}" \
710 TEST_SSH_SFTP="$${TEST_SSH_SFTP}" \
Damien Miller48989242019-11-27 16:03:12 +1100711 TEST_SSH_PKCS11_HELPER="$${TEST_SSH_PKCS11_HELPER}" \
712 TEST_SSH_SK_HELPER="$${TEST_SSH_SK_HELPER}" \
Darren Tucker150a81c2003-09-04 13:41:06 +1000713 TEST_SSH_SFTPSERVER="$${TEST_SSH_SFTPSERVER}" \
Damien Millerc2cefb02008-03-13 12:41:31 +1100714 TEST_SSH_PLINK="$${TEST_SSH_PLINK}" \
715 TEST_SSH_PUTTYGEN="$${TEST_SSH_PUTTYGEN}" \
Damien Miller42743cb2008-07-05 09:50:23 +1000716 TEST_SSH_CONCH="$${TEST_SSH_CONCH}" \
Tim Ricecce927c2011-01-12 19:06:31 -0800717 TEST_SSH_IPV6="$${TEST_SSH_IPV6}" \
Darren Tucker47b8c992016-12-08 15:48:34 +1100718 TEST_SSH_UTF8="$${TEST_SSH_UTF8}" \
Tim Ricecce927c2011-01-12 19:06:31 -0800719 TEST_SSH_ECC="$${TEST_SSH_ECC}" \
Damien Miller41c8de22014-08-30 16:23:06 +1000720 TEST_SHELL="${TEST_SHELL}" \
Darren Tucker77d07e92003-09-04 22:06:16 +1000721 EXEEXT="$(EXEEXT)" \
Darren Tuckere93ffd12019-07-29 16:04:01 +1000722 $@ && echo all $@ passed
Darren Tucker782390e2003-09-22 10:58:55 +1000723
Darren Tucker4881c372006-02-19 22:50:20 +1100724compat-tests: $(LIBCOMPAT)
725 (cd openbsd-compat/regress && $(MAKE))
726
Darren Tucker782390e2003-09-22 10:58:55 +1000727regressclean:
Darren Tucker25a12342004-08-30 21:33:02 +1000728 if [ -f regress/Makefile ] && [ -r regress/Makefile ]; then \
Darren Tucker782390e2003-09-22 10:58:55 +1000729 (cd regress && $(MAKE) clean) \
730 fi
Tim Rice6f1f7582004-05-30 21:38:51 -0700731
Darren Tucker72c025d2005-01-18 12:05:18 +1100732survey: survey.sh ssh
733 @$(SHELL) ./survey.sh > survey
734 @echo 'The survey results have been placed in the file "survey" in the'
735 @echo 'current directory. Please review the file then send with'
736 @echo '"make send-survey".'
737
738send-survey: survey
739 mail portable-survey@mindrot.org <survey
740
Damien Millerf22019b2011-05-05 13:48:37 +1000741package: $(CONFIGFILES) $(MANPAGES) $(TARGETS)
Tim Rice6f1f7582004-05-30 21:38:51 -0700742 if [ "@MAKE_PACKAGE_SUPPORTED@" = yes ]; then \
743 sh buildpkg.sh; \
744 fi
Darren Tucker79c0e1d2017-12-11 14:38:33 +1100745
746# @DEPEND@