xref: /freebsd/crypto/openssh/Makefile.in (revision 3e5d0784b9b5296bda801add034b057ad68237f7)
1SHELL=@SH@
2
3AUTORECONF=autoreconf
4
5prefix=@prefix@
6exec_prefix=@exec_prefix@
7bindir=@bindir@
8sbindir=@sbindir@
9libexecdir=@libexecdir@
10datadir=@datadir@
11datarootdir=@datarootdir@
12mandir=@mandir@
13mansubdir=@mansubdir@
14sysconfdir=@sysconfdir@
15piddir=@piddir@
16srcdir=@srcdir@
17top_srcdir=@top_srcdir@
18abs_top_srcdir=@abs_top_srcdir@
19abs_top_builddir=@abs_top_builddir@
20
21DESTDIR=
22VPATH=@srcdir@
23SSH_PROGRAM=@bindir@/ssh
24ASKPASS_PROGRAM=$(libexecdir)/ssh-askpass
25SFTP_SERVER=$(libexecdir)/sftp-server
26SSH_KEYSIGN=$(libexecdir)/ssh-keysign
27SSH_PKCS11_HELPER=$(libexecdir)/ssh-pkcs11-helper
28SSH_SK_HELPER=$(libexecdir)/ssh-sk-helper
29PRIVSEP_PATH=@PRIVSEP_PATH@
30SSH_PRIVSEP_USER=@SSH_PRIVSEP_USER@
31STRIP_OPT=@STRIP_OPT@
32TEST_SHELL=@TEST_SHELL@
33BUILDDIR=@abs_top_builddir@
34
35PATHS= -DSSHDIR=\"$(sysconfdir)\" \
36	-D_PATH_SSH_PROGRAM=\"$(SSH_PROGRAM)\" \
37	-D_PATH_SSH_ASKPASS_DEFAULT=\"$(ASKPASS_PROGRAM)\" \
38	-D_PATH_SFTP_SERVER=\"$(SFTP_SERVER)\" \
39	-D_PATH_SSH_KEY_SIGN=\"$(SSH_KEYSIGN)\" \
40	-D_PATH_SSH_PKCS11_HELPER=\"$(SSH_PKCS11_HELPER)\" \
41	-D_PATH_SSH_SK_HELPER=\"$(SSH_SK_HELPER)\" \
42	-D_PATH_SSH_PIDDIR=\"$(piddir)\" \
43	-D_PATH_PRIVSEP_CHROOT_DIR=\"$(PRIVSEP_PATH)\"
44
45CC=@CC@
46LD=@LD@
47CFLAGS=@CFLAGS@
48CFLAGS_NOPIE=@CFLAGS_NOPIE@
49CPPFLAGS=-I. -I$(srcdir) @CPPFLAGS@ $(PATHS) @DEFS@
50PICFLAG=@PICFLAG@
51LIBS=@LIBS@
52CHANNELLIBS=@CHANNELLIBS@
53K5LIBS=@K5LIBS@
54GSSLIBS=@GSSLIBS@
55SSHDLIBS=@SSHDLIBS@
56LIBEDIT=@LIBEDIT@
57LIBFIDO2=@LIBFIDO2@
58AR=@AR@
59AWK=@AWK@
60RANLIB=@RANLIB@
61INSTALL=@INSTALL@
62SED=@SED@
63XAUTH_PATH=@XAUTH_PATH@
64LDFLAGS=-L. -Lopenbsd-compat/ @LDFLAGS@
65LDFLAGS_NOPIE=-L. -Lopenbsd-compat/ @LDFLAGS_NOPIE@
66EXEEXT=@EXEEXT@
67MANFMT=@MANFMT@
68MKDIR_P=@MKDIR_P@
69
70.SUFFIXES: .lo
71
72TARGETS=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)
73
74XMSS_OBJS=\
75	ssh-xmss.o \
76	sshkey-xmss.o \
77	xmss_commons.o \
78	xmss_fast.o \
79	xmss_hash.o \
80	xmss_hash_address.o \
81	xmss_wots.o
82
83LIBOPENSSH_OBJS=\
84	ssh_api.o \
85	ssherr.o \
86	sshbuf.o \
87	sshkey.o \
88	sshbuf-getput-basic.o \
89	sshbuf-misc.o \
90	sshbuf-getput-crypto.o \
91	krl.o \
92	bitmap.o \
93	${XMSS_OBJS}
94
95LIBSSH_OBJS=${LIBOPENSSH_OBJS} \
96	authfd.o authfile.o \
97	canohost.o channels.o cipher.o cipher-aes.o cipher-aesctr.o \
98	cleanup.o \
99	compat.o fatal.o hostfile.o \
100	log.o match.o moduli.o nchan.o packet.o \
101	readpass.o ttymodes.o xmalloc.o addr.o addrmatch.o \
102	atomicio.o dispatch.o mac.o misc.o utf8.o \
103	monitor_fdpass.o rijndael.o ssh-dss.o ssh-ecdsa.o ssh-ecdsa-sk.o \
104	ssh-ed25519-sk.o ssh-rsa.o dh.o \
105	msg.o progressmeter.o dns.o entropy.o gss-genr.o umac.o umac128.o \
106	ssh-pkcs11.o smult_curve25519_ref.o \
107	poly1305.o chacha.o cipher-chachapoly.o cipher-chachapoly-libcrypto.o \
108	ssh-ed25519.o digest-openssl.o digest-libc.o \
109	hmac.o ed25519.o hash.o \
110	kex.o kexdh.o kexgex.o kexecdh.o kexc25519.o \
111	kexgexc.o kexgexs.o \
112	kexsntrup761x25519.o sntrup761.o kexgen.o \
113	sftp-realpath.o platform-pledge.o platform-tracing.o platform-misc.o \
114	sshbuf-io.o
115
116SKOBJS=	ssh-sk-client.o
117
118SSHOBJS= ssh.o readconf.o clientloop.o sshtty.o \
119	sshconnect.o sshconnect2.o mux.o $(SKOBJS)
120
121SSHDOBJS=sshd.o auth-rhosts.o auth-passwd.o \
122	audit.o audit-bsm.o audit-linux.o platform.o \
123	sshpty.o sshlogin.o servconf.o serverloop.o \
124	auth.o auth2.o auth-options.o session.o \
125	auth2-chall.o groupaccess.o \
126	auth-bsdauth.o auth2-hostbased.o auth2-kbdint.o \
127	auth2-none.o auth2-passwd.o auth2-pubkey.o auth2-pubkeyfile.o \
128	monitor.o monitor_wrap.o auth-krb5.o \
129	auth2-gss.o gss-serv.o gss-serv-krb5.o \
130	loginrec.o auth-pam.o auth-shadow.o auth-sia.o \
131	srclimit.o sftp-server.o sftp-common.o \
132	sandbox-null.o sandbox-rlimit.o sandbox-systrace.o sandbox-darwin.o \
133	sandbox-seccomp-filter.o sandbox-capsicum.o sandbox-pledge.o \
134	sandbox-solaris.o uidswap.o $(SKOBJS)
135
136SFTP_CLIENT_OBJS=sftp-common.o sftp-client.o sftp-glob.o
137
138SCP_OBJS=	scp.o progressmeter.o $(SFTP_CLIENT_OBJS)
139
140SSHADD_OBJS=	ssh-add.o $(SKOBJS)
141
142SSHAGENT_OBJS=	ssh-agent.o ssh-pkcs11-client.o $(SKOBJS)
143
144SSHKEYGEN_OBJS=	ssh-keygen.o sshsig.o $(SKOBJS)
145
146SSHKEYSIGN_OBJS=ssh-keysign.o readconf.o uidswap.o $(SKOBJS)
147
148P11HELPER_OBJS=	ssh-pkcs11-helper.o ssh-pkcs11.o $(SKOBJS)
149
150SKHELPER_OBJS=	ssh-sk-helper.o ssh-sk.o sk-usbhid.o
151
152SSHKEYSCAN_OBJS=ssh-keyscan.o $(SKOBJS)
153
154SFTPSERVER_OBJS=sftp-common.o sftp-server.o sftp-server-main.o
155
156SFTP_OBJS=	sftp.o sftp-usergroup.o progressmeter.o $(SFTP_CLIENT_OBJS)
157
158MANPAGES	= 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
159MANPAGES_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
160MANTYPE		= @MANTYPE@
161
162CONFIGFILES=sshd_config.out ssh_config.out moduli.out
163CONFIGFILES_IN=sshd_config ssh_config moduli
164
165PATHSUBS	= \
166	-e 's|/etc/ssh/ssh_config|$(sysconfdir)/ssh_config|g' \
167	-e 's|/etc/ssh/ssh_known_hosts|$(sysconfdir)/ssh_known_hosts|g' \
168	-e 's|/etc/ssh/sshd_config|$(sysconfdir)/sshd_config|g' \
169	-e 's|/usr/libexec|$(libexecdir)|g' \
170	-e 's|/etc/shosts.equiv|$(sysconfdir)/shosts.equiv|g' \
171	-e 's|/etc/ssh/ssh_host_key|$(sysconfdir)/ssh_host_key|g' \
172	-e 's|/etc/ssh/ssh_host_ecdsa_key|$(sysconfdir)/ssh_host_ecdsa_key|g' \
173	-e 's|/etc/ssh/ssh_host_dsa_key|$(sysconfdir)/ssh_host_dsa_key|g' \
174	-e 's|/etc/ssh/ssh_host_rsa_key|$(sysconfdir)/ssh_host_rsa_key|g' \
175	-e 's|/etc/ssh/ssh_host_ed25519_key|$(sysconfdir)/ssh_host_ed25519_key|g' \
176	-e 's|/var/run/sshd.pid|$(piddir)/sshd.pid|g' \
177	-e 's|/etc/moduli|$(sysconfdir)/moduli|g' \
178	-e 's|/etc/ssh/moduli|$(sysconfdir)/moduli|g' \
179	-e 's|/etc/ssh/sshrc|$(sysconfdir)/sshrc|g' \
180	-e 's|/usr/X11R6/bin/xauth|$(XAUTH_PATH)|g' \
181	-e 's|/var/empty|$(PRIVSEP_PATH)|g' \
182	-e 's|/usr/bin:/bin:/usr/sbin:/sbin|@user_path@|g'
183
184FIXPATHSCMD	= $(SED) $(PATHSUBS)
185FIXALGORITHMSCMD= $(SHELL) $(srcdir)/fixalgorithms $(SED) \
186		     @UNSUPPORTED_ALGORITHMS@
187
188all: $(CONFIGFILES) $(MANPAGES) $(TARGETS)
189
190$(LIBSSH_OBJS): Makefile.in config.h
191$(SSHOBJS): Makefile.in config.h
192$(SSHDOBJS): Makefile.in config.h
193
194.c.o:
195	$(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@
196
197LIBCOMPAT=openbsd-compat/libopenbsd-compat.a
198$(LIBCOMPAT): always
199	(cd openbsd-compat && $(MAKE))
200always:
201
202libssh.a: $(LIBSSH_OBJS)
203	$(AR) rv $@ $(LIBSSH_OBJS)
204	$(RANLIB) $@
205
206ssh$(EXEEXT): $(LIBCOMPAT) libssh.a $(SSHOBJS)
207	$(LD) -o $@ $(SSHOBJS) $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS) $(GSSLIBS) $(CHANNELLIBS)
208
209sshd$(EXEEXT): libssh.a	$(LIBCOMPAT) $(SSHDOBJS)
210	$(LD) -o $@ $(SSHDOBJS) $(LDFLAGS) -lssh -lopenbsd-compat $(SSHDLIBS) $(LIBS) $(GSSLIBS) $(K5LIBS) $(CHANNELLIBS)
211
212scp$(EXEEXT): $(LIBCOMPAT) libssh.a $(SCP_OBJS)
213	$(LD) -o $@ $(SCP_OBJS) $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS)
214
215ssh-add$(EXEEXT): $(LIBCOMPAT) libssh.a $(SSHADD_OBJS)
216	$(LD) -o $@ $(SSHADD_OBJS) $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS) $(CHANNELLIBS)
217
218ssh-agent$(EXEEXT): $(LIBCOMPAT) libssh.a $(SSHAGENT_OBJS)
219	$(LD) -o $@ $(SSHAGENT_OBJS) $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS) $(CHANNELLIBS)
220
221ssh-keygen$(EXEEXT): $(LIBCOMPAT) libssh.a $(SSHKEYGEN_OBJS)
222	$(LD) -o $@ $(SSHKEYGEN_OBJS) $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS) $(CHANNELLIBS)
223
224ssh-keysign$(EXEEXT): $(LIBCOMPAT) libssh.a $(SSHKEYSIGN_OBJS)
225	$(LD) -o $@ $(SSHKEYSIGN_OBJS) $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS) $(CHANNELLIBS)
226
227ssh-pkcs11-helper$(EXEEXT): $(LIBCOMPAT) libssh.a $(P11HELPER_OBJS)
228	$(LD) -o $@ $(P11HELPER_OBJS) $(LDFLAGS) -lssh -lopenbsd-compat -lssh -lopenbsd-compat $(LIBS) $(CHANNELLIBS)
229
230ssh-sk-helper$(EXEEXT): $(LIBCOMPAT) libssh.a $(SKHELPER_OBJS)
231	$(LD) -o $@ $(SKHELPER_OBJS) $(LDFLAGS) -lssh -lopenbsd-compat -lssh -lopenbsd-compat $(LIBS) $(LIBFIDO2) $(CHANNELLIBS)
232
233ssh-keyscan$(EXEEXT): $(LIBCOMPAT) libssh.a $(SSHKEYSCAN_OBJS)
234	$(LD) -o $@ $(SSHKEYSCAN_OBJS) $(LDFLAGS) -lssh -lopenbsd-compat -lssh $(LIBS) $(CHANNELLIBS)
235
236sftp-server$(EXEEXT): $(LIBCOMPAT) libssh.a $(SFTPSERVER_OBJS)
237	$(LD) -o $@ $(SFTPSERVER_OBJS) $(LDFLAGS) -lssh -lopenbsd-compat -lssh $(LIBS)
238
239sftp$(EXEEXT): $(LIBCOMPAT) libssh.a $(SFTP_OBJS)
240	$(LD) -o $@ $(SFTP_OBJS) $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS) $(LIBEDIT)
241
242# test driver for the loginrec code - not built by default
243logintest: logintest.o $(LIBCOMPAT) libssh.a loginrec.o
244	$(LD) -o $@ logintest.o $(LDFLAGS) loginrec.o -lopenbsd-compat -lssh $(LIBS)
245
246$(MANPAGES): $(MANPAGES_IN)
247	if test "$(MANTYPE)" = "cat"; then \
248		manpage=$(srcdir)/`echo $@ | sed 's/\.[1-9]\.out$$/\.0/'`; \
249	else \
250		manpage=$(srcdir)/`echo $@ | sed 's/\.out$$//'`; \
251	fi; \
252	if test "$(MANTYPE)" = "man"; then \
253		$(FIXPATHSCMD) $${manpage} | $(FIXALGORITHMSCMD) | \
254		    $(AWK) -f $(srcdir)/mdoc2man.awk > $@; \
255	else \
256		$(FIXPATHSCMD) $${manpage} | $(FIXALGORITHMSCMD) > $@; \
257	fi
258
259$(CONFIGFILES): $(CONFIGFILES_IN)
260	conffile=`echo $@ | sed 's/.out$$//'`; \
261	$(FIXPATHSCMD) $(srcdir)/$${conffile} > $@
262
263# fake rule to stop make trying to compile moduli.o into a binary "moduli.o"
264moduli:
265	echo
266
267clean:	regressclean
268	rm -f *.o *.lo *.a $(TARGETS) logintest config.cache config.log
269	rm -f *.out core survey
270	rm -f regress/check-perm$(EXEEXT)
271	rm -f regress/mkdtemp$(EXEEXT)
272	rm -f regress/unittests/test_helper/*.a
273	rm -f regress/unittests/test_helper/*.o
274	rm -f regress/unittests/authopt/*.o
275	rm -f regress/unittests/authopt/test_authopt$(EXEEXT)
276	rm -f regress/unittests/bitmap/*.o
277	rm -f regress/unittests/bitmap/test_bitmap$(EXEEXT)
278	rm -f regress/unittests/conversion/*.o
279	rm -f regress/unittests/conversion/test_conversion$(EXEEXT)
280	rm -f regress/unittests/hostkeys/*.o
281	rm -f regress/unittests/hostkeys/test_hostkeys$(EXEEXT)
282	rm -f regress/unittests/kex/*.o
283	rm -f regress/unittests/kex/test_kex$(EXEEXT)
284	rm -f regress/unittests/match/*.o
285	rm -f regress/unittests/match/test_match$(EXEEXT)
286	rm -f regress/unittests/misc/*.o
287	rm -f regress/unittests/misc/test_misc$(EXEEXT)
288	rm -f regress/unittests/sshbuf/*.o
289	rm -f regress/unittests/sshbuf/test_sshbuf$(EXEEXT)
290	rm -f regress/unittests/sshkey/*.o
291	rm -f regress/unittests/sshkey/test_sshkey$(EXEEXT)
292	rm -f regress/unittests/sshsig/*.o
293	rm -f regress/unittests/sshsig/test_sshsig$(EXEEXT)
294	rm -f regress/unittests/utf8/*.o
295	rm -f regress/unittests/utf8/test_utf8$(EXEEXT)
296	rm -f regress/misc/sk-dummy/*.o
297	rm -f regress/misc/sk-dummy/*.lo
298	rm -f regress/misc/sk-dummy/sk-dummy.so
299	(cd openbsd-compat && $(MAKE) clean)
300
301distclean:	regressclean
302	rm -f *.o *.a $(TARGETS) logintest config.cache config.log
303	rm -f *.out core opensshd.init openssh.xml
304	rm -f Makefile buildpkg.sh config.h config.status
305	rm -f survey.sh openbsd-compat/regress/Makefile *~
306	rm -rf autom4te.cache
307	rm -f regress/check-perm
308	rm -f regress/mkdtemp
309	rm -f regress/unittests/test_helper/*.a
310	rm -f regress/unittests/test_helper/*.o
311	rm -f regress/unittests/authopt/*.o
312	rm -f regress/unittests/authopt/test_authopt
313	rm -f regress/unittests/bitmap/*.o
314	rm -f regress/unittests/bitmap/test_bitmap
315	rm -f regress/unittests/conversion/*.o
316	rm -f regress/unittests/conversion/test_conversion
317	rm -f regress/unittests/hostkeys/*.o
318	rm -f regress/unittests/hostkeys/test_hostkeys
319	rm -f regress/unittests/kex/*.o
320	rm -f regress/unittests/kex/test_kex
321	rm -f regress/unittests/match/*.o
322	rm -f regress/unittests/match/test_match
323	rm -f regress/unittests/misc/*.o
324	rm -f regress/unittests/misc/test_misc
325	rm -f regress/unittests/sshbuf/*.o
326	rm -f regress/unittests/sshbuf/test_sshbuf
327	rm -f regress/unittests/sshkey/*.o
328	rm -f regress/unittests/sshkey/test_sshkey
329	rm -f regress/unittests/sshsig/*.o
330	rm -f regress/unittests/sshsig/test_sshsig
331	rm -f regress/unittests/utf8/*.o
332	rm -f regress/unittests/utf8/test_utf8
333	rm -f regress/misc/sk-dummy/*.o
334	rm -f regress/misc/sk-dummy/*.lo
335	rm -f regress/misc/sk-dummy/sk-dummy.so
336	(cd openbsd-compat && $(MAKE) distclean)
337	if test -d pkg ; then \
338		rm -fr pkg ; \
339	fi
340
341veryclean: distclean
342	rm -f configure config.h.in *.0
343
344cleandir: veryclean
345
346mrproper: veryclean
347
348realclean: veryclean
349
350catman-do:
351	@for f in $(MANPAGES_IN) ; do \
352		base=`echo $$f | sed 's/\..*$$//'` ; \
353		echo "$$f -> $$base.0" ; \
354		$(MANFMT) $$f | cat -v | sed -e 's/.\^H//g' \
355			>$$base.0 ; \
356	done
357
358depend: depend-rebuild
359	rm -f .depend.bak
360
361depend-rebuild:
362	mv .depend .depend.old
363	rm -f config.h .depend
364	touch config.h .depend
365	makedepend -w1000 -Y. -f .depend *.c 2>/dev/null
366	(echo '# Automatically generated by makedepend.'; \
367	 echo '# Run "make depend" to rebuild.'; sort .depend ) >.depend.tmp
368	mv .depend.tmp .depend
369	rm -f .depend.bak
370	mv .depend.old .depend.bak
371	rm -f config.h
372
373depend-check: depend-rebuild
374	cmp .depend .depend.bak || (echo .depend stale && exit 1)
375
376distprep: catman-do depend-check
377	$(AUTORECONF)
378	-rm -rf autom4te.cache .depend.bak
379
380install: $(CONFIGFILES) $(MANPAGES) $(TARGETS) install-files install-sysconf host-key check-config
381install-nokeys: $(CONFIGFILES) $(MANPAGES) $(TARGETS) install-files install-sysconf
382install-nosysconf: $(CONFIGFILES) $(MANPAGES) $(TARGETS) install-files
383
384check-config:
385	-$(DESTDIR)$(sbindir)/sshd -t -f $(DESTDIR)$(sysconfdir)/sshd_config
386
387install-files:
388	$(MKDIR_P) $(DESTDIR)$(bindir)
389	$(MKDIR_P) $(DESTDIR)$(sbindir)
390	$(MKDIR_P) $(DESTDIR)$(mandir)/$(mansubdir)1
391	$(MKDIR_P) $(DESTDIR)$(mandir)/$(mansubdir)5
392	$(MKDIR_P) $(DESTDIR)$(mandir)/$(mansubdir)8
393	$(MKDIR_P) $(DESTDIR)$(libexecdir)
394	$(MKDIR_P) -m 0755 $(DESTDIR)$(PRIVSEP_PATH)
395	$(INSTALL) -m 0755 $(STRIP_OPT) ssh$(EXEEXT) $(DESTDIR)$(bindir)/ssh$(EXEEXT)
396	$(INSTALL) -m 0755 $(STRIP_OPT) scp$(EXEEXT) $(DESTDIR)$(bindir)/scp$(EXEEXT)
397	$(INSTALL) -m 0755 $(STRIP_OPT) ssh-add$(EXEEXT) $(DESTDIR)$(bindir)/ssh-add$(EXEEXT)
398	$(INSTALL) -m 0755 $(STRIP_OPT) ssh-agent$(EXEEXT) $(DESTDIR)$(bindir)/ssh-agent$(EXEEXT)
399	$(INSTALL) -m 0755 $(STRIP_OPT) ssh-keygen$(EXEEXT) $(DESTDIR)$(bindir)/ssh-keygen$(EXEEXT)
400	$(INSTALL) -m 0755 $(STRIP_OPT) ssh-keyscan$(EXEEXT) $(DESTDIR)$(bindir)/ssh-keyscan$(EXEEXT)
401	$(INSTALL) -m 0755 $(STRIP_OPT) sshd$(EXEEXT) $(DESTDIR)$(sbindir)/sshd$(EXEEXT)
402	$(INSTALL) -m 4711 $(STRIP_OPT) ssh-keysign$(EXEEXT) $(DESTDIR)$(SSH_KEYSIGN)$(EXEEXT)
403	$(INSTALL) -m 0755 $(STRIP_OPT) ssh-pkcs11-helper$(EXEEXT) $(DESTDIR)$(SSH_PKCS11_HELPER)$(EXEEXT)
404	$(INSTALL) -m 0755 $(STRIP_OPT) ssh-sk-helper$(EXEEXT) $(DESTDIR)$(SSH_SK_HELPER)$(EXEEXT)
405	$(INSTALL) -m 0755 $(STRIP_OPT) sftp$(EXEEXT) $(DESTDIR)$(bindir)/sftp$(EXEEXT)
406	$(INSTALL) -m 0755 $(STRIP_OPT) sftp-server$(EXEEXT) $(DESTDIR)$(SFTP_SERVER)$(EXEEXT)
407	$(INSTALL) -m 644 ssh.1.out $(DESTDIR)$(mandir)/$(mansubdir)1/ssh.1
408	$(INSTALL) -m 644 scp.1.out $(DESTDIR)$(mandir)/$(mansubdir)1/scp.1
409	$(INSTALL) -m 644 ssh-add.1.out $(DESTDIR)$(mandir)/$(mansubdir)1/ssh-add.1
410	$(INSTALL) -m 644 ssh-agent.1.out $(DESTDIR)$(mandir)/$(mansubdir)1/ssh-agent.1
411	$(INSTALL) -m 644 ssh-keygen.1.out $(DESTDIR)$(mandir)/$(mansubdir)1/ssh-keygen.1
412	$(INSTALL) -m 644 ssh-keyscan.1.out $(DESTDIR)$(mandir)/$(mansubdir)1/ssh-keyscan.1
413	$(INSTALL) -m 644 moduli.5.out $(DESTDIR)$(mandir)/$(mansubdir)5/moduli.5
414	$(INSTALL) -m 644 sshd_config.5.out $(DESTDIR)$(mandir)/$(mansubdir)5/sshd_config.5
415	$(INSTALL) -m 644 ssh_config.5.out $(DESTDIR)$(mandir)/$(mansubdir)5/ssh_config.5
416	$(INSTALL) -m 644 sshd.8.out $(DESTDIR)$(mandir)/$(mansubdir)8/sshd.8
417	$(INSTALL) -m 644 sftp.1.out $(DESTDIR)$(mandir)/$(mansubdir)1/sftp.1
418	$(INSTALL) -m 644 sftp-server.8.out $(DESTDIR)$(mandir)/$(mansubdir)8/sftp-server.8
419	$(INSTALL) -m 644 ssh-keysign.8.out $(DESTDIR)$(mandir)/$(mansubdir)8/ssh-keysign.8
420	$(INSTALL) -m 644 ssh-pkcs11-helper.8.out $(DESTDIR)$(mandir)/$(mansubdir)8/ssh-pkcs11-helper.8
421	$(INSTALL) -m 644 ssh-sk-helper.8.out $(DESTDIR)$(mandir)/$(mansubdir)8/ssh-sk-helper.8
422
423install-sysconf:
424	$(MKDIR_P) $(DESTDIR)$(sysconfdir)
425	@if [ ! -f $(DESTDIR)$(sysconfdir)/ssh_config ]; then \
426		$(INSTALL) -m 644 ssh_config.out $(DESTDIR)$(sysconfdir)/ssh_config; \
427	else \
428		echo "$(DESTDIR)$(sysconfdir)/ssh_config already exists, install will not overwrite"; \
429	fi
430	@if [ ! -f $(DESTDIR)$(sysconfdir)/sshd_config ]; then \
431		$(INSTALL) -m 644 sshd_config.out $(DESTDIR)$(sysconfdir)/sshd_config; \
432	else \
433		echo "$(DESTDIR)$(sysconfdir)/sshd_config already exists, install will not overwrite"; \
434	fi
435	@if [ ! -f $(DESTDIR)$(sysconfdir)/moduli ]; then \
436		if [ -f $(DESTDIR)$(sysconfdir)/primes ]; then \
437			echo "moving $(DESTDIR)$(sysconfdir)/primes to $(DESTDIR)$(sysconfdir)/moduli"; \
438			mv "$(DESTDIR)$(sysconfdir)/primes" "$(DESTDIR)$(sysconfdir)/moduli"; \
439		else \
440			$(INSTALL) -m 644 moduli.out $(DESTDIR)$(sysconfdir)/moduli; \
441		fi ; \
442	else \
443		echo "$(DESTDIR)$(sysconfdir)/moduli already exists, install will not overwrite"; \
444	fi
445
446host-key: ssh-keygen$(EXEEXT)
447	@if [ -z "$(DESTDIR)" ] ; then \
448		./ssh-keygen -A; \
449	fi
450
451host-key-force: ssh-keygen$(EXEEXT) ssh$(EXEEXT)
452	./ssh-keygen -t dsa -f $(DESTDIR)$(sysconfdir)/ssh_host_dsa_key -N ""
453	./ssh-keygen -t rsa -f $(DESTDIR)$(sysconfdir)/ssh_host_rsa_key -N ""
454	./ssh-keygen -t ed25519 -f $(DESTDIR)$(sysconfdir)/ssh_host_ed25519_key -N ""
455	if ./ssh -Q key | grep ecdsa >/dev/null ; then \
456		./ssh-keygen -t ecdsa -f $(DESTDIR)$(sysconfdir)/ssh_host_ecdsa_key -N ""; \
457	fi
458
459uninstallall:	uninstall
460	-rm -f $(DESTDIR)$(sysconfdir)/ssh_config
461	-rm -f $(DESTDIR)$(sysconfdir)/sshd_config
462	-rmdir $(DESTDIR)$(sysconfdir)
463	-rmdir $(DESTDIR)$(bindir)
464	-rmdir $(DESTDIR)$(sbindir)
465	-rmdir $(DESTDIR)$(mandir)/$(mansubdir)1
466	-rmdir $(DESTDIR)$(mandir)/$(mansubdir)8
467	-rmdir $(DESTDIR)$(mandir)
468	-rmdir $(DESTDIR)$(libexecdir)
469
470uninstall:
471	-rm -f $(DESTDIR)$(bindir)/ssh$(EXEEXT)
472	-rm -f $(DESTDIR)$(bindir)/scp$(EXEEXT)
473	-rm -f $(DESTDIR)$(bindir)/ssh-add$(EXEEXT)
474	-rm -f $(DESTDIR)$(bindir)/ssh-agent$(EXEEXT)
475	-rm -f $(DESTDIR)$(bindir)/ssh-keygen$(EXEEXT)
476	-rm -f $(DESTDIR)$(bindir)/ssh-keyscan$(EXEEXT)
477	-rm -f $(DESTDIR)$(bindir)/sftp$(EXEEXT)
478	-rm -f $(DESTDIR)$(sbindir)/sshd$(EXEEXT)
479	-rm -r $(DESTDIR)$(SFTP_SERVER)$(EXEEXT)
480	-rm -f $(DESTDIR)$(SSH_KEYSIGN)$(EXEEXT)
481	-rm -f $(DESTDIR)$(SSH_PKCS11_HELPER)$(EXEEXT)
482	-rm -f $(DESTDIR)$(SSH_SK_HELPER)$(EXEEXT)
483	-rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/ssh.1
484	-rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/scp.1
485	-rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/ssh-add.1
486	-rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/ssh-agent.1
487	-rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/ssh-keygen.1
488	-rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/sftp.1
489	-rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/ssh-keyscan.1
490	-rm -f $(DESTDIR)$(mandir)/$(mansubdir)8/sshd.8
491	-rm -f $(DESTDIR)$(mandir)/$(mansubdir)8/sftp-server.8
492	-rm -f $(DESTDIR)$(mandir)/$(mansubdir)8/ssh-keysign.8
493	-rm -f $(DESTDIR)$(mandir)/$(mansubdir)8/ssh-pkcs11-helper.8
494	-rm -f $(DESTDIR)$(mandir)/$(mansubdir)8/ssh-sk-helper.8
495
496regress-prep:
497	$(MKDIR_P) `pwd`/regress/unittests/test_helper
498	$(MKDIR_P) `pwd`/regress/unittests/authopt
499	$(MKDIR_P) `pwd`/regress/unittests/bitmap
500	$(MKDIR_P) `pwd`/regress/unittests/conversion
501	$(MKDIR_P) `pwd`/regress/unittests/hostkeys
502	$(MKDIR_P) `pwd`/regress/unittests/kex
503	$(MKDIR_P) `pwd`/regress/unittests/match
504	$(MKDIR_P) `pwd`/regress/unittests/misc
505	$(MKDIR_P) `pwd`/regress/unittests/sshbuf
506	$(MKDIR_P) `pwd`/regress/unittests/sshkey
507	$(MKDIR_P) `pwd`/regress/unittests/sshsig
508	$(MKDIR_P) `pwd`/regress/unittests/utf8
509	$(MKDIR_P) `pwd`/regress/misc/sk-dummy
510	[ -f `pwd`/regress/Makefile ] || \
511	    ln -s `cd $(srcdir) && pwd`/regress/Makefile `pwd`/regress/Makefile
512
513REGRESSLIBS=libssh.a $(LIBCOMPAT)
514TESTLIBS=$(LIBS) $(CHANNELLIBS)
515
516regress/modpipe$(EXEEXT): $(srcdir)/regress/modpipe.c $(REGRESSLIBS)
517	$(CC) $(CFLAGS) $(CPPFLAGS) -o $@ $(srcdir)/regress/modpipe.c \
518	$(LDFLAGS) -lssh -lopenbsd-compat -lssh -lopenbsd-compat $(TESTLIBS)
519
520regress/timestamp$(EXEEXT): $(srcdir)/regress/timestamp.c $(REGRESSLIBS)
521	$(CC) $(CFLAGS) $(CPPFLAGS) -o $@ $(srcdir)/regress/timestamp.c \
522	$(LDFLAGS) -lssh -lopenbsd-compat -lssh -lopenbsd-compat $(TESTLIBS)
523
524regress/setuid-allowed$(EXEEXT): $(srcdir)/regress/setuid-allowed.c $(REGRESSLIBS)
525	$(CC) $(CFLAGS) $(CPPFLAGS) -o $@ $(srcdir)/regress/setuid-allowed.c \
526	$(LDFLAGS) -lssh -lopenbsd-compat -lssh -lopenbsd-compat $(TESTLIBS)
527
528regress/netcat$(EXEEXT): $(srcdir)/regress/netcat.c $(REGRESSLIBS)
529	$(CC) $(CFLAGS) $(CPPFLAGS) -o $@ $(srcdir)/regress/netcat.c \
530	$(LDFLAGS) -lssh -lopenbsd-compat -lssh -lopenbsd-compat $(TESTLIBS)
531
532regress/check-perm$(EXEEXT): $(srcdir)/regress/check-perm.c $(REGRESSLIBS)
533	$(CC) $(CFLAGS) $(CPPFLAGS) -o $@ $(srcdir)/regress/check-perm.c \
534	$(LDFLAGS) -lssh -lopenbsd-compat -lssh -lopenbsd-compat $(TESTLIBS)
535
536regress/mkdtemp$(EXEEXT): $(srcdir)/regress/mkdtemp.c $(REGRESSLIBS)
537	$(CC) $(CFLAGS) $(CPPFLAGS) -o $@ $(srcdir)/regress/mkdtemp.c \
538	$(LDFLAGS) -lssh -lopenbsd-compat -lssh -lopenbsd-compat $(TESTLIBS)
539
540UNITTESTS_TEST_HELPER_OBJS=\
541	regress/unittests/test_helper/test_helper.o \
542	regress/unittests/test_helper/fuzz.o
543
544regress/unittests/test_helper/libtest_helper.a: ${UNITTESTS_TEST_HELPER_OBJS}
545	$(AR) rv $@ $(UNITTESTS_TEST_HELPER_OBJS)
546	$(RANLIB) $@
547
548UNITTESTS_TEST_SSHBUF_OBJS=\
549	regress/unittests/sshbuf/tests.o \
550	regress/unittests/sshbuf/test_sshbuf.o \
551	regress/unittests/sshbuf/test_sshbuf_getput_basic.o \
552	regress/unittests/sshbuf/test_sshbuf_getput_crypto.o \
553	regress/unittests/sshbuf/test_sshbuf_misc.o \
554	regress/unittests/sshbuf/test_sshbuf_fuzz.o \
555	regress/unittests/sshbuf/test_sshbuf_getput_fuzz.o \
556	regress/unittests/sshbuf/test_sshbuf_fixed.o
557
558regress/unittests/sshbuf/test_sshbuf$(EXEEXT): ${UNITTESTS_TEST_SSHBUF_OBJS} \
559    regress/unittests/test_helper/libtest_helper.a libssh.a
560	$(LD) -o $@ $(LDFLAGS) $(UNITTESTS_TEST_SSHBUF_OBJS) \
561	    regress/unittests/test_helper/libtest_helper.a \
562	    -lssh -lopenbsd-compat -lssh -lopenbsd-compat $(TESTLIBS)
563
564UNITTESTS_TEST_SSHKEY_OBJS=\
565	regress/unittests/sshkey/test_fuzz.o \
566	regress/unittests/sshkey/tests.o \
567	regress/unittests/sshkey/common.o \
568	regress/unittests/sshkey/test_file.o \
569	regress/unittests/sshkey/test_sshkey.o \
570	$(SKOBJS)
571
572regress/unittests/sshkey/test_sshkey$(EXEEXT): ${UNITTESTS_TEST_SSHKEY_OBJS} \
573    regress/unittests/test_helper/libtest_helper.a libssh.a
574	$(LD) -o $@ $(LDFLAGS) $(UNITTESTS_TEST_SSHKEY_OBJS) \
575	    regress/unittests/test_helper/libtest_helper.a \
576	    -lssh -lopenbsd-compat -lssh -lopenbsd-compat $(TESTLIBS)
577
578UNITTESTS_TEST_SSHSIG_OBJS=\
579	sshsig.o \
580	regress/unittests/sshsig/tests.o \
581	$(SKOBJS)
582
583regress/unittests/sshsig/test_sshsig$(EXEEXT): ${UNITTESTS_TEST_SSHSIG_OBJS} \
584    regress/unittests/test_helper/libtest_helper.a libssh.a
585	$(LD) -o $@ $(LDFLAGS) $(UNITTESTS_TEST_SSHSIG_OBJS) \
586	    regress/unittests/test_helper/libtest_helper.a \
587	    -lssh -lopenbsd-compat -lssh -lopenbsd-compat $(TESTLIBS)
588
589UNITTESTS_TEST_BITMAP_OBJS=\
590	regress/unittests/bitmap/tests.o
591
592regress/unittests/bitmap/test_bitmap$(EXEEXT): ${UNITTESTS_TEST_BITMAP_OBJS} \
593    regress/unittests/test_helper/libtest_helper.a libssh.a
594	$(LD) -o $@ $(LDFLAGS) $(UNITTESTS_TEST_BITMAP_OBJS) \
595	    regress/unittests/test_helper/libtest_helper.a \
596	    -lssh -lopenbsd-compat -lssh -lopenbsd-compat $(TESTLIBS)
597
598UNITTESTS_TEST_AUTHOPT_OBJS=\
599	regress/unittests/authopt/tests.o \
600	auth-options.o \
601	$(SKOBJS)
602
603regress/unittests/authopt/test_authopt$(EXEEXT): \
604    ${UNITTESTS_TEST_AUTHOPT_OBJS} \
605    regress/unittests/test_helper/libtest_helper.a libssh.a
606	$(LD) -o $@ $(LDFLAGS) $(UNITTESTS_TEST_AUTHOPT_OBJS) \
607	    regress/unittests/test_helper/libtest_helper.a \
608	    -lssh -lopenbsd-compat -lssh -lopenbsd-compat $(TESTLIBS)
609
610UNITTESTS_TEST_CONVERSION_OBJS=\
611	regress/unittests/conversion/tests.o
612
613regress/unittests/conversion/test_conversion$(EXEEXT): \
614    ${UNITTESTS_TEST_CONVERSION_OBJS} \
615    regress/unittests/test_helper/libtest_helper.a libssh.a
616	$(LD) -o $@ $(LDFLAGS) $(UNITTESTS_TEST_CONVERSION_OBJS) \
617	    regress/unittests/test_helper/libtest_helper.a \
618	    -lssh -lopenbsd-compat -lssh -lopenbsd-compat $(TESTLIBS)
619
620UNITTESTS_TEST_KEX_OBJS=\
621	regress/unittests/kex/tests.o \
622	regress/unittests/kex/test_kex.o \
623	regress/unittests/kex/test_proposal.o \
624	$(SKOBJS)
625
626regress/unittests/kex/test_kex$(EXEEXT): ${UNITTESTS_TEST_KEX_OBJS} \
627    regress/unittests/test_helper/libtest_helper.a libssh.a
628	$(LD) -o $@ $(LDFLAGS) $(UNITTESTS_TEST_KEX_OBJS) \
629	    regress/unittests/test_helper/libtest_helper.a \
630	    -lssh -lopenbsd-compat -lssh -lopenbsd-compat $(TESTLIBS)
631
632UNITTESTS_TEST_HOSTKEYS_OBJS=\
633	regress/unittests/hostkeys/tests.o \
634	regress/unittests/hostkeys/test_iterate.o \
635	$(SKOBJS)
636
637regress/unittests/hostkeys/test_hostkeys$(EXEEXT): \
638    ${UNITTESTS_TEST_HOSTKEYS_OBJS} \
639    regress/unittests/test_helper/libtest_helper.a libssh.a
640	$(LD) -o $@ $(LDFLAGS) $(UNITTESTS_TEST_HOSTKEYS_OBJS) \
641	    regress/unittests/test_helper/libtest_helper.a \
642	    -lssh -lopenbsd-compat -lssh -lopenbsd-compat $(TESTLIBS)
643
644UNITTESTS_TEST_MATCH_OBJS=\
645	regress/unittests/match/tests.o
646
647regress/unittests/match/test_match$(EXEEXT): \
648    ${UNITTESTS_TEST_MATCH_OBJS} \
649    regress/unittests/test_helper/libtest_helper.a libssh.a
650	$(LD) -o $@ $(LDFLAGS) $(UNITTESTS_TEST_MATCH_OBJS) \
651	    regress/unittests/test_helper/libtest_helper.a \
652	    -lssh -lopenbsd-compat -lssh -lopenbsd-compat $(TESTLIBS)
653
654UNITTESTS_TEST_MISC_OBJS=\
655	regress/unittests/misc/tests.o \
656	regress/unittests/misc/test_parse.o \
657	regress/unittests/misc/test_expand.o \
658	regress/unittests/misc/test_convtime.o \
659	regress/unittests/misc/test_argv.o \
660	regress/unittests/misc/test_strdelim.o \
661	regress/unittests/misc/test_hpdelim.o \
662	regress/unittests/misc/test_ptimeout.o
663
664regress/unittests/misc/test_misc$(EXEEXT): \
665    ${UNITTESTS_TEST_MISC_OBJS} \
666    regress/unittests/test_helper/libtest_helper.a libssh.a
667	$(LD) -o $@ $(LDFLAGS) $(UNITTESTS_TEST_MISC_OBJS) \
668	    regress/unittests/test_helper/libtest_helper.a \
669	    -lssh -lopenbsd-compat -lssh -lopenbsd-compat $(TESTLIBS)
670
671UNITTESTS_TEST_UTF8_OBJS=\
672	regress/unittests/utf8/tests.o
673
674regress/unittests/utf8/test_utf8$(EXEEXT): \
675    ${UNITTESTS_TEST_UTF8_OBJS} \
676    regress/unittests/test_helper/libtest_helper.a libssh.a
677	$(LD) -o $@ $(LDFLAGS) $(UNITTESTS_TEST_UTF8_OBJS) \
678	    regress/unittests/test_helper/libtest_helper.a \
679	    -lssh -lopenbsd-compat -lssh -lopenbsd-compat $(TESTLIBS)
680
681# These all need to be compiled -fPIC, so they are treated differently.
682SK_DUMMY_OBJS=\
683	regress/misc/sk-dummy/sk-dummy.lo \
684	regress/misc/sk-dummy/fatal.lo \
685	ed25519.lo hash.lo
686
687SK_DUMMY_LIBRARY=@SK_DUMMY_LIBRARY@
688
689.c.lo: Makefile.in config.h
690	$(CC) $(CFLAGS_NOPIE) $(PICFLAG) $(CPPFLAGS) -c $< -o $@
691
692regress/misc/sk-dummy/sk-dummy.so: $(SK_DUMMY_OBJS)
693	$(CC) $(CFLAGS) $(CPPFLAGS) $(PICFLAG) -shared -o $@ $(SK_DUMMY_OBJS) \
694	    -L. -Lopenbsd-compat -lopenbsd-compat $(LDFLAGS_NOPIE) $(TESTLIBS)
695
696regress-binaries: regress-prep $(LIBCOMPAT) \
697	regress/modpipe$(EXEEXT) \
698	regress/timestamp$(EXEEXT) \
699	regress/setuid-allowed$(EXEEXT) \
700	regress/netcat$(EXEEXT) \
701	regress/check-perm$(EXEEXT) \
702	regress/mkdtemp$(EXEEXT) \
703	$(SK_DUMMY_LIBRARY)
704
705regress-unit-binaries: regress-prep $(REGRESSLIBS) \
706	regress/unittests/authopt/test_authopt$(EXEEXT) \
707	regress/unittests/bitmap/test_bitmap$(EXEEXT) \
708	regress/unittests/conversion/test_conversion$(EXEEXT) \
709	regress/unittests/hostkeys/test_hostkeys$(EXEEXT) \
710	regress/unittests/kex/test_kex$(EXEEXT) \
711	regress/unittests/match/test_match$(EXEEXT) \
712	regress/unittests/misc/test_misc$(EXEEXT) \
713	regress/unittests/sshbuf/test_sshbuf$(EXEEXT) \
714	regress/unittests/sshkey/test_sshkey$(EXEEXT) \
715	regress/unittests/sshsig/test_sshsig$(EXEEXT) \
716	regress/unittests/utf8/test_utf8$(EXEEXT)
717
718tests:	file-tests t-exec interop-tests unit
719	echo all tests passed
720
721unit: regress-unit-binaries
722	cd $(srcdir)/regress || exit $$?; \
723	$(MAKE) \
724		.CURDIR="$(abs_top_srcdir)/regress" \
725		.OBJDIR="$(BUILDDIR)/regress" \
726		OBJ="$(BUILDDIR)/regress" \
727		$@ && echo $@ tests passed
728
729interop-tests t-exec file-tests: regress-prep regress-binaries $(TARGETS)
730	cd $(srcdir)/regress || exit $$?; \
731	EGREP='@EGREP@' \
732	OPENSSL_BIN='@OPENSSL_BIN@' \
733	$(MAKE) \
734		.CURDIR="$(abs_top_srcdir)/regress" \
735		.OBJDIR="$(BUILDDIR)/regress" \
736		BUILDDIR="$(BUILDDIR)" \
737		OBJ="$(BUILDDIR)/regress" \
738		PATH="$(BUILDDIR):$${PATH}" \
739		TEST_ENV=MALLOC_OPTIONS="@TEST_MALLOC_OPTIONS@" \
740		TEST_MALLOC_OPTIONS="@TEST_MALLOC_OPTIONS@" \
741		TEST_SSH_SCP="$(BUILDDIR)/scp" \
742		TEST_SSH_SSH="$(BUILDDIR)/ssh" \
743		TEST_SSH_SSHD="$(BUILDDIR)/sshd" \
744		TEST_SSH_SSHAGENT="$(BUILDDIR)/ssh-agent" \
745		TEST_SSH_SSHADD="$(BUILDDIR)/ssh-add" \
746		TEST_SSH_SSHKEYGEN="$(BUILDDIR)/ssh-keygen" \
747		TEST_SSH_SSHPKCS11HELPER="$(BUILDDIR)/ssh-pkcs11-helper" \
748		TEST_SSH_SSHKEYSCAN="$(BUILDDIR)/ssh-keyscan" \
749		TEST_SSH_SFTP="$(BUILDDIR)/sftp" \
750		TEST_SSH_PKCS11_HELPER="$(BUILDDIR)/ssh-pkcs11-helper" \
751		TEST_SSH_SK_HELPER="$(BUILDDIR)/ssh-sk-helper" \
752		TEST_SSH_SFTPSERVER="$(BUILDDIR)/sftp-server" \
753		TEST_SSH_MODULI_FILE="$(abs_top_srcdir)/moduli" \
754		TEST_SSH_PLINK="plink" \
755		TEST_SSH_PUTTYGEN="puttygen" \
756		TEST_SSH_CONCH="conch" \
757		TEST_SSH_IPV6="@TEST_SSH_IPV6@" \
758		TEST_SSH_UTF8="@TEST_SSH_UTF8@" \
759		TEST_SHELL="$(TEST_SHELL)" \
760		EXEEXT="$(EXEEXT)" \
761		$@ && echo all $@ passed
762
763compat-tests: $(LIBCOMPAT)
764	(cd openbsd-compat/regress && $(MAKE))
765
766regressclean:
767	if [ -f regress/Makefile ] && [ -r regress/Makefile ]; then \
768		(cd regress && $(MAKE) clean) \
769	fi
770
771survey: survey.sh ssh
772	@$(SHELL) ./survey.sh > survey
773	@echo 'The survey results have been placed in the file "survey" in the'
774	@echo 'current directory.  Please review the file then send with'
775	@echo '"make send-survey".'
776
777send-survey:	survey
778	mail portable-survey@mindrot.org <survey
779
780package: $(CONFIGFILES) $(MANPAGES) $(TARGETS)
781	if [ "@MAKE_PACKAGE_SUPPORTED@" = yes ]; then \
782		sh buildpkg.sh; \
783	fi
784
785# @DEPEND@
786