1# $Id: Makefile.in,v 1.365 2014/08/30 06:23:07 djm Exp $ 2 3# uncomment if you run a non bourne compatable shell. Ie. csh 4#SHELL = @SH@ 5 6AUTORECONF=autoreconf 7 8prefix=@prefix@ 9exec_prefix=@exec_prefix@ 10bindir=@bindir@ 11sbindir=@sbindir@ 12libexecdir=@libexecdir@ 13datadir=@datadir@ 14datarootdir=@datarootdir@ 15mandir=@mandir@ 16mansubdir=@mansubdir@ 17sysconfdir=@sysconfdir@ 18piddir=@piddir@ 19srcdir=@srcdir@ 20top_srcdir=@top_srcdir@ 21 22DESTDIR= 23VPATH=@srcdir@ 24SSH_PROGRAM=@bindir@/ssh 25ASKPASS_PROGRAM=$(libexecdir)/ssh-askpass 26SFTP_SERVER=$(libexecdir)/sftp-server 27SSH_KEYSIGN=$(libexecdir)/ssh-keysign 28SSH_PKCS11_HELPER=$(libexecdir)/ssh-pkcs11-helper 29PRIVSEP_PATH=@PRIVSEP_PATH@ 30SSH_PRIVSEP_USER=@SSH_PRIVSEP_USER@ 31STRIP_OPT=@STRIP_OPT@ 32TEST_SHELL=@TEST_SHELL@ 33 34PATHS= -DSSHDIR=\"$(sysconfdir)\" \ 35 -D_PATH_SSH_PROGRAM=\"$(SSH_PROGRAM)\" \ 36 -D_PATH_SSH_ASKPASS_DEFAULT=\"$(ASKPASS_PROGRAM)\" \ 37 -D_PATH_SFTP_SERVER=\"$(SFTP_SERVER)\" \ 38 -D_PATH_SSH_KEY_SIGN=\"$(SSH_KEYSIGN)\" \ 39 -D_PATH_SSH_PKCS11_HELPER=\"$(SSH_PKCS11_HELPER)\" \ 40 -D_PATH_SSH_PIDDIR=\"$(piddir)\" \ 41 -D_PATH_PRIVSEP_CHROOT_DIR=\"$(PRIVSEP_PATH)\" 42 43CC=@CC@ 44LD=@LD@ 45CFLAGS=@CFLAGS@ 46CPPFLAGS=-I. -I$(srcdir) @CPPFLAGS@ $(PATHS) @DEFS@ 47LIBS=@LIBS@ 48K5LIBS=@K5LIBS@ 49GSSLIBS=@GSSLIBS@ 50SSHLIBS=@SSHLIBS@ 51SSHDLIBS=@SSHDLIBS@ 52LIBEDIT=@LIBEDIT@ 53AR=@AR@ 54AWK=@AWK@ 55RANLIB=@RANLIB@ 56INSTALL=@INSTALL@ 57PERL=@PERL@ 58SED=@SED@ 59ENT=@ENT@ 60XAUTH_PATH=@XAUTH_PATH@ 61LDFLAGS=-L. -Lopenbsd-compat/ @LDFLAGS@ 62EXEEXT=@EXEEXT@ 63MANFMT=@MANFMT@ 64 65TARGETS=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) 66 67LIBOPENSSH_OBJS=\ 68 ssh_api.o \ 69 ssherr.o \ 70 sshbuf.o \ 71 sshkey.o \ 72 sshbuf-getput-basic.o \ 73 sshbuf-misc.o \ 74 sshbuf-getput-crypto.o \ 75 krl.o \ 76 bitmap.o 77 78LIBSSH_OBJS=${LIBOPENSSH_OBJS} \ 79 authfd.o authfile.o bufaux.o bufbn.o bufec.o buffer.o \ 80 canohost.o channels.o cipher.o cipher-aes.o cipher-aesctr.o \ 81 cipher-bf1.o cipher-ctr.o cipher-3des1.o cleanup.o \ 82 compat.o crc32.o deattack.o fatal.o hostfile.o \ 83 log.o match.o md-sha256.o moduli.o nchan.o packet.o opacket.o \ 84 readpass.o rsa.o ttymodes.o xmalloc.o addrmatch.o \ 85 atomicio.o key.o dispatch.o mac.o uidswap.o uuencode.o misc.o \ 86 monitor_fdpass.o rijndael.o ssh-dss.o ssh-ecdsa.o ssh-rsa.o dh.o \ 87 msg.o progressmeter.o dns.o entropy.o gss-genr.o umac.o umac128.o \ 88 ssh-pkcs11.o smult_curve25519_ref.o \ 89 poly1305.o chacha.o cipher-chachapoly.o \ 90 ssh-ed25519.o digest-openssl.o digest-libc.o hmac.o \ 91 sc25519.o ge25519.o fe25519.o ed25519.o verify.o hash.o blocks.o \ 92 kex.o kexdh.o kexgex.o kexecdh.o kexc25519.o \ 93 kexdhc.o kexgexc.o kexecdhc.o kexc25519c.o \ 94 kexdhs.o kexgexs.o kexecdhs.o kexc25519s.o 95 96SSHOBJS= ssh.o readconf.o clientloop.o sshtty.o \ 97 sshconnect.o sshconnect1.o sshconnect2.o mux.o \ 98 roaming_common.o roaming_client.o 99 100SSHDOBJS=sshd.o auth-rhosts.o auth-passwd.o auth-rsa.o auth-rh-rsa.o \ 101 audit.o audit-bsm.o audit-linux.o platform.o \ 102 sshpty.o sshlogin.o servconf.o serverloop.o \ 103 auth.o auth1.o auth2.o auth-options.o session.o \ 104 auth-chall.o auth2-chall.o groupaccess.o \ 105 auth-skey.o auth-bsdauth.o auth2-hostbased.o auth2-kbdint.o \ 106 auth2-none.o auth2-passwd.o auth2-pubkey.o \ 107 monitor_mm.o monitor.o monitor_wrap.o auth-krb5.o \ 108 auth2-gss.o gss-serv.o gss-serv-krb5.o \ 109 loginrec.o auth-pam.o auth-shadow.o auth-sia.o md5crypt.o \ 110 sftp-server.o sftp-common.o \ 111 roaming_common.o roaming_serv.o \ 112 sandbox-null.o sandbox-rlimit.o sandbox-systrace.o sandbox-darwin.o \ 113 sandbox-seccomp-filter.o sandbox-capsicum.o 114 115MANPAGES = 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 sshd_config.5.out ssh_config.5.out 116MANPAGES_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 sshd_config.5 ssh_config.5 117MANTYPE = @MANTYPE@ 118 119CONFIGFILES=sshd_config.out ssh_config.out moduli.out 120CONFIGFILES_IN=sshd_config ssh_config moduli 121 122PATHSUBS = \ 123 -e 's|/etc/ssh/ssh_config|$(sysconfdir)/ssh_config|g' \ 124 -e 's|/etc/ssh/ssh_known_hosts|$(sysconfdir)/ssh_known_hosts|g' \ 125 -e 's|/etc/ssh/sshd_config|$(sysconfdir)/sshd_config|g' \ 126 -e 's|/usr/libexec|$(libexecdir)|g' \ 127 -e 's|/etc/shosts.equiv|$(sysconfdir)/shosts.equiv|g' \ 128 -e 's|/etc/ssh/ssh_host_key|$(sysconfdir)/ssh_host_key|g' \ 129 -e 's|/etc/ssh/ssh_host_ecdsa_key|$(sysconfdir)/ssh_host_ecdsa_key|g' \ 130 -e 's|/etc/ssh/ssh_host_dsa_key|$(sysconfdir)/ssh_host_dsa_key|g' \ 131 -e 's|/etc/ssh/ssh_host_rsa_key|$(sysconfdir)/ssh_host_rsa_key|g' \ 132 -e 's|/etc/ssh/ssh_host_ed25519_key|$(sysconfdir)/ssh_host_ed25519_key|g' \ 133 -e 's|/var/run/sshd.pid|$(piddir)/sshd.pid|g' \ 134 -e 's|/etc/moduli|$(sysconfdir)/moduli|g' \ 135 -e 's|/etc/ssh/moduli|$(sysconfdir)/moduli|g' \ 136 -e 's|/etc/ssh/sshrc|$(sysconfdir)/sshrc|g' \ 137 -e 's|/usr/X11R6/bin/xauth|$(XAUTH_PATH)|g' \ 138 -e 's|/var/empty|$(PRIVSEP_PATH)|g' \ 139 -e 's|/usr/bin:/bin:/usr/sbin:/sbin|@user_path@|g' 140 141FIXPATHSCMD = $(SED) $(PATHSUBS) 142FIXALGORITHMSCMD= $(SHELL) $(srcdir)/fixalgorithms $(SED) \ 143 @UNSUPPORTED_ALGORITHMS@ 144 145all: $(CONFIGFILES) $(MANPAGES) $(TARGETS) 146 147$(LIBSSH_OBJS): Makefile.in config.h 148$(SSHOBJS): Makefile.in config.h 149$(SSHDOBJS): Makefile.in config.h 150 151.c.o: 152 $(CC) $(CFLAGS) $(CPPFLAGS) -c $< -o $@ 153 154LIBCOMPAT=openbsd-compat/libopenbsd-compat.a 155$(LIBCOMPAT): always 156 (cd openbsd-compat && $(MAKE)) 157always: 158 159libssh.a: $(LIBSSH_OBJS) 160 $(AR) rv $@ $(LIBSSH_OBJS) 161 $(RANLIB) $@ 162 163ssh$(EXEEXT): $(LIBCOMPAT) libssh.a $(SSHOBJS) 164 $(LD) -o $@ $(SSHOBJS) $(LDFLAGS) -lssh -lopenbsd-compat $(SSHLIBS) $(LIBS) $(GSSLIBS) 165 166sshd$(EXEEXT): libssh.a $(LIBCOMPAT) $(SSHDOBJS) 167 $(LD) -o $@ $(SSHDOBJS) $(LDFLAGS) -lssh -lopenbsd-compat $(SSHDLIBS) $(LIBS) $(GSSLIBS) $(K5LIBS) 168 169scp$(EXEEXT): $(LIBCOMPAT) libssh.a scp.o progressmeter.o 170 $(LD) -o $@ scp.o progressmeter.o bufaux.o $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS) 171 172ssh-add$(EXEEXT): $(LIBCOMPAT) libssh.a ssh-add.o 173 $(LD) -o $@ ssh-add.o $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS) 174 175ssh-agent$(EXEEXT): $(LIBCOMPAT) libssh.a ssh-agent.o ssh-pkcs11-client.o 176 $(LD) -o $@ ssh-agent.o ssh-pkcs11-client.o $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS) 177 178ssh-keygen$(EXEEXT): $(LIBCOMPAT) libssh.a ssh-keygen.o 179 $(LD) -o $@ ssh-keygen.o $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS) 180 181ssh-keysign$(EXEEXT): $(LIBCOMPAT) libssh.a ssh-keysign.o roaming_dummy.o readconf.o 182 $(LD) -o $@ ssh-keysign.o readconf.o roaming_dummy.o $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS) 183 184ssh-pkcs11-helper$(EXEEXT): $(LIBCOMPAT) libssh.a ssh-pkcs11-helper.o ssh-pkcs11.o 185 $(LD) -o $@ ssh-pkcs11-helper.o ssh-pkcs11.o $(LDFLAGS) -lssh -lopenbsd-compat -lssh -lopenbsd-compat $(LIBS) 186 187ssh-keyscan$(EXEEXT): $(LIBCOMPAT) libssh.a ssh-keyscan.o roaming_dummy.o 188 $(LD) -o $@ ssh-keyscan.o roaming_dummy.o $(LDFLAGS) -lssh -lopenbsd-compat -lssh $(LIBS) 189 190sftp-server$(EXEEXT): $(LIBCOMPAT) libssh.a sftp.o sftp-common.o sftp-server.o sftp-server-main.o 191 $(LD) -o $@ sftp-server.o sftp-common.o sftp-server-main.o $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS) 192 193sftp$(EXEEXT): $(LIBCOMPAT) libssh.a sftp.o sftp-client.o sftp-common.o sftp-glob.o progressmeter.o 194 $(LD) -o $@ progressmeter.o sftp.o sftp-client.o sftp-common.o sftp-glob.o $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS) $(LIBEDIT) 195 196# test driver for the loginrec code - not built by default 197logintest: logintest.o $(LIBCOMPAT) libssh.a loginrec.o 198 $(LD) -o $@ logintest.o $(LDFLAGS) loginrec.o -lopenbsd-compat -lssh $(LIBS) 199 200$(MANPAGES): $(MANPAGES_IN) 201 if test "$(MANTYPE)" = "cat"; then \ 202 manpage=$(srcdir)/`echo $@ | sed 's/\.[1-9]\.out$$/\.0/'`; \ 203 else \ 204 manpage=$(srcdir)/`echo $@ | sed 's/\.out$$//'`; \ 205 fi; \ 206 if test "$(MANTYPE)" = "man"; then \ 207 $(FIXPATHSCMD) $${manpage} | $(FIXALGORITHMSCMD) | \ 208 $(AWK) -f $(srcdir)/mdoc2man.awk > $@; \ 209 else \ 210 $(FIXPATHSCMD) $${manpage} | $(FIXALGORITHMSCMD) > $@; \ 211 fi 212 213$(CONFIGFILES): $(CONFIGFILES_IN) 214 conffile=`echo $@ | sed 's/.out$$//'`; \ 215 $(FIXPATHSCMD) $(srcdir)/$${conffile} > $@ 216 217# fake rule to stop make trying to compile moduli.o into a binary "moduli.o" 218moduli: 219 echo 220 221# special case target for umac128 222umac128.o: umac.c 223 $(CC) $(CFLAGS) $(CPPFLAGS) -o umac128.o -c $(srcdir)/umac.c \ 224 -DUMAC_OUTPUT_LEN=16 -Dumac_new=umac128_new \ 225 -Dumac_update=umac128_update -Dumac_final=umac128_final \ 226 -Dumac_delete=umac128_delete 227 228clean: regressclean 229 rm -f *.o *.a $(TARGETS) logintest config.cache config.log 230 rm -f *.out core survey 231 rm -f regress/unittests/test_helper/*.a 232 rm -f regress/unittests/test_helper/*.o 233 rm -f regress/unittests/sshbuf/*.o 234 rm -f regress/unittests/sshbuf/test_sshbuf 235 rm -f regress/unittests/sshkey/*.o 236 rm -f regress/unittests/sshkey/test_sshkey 237 rm -f regress/unittests/bitmap/*.o 238 rm -f regress/unittests/bitmap/test_bitmap 239 rm -f regress/unittests/hostkeys/*.o 240 rm -f regress/unittests/hostkeys/test_hostkeys 241 rm -f regress/unittests/kex/*.o 242 rm -f regress/unittests/kex/test_kex 243 (cd openbsd-compat && $(MAKE) clean) 244 245distclean: regressclean 246 rm -f *.o *.a $(TARGETS) logintest config.cache config.log 247 rm -f *.out core opensshd.init openssh.xml 248 rm -f Makefile buildpkg.sh config.h config.status 249 rm -f survey.sh openbsd-compat/regress/Makefile *~ 250 rm -rf autom4te.cache 251 rm -f regress/unittests/test_helper/*.a 252 rm -f regress/unittests/test_helper/*.o 253 rm -f regress/unittests/sshbuf/*.o 254 rm -f regress/unittests/sshbuf/test_sshbuf 255 rm -f regress/unittests/sshkey/*.o 256 rm -f regress/unittests/sshkey/test_sshkey 257 rm -f regress/unittests/bitmap/*.o 258 rm -f regress/unittests/bitmap/test_bitmap 259 rm -f regress/unittests/hostkeys/*.o 260 rm -f regress/unittests/hostkeys/test_hostkeys 261 rm -f regress/unittests/kex/*.o 262 rm -f regress/unittests/kex/test_kex 263 (cd openbsd-compat && $(MAKE) distclean) 264 if test -d pkg ; then \ 265 rm -fr pkg ; \ 266 fi 267 268veryclean: distclean 269 rm -f configure config.h.in *.0 270 271cleandir: veryclean 272 273mrproper: veryclean 274 275realclean: veryclean 276 277catman-do: 278 @for f in $(MANPAGES_IN) ; do \ 279 base=`echo $$f | sed 's/\..*$$//'` ; \ 280 echo "$$f -> $$base.0" ; \ 281 $(MANFMT) $$f | cat -v | sed -e 's/.\^H//g' \ 282 >$$base.0 ; \ 283 done 284 285distprep: catman-do 286 $(AUTORECONF) 287 -rm -rf autom4te.cache 288 289install: $(CONFIGFILES) $(MANPAGES) $(TARGETS) install-files install-sysconf host-key check-config 290install-nokeys: $(CONFIGFILES) $(MANPAGES) $(TARGETS) install-files install-sysconf 291install-nosysconf: $(CONFIGFILES) $(MANPAGES) $(TARGETS) install-files 292 293check-config: 294 -$(DESTDIR)$(sbindir)/sshd -t -f $(DESTDIR)$(sysconfdir)/sshd_config 295 296install-files: 297 $(srcdir)/mkinstalldirs $(DESTDIR)$(bindir) 298 $(srcdir)/mkinstalldirs $(DESTDIR)$(sbindir) 299 $(srcdir)/mkinstalldirs $(DESTDIR)$(mandir) 300 $(srcdir)/mkinstalldirs $(DESTDIR)$(mandir)/$(mansubdir)1 301 $(srcdir)/mkinstalldirs $(DESTDIR)$(mandir)/$(mansubdir)5 302 $(srcdir)/mkinstalldirs $(DESTDIR)$(mandir)/$(mansubdir)8 303 $(srcdir)/mkinstalldirs $(DESTDIR)$(libexecdir) 304 (umask 022 ; $(srcdir)/mkinstalldirs $(DESTDIR)$(PRIVSEP_PATH)) 305 $(INSTALL) -m 0755 $(STRIP_OPT) ssh$(EXEEXT) $(DESTDIR)$(bindir)/ssh$(EXEEXT) 306 $(INSTALL) -m 0755 $(STRIP_OPT) scp$(EXEEXT) $(DESTDIR)$(bindir)/scp$(EXEEXT) 307 $(INSTALL) -m 0755 $(STRIP_OPT) ssh-add$(EXEEXT) $(DESTDIR)$(bindir)/ssh-add$(EXEEXT) 308 $(INSTALL) -m 0755 $(STRIP_OPT) ssh-agent$(EXEEXT) $(DESTDIR)$(bindir)/ssh-agent$(EXEEXT) 309 $(INSTALL) -m 0755 $(STRIP_OPT) ssh-keygen$(EXEEXT) $(DESTDIR)$(bindir)/ssh-keygen$(EXEEXT) 310 $(INSTALL) -m 0755 $(STRIP_OPT) ssh-keyscan$(EXEEXT) $(DESTDIR)$(bindir)/ssh-keyscan$(EXEEXT) 311 $(INSTALL) -m 0755 $(STRIP_OPT) sshd$(EXEEXT) $(DESTDIR)$(sbindir)/sshd$(EXEEXT) 312 $(INSTALL) -m 4711 $(STRIP_OPT) ssh-keysign$(EXEEXT) $(DESTDIR)$(SSH_KEYSIGN)$(EXEEXT) 313 $(INSTALL) -m 0755 $(STRIP_OPT) ssh-pkcs11-helper$(EXEEXT) $(DESTDIR)$(SSH_PKCS11_HELPER)$(EXEEXT) 314 $(INSTALL) -m 0755 $(STRIP_OPT) sftp$(EXEEXT) $(DESTDIR)$(bindir)/sftp$(EXEEXT) 315 $(INSTALL) -m 0755 $(STRIP_OPT) sftp-server$(EXEEXT) $(DESTDIR)$(SFTP_SERVER)$(EXEEXT) 316 $(INSTALL) -m 644 ssh.1.out $(DESTDIR)$(mandir)/$(mansubdir)1/ssh.1 317 $(INSTALL) -m 644 scp.1.out $(DESTDIR)$(mandir)/$(mansubdir)1/scp.1 318 $(INSTALL) -m 644 ssh-add.1.out $(DESTDIR)$(mandir)/$(mansubdir)1/ssh-add.1 319 $(INSTALL) -m 644 ssh-agent.1.out $(DESTDIR)$(mandir)/$(mansubdir)1/ssh-agent.1 320 $(INSTALL) -m 644 ssh-keygen.1.out $(DESTDIR)$(mandir)/$(mansubdir)1/ssh-keygen.1 321 $(INSTALL) -m 644 ssh-keyscan.1.out $(DESTDIR)$(mandir)/$(mansubdir)1/ssh-keyscan.1 322 $(INSTALL) -m 644 moduli.5.out $(DESTDIR)$(mandir)/$(mansubdir)5/moduli.5 323 $(INSTALL) -m 644 sshd_config.5.out $(DESTDIR)$(mandir)/$(mansubdir)5/sshd_config.5 324 $(INSTALL) -m 644 ssh_config.5.out $(DESTDIR)$(mandir)/$(mansubdir)5/ssh_config.5 325 $(INSTALL) -m 644 sshd.8.out $(DESTDIR)$(mandir)/$(mansubdir)8/sshd.8 326 $(INSTALL) -m 644 sftp.1.out $(DESTDIR)$(mandir)/$(mansubdir)1/sftp.1 327 $(INSTALL) -m 644 sftp-server.8.out $(DESTDIR)$(mandir)/$(mansubdir)8/sftp-server.8 328 $(INSTALL) -m 644 ssh-keysign.8.out $(DESTDIR)$(mandir)/$(mansubdir)8/ssh-keysign.8 329 $(INSTALL) -m 644 ssh-pkcs11-helper.8.out $(DESTDIR)$(mandir)/$(mansubdir)8/ssh-pkcs11-helper.8 330 -rm -f $(DESTDIR)$(bindir)/slogin 331 ln -s ./ssh$(EXEEXT) $(DESTDIR)$(bindir)/slogin 332 -rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/slogin.1 333 ln -s ./ssh.1 $(DESTDIR)$(mandir)/$(mansubdir)1/slogin.1 334 335install-sysconf: 336 if [ ! -d $(DESTDIR)$(sysconfdir) ]; then \ 337 $(srcdir)/mkinstalldirs $(DESTDIR)$(sysconfdir); \ 338 fi 339 @if [ ! -f $(DESTDIR)$(sysconfdir)/ssh_config ]; then \ 340 $(INSTALL) -m 644 ssh_config.out $(DESTDIR)$(sysconfdir)/ssh_config; \ 341 else \ 342 echo "$(DESTDIR)$(sysconfdir)/ssh_config already exists, install will not overwrite"; \ 343 fi 344 @if [ ! -f $(DESTDIR)$(sysconfdir)/sshd_config ]; then \ 345 $(INSTALL) -m 644 sshd_config.out $(DESTDIR)$(sysconfdir)/sshd_config; \ 346 else \ 347 echo "$(DESTDIR)$(sysconfdir)/sshd_config already exists, install will not overwrite"; \ 348 fi 349 @if [ ! -f $(DESTDIR)$(sysconfdir)/moduli ]; then \ 350 if [ -f $(DESTDIR)$(sysconfdir)/primes ]; then \ 351 echo "moving $(DESTDIR)$(sysconfdir)/primes to $(DESTDIR)$(sysconfdir)/moduli"; \ 352 mv "$(DESTDIR)$(sysconfdir)/primes" "$(DESTDIR)$(sysconfdir)/moduli"; \ 353 else \ 354 $(INSTALL) -m 644 moduli.out $(DESTDIR)$(sysconfdir)/moduli; \ 355 fi ; \ 356 else \ 357 echo "$(DESTDIR)$(sysconfdir)/moduli already exists, install will not overwrite"; \ 358 fi 359 360host-key: ssh-keygen$(EXEEXT) 361 @if [ -z "$(DESTDIR)" ] ; then \ 362 if [ -f "$(sysconfdir)/ssh_host_key" ] ; then \ 363 echo "$(sysconfdir)/ssh_host_key already exists, skipping." ; \ 364 else \ 365 ./ssh-keygen -t rsa1 -f $(sysconfdir)/ssh_host_key -N "" ; \ 366 fi ; \ 367 if [ -f $(sysconfdir)/ssh_host_dsa_key ] ; then \ 368 echo "$(sysconfdir)/ssh_host_dsa_key already exists, skipping." ; \ 369 else \ 370 ./ssh-keygen -t dsa -f $(sysconfdir)/ssh_host_dsa_key -N "" ; \ 371 fi ; \ 372 if [ -f $(sysconfdir)/ssh_host_rsa_key ] ; then \ 373 echo "$(sysconfdir)/ssh_host_rsa_key already exists, skipping." ; \ 374 else \ 375 ./ssh-keygen -t rsa -f $(sysconfdir)/ssh_host_rsa_key -N "" ; \ 376 fi ; \ 377 if [ -f $(sysconfdir)/ssh_host_ed25519_key ] ; then \ 378 echo "$(sysconfdir)/ssh_host_ed25519_key already exists, skipping." ; \ 379 else \ 380 ./ssh-keygen -t ed25519 -f $(sysconfdir)/ssh_host_ed25519_key -N "" ; \ 381 fi ; \ 382 if [ -z "@COMMENT_OUT_ECC@" ] ; then \ 383 if [ -f $(sysconfdir)/ssh_host_ecdsa_key ] ; then \ 384 echo "$(sysconfdir)/ssh_host_ecdsa_key already exists, skipping." ; \ 385 else \ 386 ./ssh-keygen -t ecdsa -f $(sysconfdir)/ssh_host_ecdsa_key -N "" ; \ 387 fi ; \ 388 fi ; \ 389 fi ; 390 391host-key-force: ssh-keygen$(EXEEXT) 392 ./ssh-keygen -t rsa1 -f $(DESTDIR)$(sysconfdir)/ssh_host_key -N "" 393 ./ssh-keygen -t dsa -f $(DESTDIR)$(sysconfdir)/ssh_host_dsa_key -N "" 394 ./ssh-keygen -t rsa -f $(DESTDIR)$(sysconfdir)/ssh_host_rsa_key -N "" 395 ./ssh-keygen -t ed25519 -f $(DESTDIR)$(sysconfdir)/ssh_host_ed25519_key -N "" 396 test -z "@COMMENT_OUT_ECC@" && ./ssh-keygen -t ecdsa -f $(DESTDIR)$(sysconfdir)/ssh_host_ecdsa_key -N "" 397 398uninstallall: uninstall 399 -rm -f $(DESTDIR)$(sysconfdir)/ssh_config 400 -rm -f $(DESTDIR)$(sysconfdir)/sshd_config 401 -rmdir $(DESTDIR)$(sysconfdir) 402 -rmdir $(DESTDIR)$(bindir) 403 -rmdir $(DESTDIR)$(sbindir) 404 -rmdir $(DESTDIR)$(mandir)/$(mansubdir)1 405 -rmdir $(DESTDIR)$(mandir)/$(mansubdir)8 406 -rmdir $(DESTDIR)$(mandir) 407 -rmdir $(DESTDIR)$(libexecdir) 408 409uninstall: 410 -rm -f $(DESTDIR)$(bindir)/slogin 411 -rm -f $(DESTDIR)$(bindir)/ssh$(EXEEXT) 412 -rm -f $(DESTDIR)$(bindir)/scp$(EXEEXT) 413 -rm -f $(DESTDIR)$(bindir)/ssh-add$(EXEEXT) 414 -rm -f $(DESTDIR)$(bindir)/ssh-agent$(EXEEXT) 415 -rm -f $(DESTDIR)$(bindir)/ssh-keygen$(EXEEXT) 416 -rm -f $(DESTDIR)$(bindir)/ssh-keyscan$(EXEEXT) 417 -rm -f $(DESTDIR)$(bindir)/sftp$(EXEEXT) 418 -rm -f $(DESTDIR)$(sbindir)/sshd$(EXEEXT) 419 -rm -r $(DESTDIR)$(SFTP_SERVER)$(EXEEXT) 420 -rm -f $(DESTDIR)$(SSH_KEYSIGN)$(EXEEXT) 421 -rm -f $(DESTDIR)$(SSH_PKCS11_HELPER)$(EXEEXT) 422 -rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/ssh.1 423 -rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/scp.1 424 -rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/ssh-add.1 425 -rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/ssh-agent.1 426 -rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/ssh-keygen.1 427 -rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/sftp.1 428 -rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/ssh-keyscan.1 429 -rm -f $(DESTDIR)$(mandir)/$(mansubdir)8/sshd.8 430 -rm -f $(DESTDIR)$(mandir)/$(mansubdir)8/sftp-server.8 431 -rm -f $(DESTDIR)$(mandir)/$(mansubdir)8/ssh-keysign.8 432 -rm -f $(DESTDIR)$(mandir)/$(mansubdir)8/ssh-pkcs11-helper.8 433 -rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/slogin.1 434 435regress-prep: 436 [ -d `pwd`/regress ] || mkdir -p `pwd`/regress 437 [ -d `pwd`/regress/unittests ] || mkdir -p `pwd`/regress/unittests 438 [ -d `pwd`/regress/unittests/test_helper ] || \ 439 mkdir -p `pwd`/regress/unittests/test_helper 440 [ -d `pwd`/regress/unittests/sshbuf ] || \ 441 mkdir -p `pwd`/regress/unittests/sshbuf 442 [ -d `pwd`/regress/unittests/sshkey ] || \ 443 mkdir -p `pwd`/regress/unittests/sshkey 444 [ -d `pwd`/regress/unittests/bitmap ] || \ 445 mkdir -p `pwd`/regress/unittests/bitmap 446 [ -d `pwd`/regress/unittests/hostkeys ] || \ 447 mkdir -p `pwd`/regress/unittests/hostkeys 448 [ -d `pwd`/regress/unittests/kex ] || \ 449 mkdir -p `pwd`/regress/unittests/kex 450 [ -f `pwd`/regress/Makefile ] || \ 451 ln -s `cd $(srcdir) && pwd`/regress/Makefile `pwd`/regress/Makefile 452 453regress/modpipe$(EXEEXT): $(srcdir)/regress/modpipe.c 454 $(CC) $(CFLAGS) $(CPPFLAGS) -o $@ $? \ 455 $(LDFLAGS) -lssh -lopenbsd-compat -lssh -lopenbsd-compat $(LIBS) 456 457regress/setuid-allowed$(EXEEXT): $(srcdir)/regress/setuid-allowed.c 458 $(CC) $(CFLAGS) $(CPPFLAGS) -o $@ $? \ 459 $(LDFLAGS) -lssh -lopenbsd-compat -lssh -lopenbsd-compat $(LIBS) 460 461regress/netcat$(EXEEXT): $(srcdir)/regress/netcat.c 462 $(CC) $(CFLAGS) $(CPPFLAGS) -o $@ $? \ 463 $(LDFLAGS) -lssh -lopenbsd-compat -lssh -lopenbsd-compat $(LIBS) 464 465UNITTESTS_TEST_HELPER_OBJS=\ 466 regress/unittests/test_helper/test_helper.o \ 467 regress/unittests/test_helper/fuzz.o 468 469regress/unittests/test_helper/libtest_helper.a: ${UNITTESTS_TEST_HELPER_OBJS} 470 $(AR) rv $@ $(UNITTESTS_TEST_HELPER_OBJS) 471 $(RANLIB) $@ 472 473UNITTESTS_TEST_SSHBUF_OBJS=\ 474 regress/unittests/sshbuf/tests.o \ 475 regress/unittests/sshbuf/test_sshbuf.o \ 476 regress/unittests/sshbuf/test_sshbuf_getput_basic.o \ 477 regress/unittests/sshbuf/test_sshbuf_getput_crypto.o \ 478 regress/unittests/sshbuf/test_sshbuf_misc.o \ 479 regress/unittests/sshbuf/test_sshbuf_fuzz.o \ 480 regress/unittests/sshbuf/test_sshbuf_getput_fuzz.o \ 481 regress/unittests/sshbuf/test_sshbuf_fixed.o 482 483regress/unittests/sshbuf/test_sshbuf$(EXEEXT): ${UNITTESTS_TEST_SSHBUF_OBJS} \ 484 regress/unittests/test_helper/libtest_helper.a libssh.a 485 $(LD) -o $@ $(LDFLAGS) $(UNITTESTS_TEST_SSHBUF_OBJS) \ 486 regress/unittests/test_helper/libtest_helper.a \ 487 -lssh -lopenbsd-compat -lssh -lopenbsd-compat $(LIBS) 488 489UNITTESTS_TEST_SSHKEY_OBJS=\ 490 regress/unittests/sshkey/test_fuzz.o \ 491 regress/unittests/sshkey/tests.o \ 492 regress/unittests/sshkey/common.o \ 493 regress/unittests/sshkey/test_file.o \ 494 regress/unittests/sshkey/test_sshkey.o 495 496regress/unittests/sshkey/test_sshkey$(EXEEXT): ${UNITTESTS_TEST_SSHKEY_OBJS} \ 497 regress/unittests/test_helper/libtest_helper.a libssh.a 498 $(LD) -o $@ $(LDFLAGS) $(UNITTESTS_TEST_SSHKEY_OBJS) \ 499 regress/unittests/test_helper/libtest_helper.a \ 500 -lssh -lopenbsd-compat -lssh -lopenbsd-compat $(LIBS) 501 502UNITTESTS_TEST_BITMAP_OBJS=\ 503 regress/unittests/bitmap/tests.o 504 505regress/unittests/bitmap/test_bitmap$(EXEEXT): ${UNITTESTS_TEST_BITMAP_OBJS} \ 506 regress/unittests/test_helper/libtest_helper.a libssh.a 507 $(LD) -o $@ $(LDFLAGS) $(UNITTESTS_TEST_BITMAP_OBJS) \ 508 regress/unittests/test_helper/libtest_helper.a \ 509 -lssh -lopenbsd-compat -lssh -lopenbsd-compat $(LIBS) 510 511UNITTESTS_TEST_KEX_OBJS=\ 512 regress/unittests/kex/tests.o \ 513 regress/unittests/kex/test_kex.o \ 514 roaming_dummy.o 515 516regress/unittests/kex/test_kex$(EXEEXT): ${UNITTESTS_TEST_KEX_OBJS} \ 517 regress/unittests/test_helper/libtest_helper.a libssh.a 518 $(LD) -o $@ $(LDFLAGS) $(UNITTESTS_TEST_KEX_OBJS) \ 519 regress/unittests/test_helper/libtest_helper.a \ 520 -lssh -lopenbsd-compat -lssh -lopenbsd-compat $(LIBS) 521 522UNITTESTS_TEST_HOSTKEYS_OBJS=\ 523 regress/unittests/hostkeys/tests.o \ 524 regress/unittests/hostkeys/test_iterate.o 525 526regress/unittests/hostkeys/test_hostkeys$(EXEEXT): \ 527 ${UNITTESTS_TEST_HOSTKEYS_OBJS} \ 528 regress/unittests/test_helper/libtest_helper.a libssh.a 529 $(LD) -o $@ $(LDFLAGS) $(UNITTESTS_TEST_HOSTKEYS_OBJS) \ 530 regress/unittests/test_helper/libtest_helper.a \ 531 -lssh -lopenbsd-compat -lssh -lopenbsd-compat $(LIBS) 532 533REGRESS_BINARIES=\ 534 regress/modpipe$(EXEEXT) \ 535 regress/setuid-allowed$(EXEEXT) \ 536 regress/netcat$(EXEEXT) \ 537 regress/unittests/sshbuf/test_sshbuf$(EXEEXT) \ 538 regress/unittests/sshkey/test_sshkey$(EXEEXT) \ 539 regress/unittests/bitmap/test_bitmap$(EXEEXT) \ 540 regress/unittests/hostkeys/test_hostkeys$(EXEEXT) \ 541 regress/unittests/kex/test_kex$(EXEEXT) 542 543tests interop-tests t-exec: regress-prep $(TARGETS) $(REGRESS_BINARIES) 544 BUILDDIR=`pwd`; \ 545 TEST_SSH_SCP="$${BUILDDIR}/scp"; \ 546 TEST_SSH_SSH="$${BUILDDIR}/ssh"; \ 547 TEST_SSH_SSHD="$${BUILDDIR}/sshd"; \ 548 TEST_SSH_SSHAGENT="$${BUILDDIR}/ssh-agent"; \ 549 TEST_SSH_SSHADD="$${BUILDDIR}/ssh-add"; \ 550 TEST_SSH_SSHKEYGEN="$${BUILDDIR}/ssh-keygen"; \ 551 TEST_SSH_SSHPKCS11HELPER="$${BUILDDIR}/ssh-pkcs11-helper"; \ 552 TEST_SSH_SSHKEYSCAN="$${BUILDDIR}/ssh-keyscan"; \ 553 TEST_SSH_SFTP="$${BUILDDIR}/sftp"; \ 554 TEST_SSH_SFTPSERVER="$${BUILDDIR}/sftp-server"; \ 555 TEST_SSH_PLINK="plink"; \ 556 TEST_SSH_PUTTYGEN="puttygen"; \ 557 TEST_SSH_CONCH="conch"; \ 558 TEST_SSH_IPV6="@TEST_SSH_IPV6@" ; \ 559 TEST_SSH_ECC="@TEST_SSH_ECC@" ; \ 560 cd $(srcdir)/regress || exit $$?; \ 561 $(MAKE) \ 562 .OBJDIR="$${BUILDDIR}/regress" \ 563 .CURDIR="`pwd`" \ 564 BUILDDIR="$${BUILDDIR}" \ 565 OBJ="$${BUILDDIR}/regress/" \ 566 PATH="$${BUILDDIR}:$${PATH}" \ 567 TEST_ENV=MALLOC_OPTIONS="@TEST_MALLOC_OPTIONS@" \ 568 TEST_SSH_SCP="$${TEST_SSH_SCP}" \ 569 TEST_SSH_SSH="$${TEST_SSH_SSH}" \ 570 TEST_SSH_SSHD="$${TEST_SSH_SSHD}" \ 571 TEST_SSH_SSHAGENT="$${TEST_SSH_SSHAGENT}" \ 572 TEST_SSH_SSHADD="$${TEST_SSH_SSHADD}" \ 573 TEST_SSH_SSHKEYGEN="$${TEST_SSH_SSHKEYGEN}" \ 574 TEST_SSH_SSHPKCS11HELPER="$${TEST_SSH_SSHPKCS11HELPER}" \ 575 TEST_SSH_SSHKEYSCAN="$${TEST_SSH_SSHKEYSCAN}" \ 576 TEST_SSH_SFTP="$${TEST_SSH_SFTP}" \ 577 TEST_SSH_SFTPSERVER="$${TEST_SSH_SFTPSERVER}" \ 578 TEST_SSH_PLINK="$${TEST_SSH_PLINK}" \ 579 TEST_SSH_PUTTYGEN="$${TEST_SSH_PUTTYGEN}" \ 580 TEST_SSH_CONCH="$${TEST_SSH_CONCH}" \ 581 TEST_SSH_IPV6="$${TEST_SSH_IPV6}" \ 582 TEST_SSH_ECC="$${TEST_SSH_ECC}" \ 583 TEST_SHELL="${TEST_SHELL}" \ 584 EXEEXT="$(EXEEXT)" \ 585 $@ && echo all tests passed 586 587compat-tests: $(LIBCOMPAT) 588 (cd openbsd-compat/regress && $(MAKE)) 589 590regressclean: 591 if [ -f regress/Makefile ] && [ -r regress/Makefile ]; then \ 592 (cd regress && $(MAKE) clean) \ 593 fi 594 595survey: survey.sh ssh 596 @$(SHELL) ./survey.sh > survey 597 @echo 'The survey results have been placed in the file "survey" in the' 598 @echo 'current directory. Please review the file then send with' 599 @echo '"make send-survey".' 600 601send-survey: survey 602 mail portable-survey@mindrot.org <survey 603 604package: $(CONFIGFILES) $(MANPAGES) $(TARGETS) 605 if [ "@MAKE_PACKAGE_SUPPORTED@" = yes ]; then \ 606 sh buildpkg.sh; \ 607 fi 608