Greg Hartman | bd77cf7 | 2015-02-25 13:21:06 -0800 | [diff] [blame^] | 1 | # $Id: Makefile.in,v 1.325 2011/08/05 20:15:18 djm Exp $ |
| 2 | |
| 3 | # uncomment if you run a non bourne compatable shell. Ie. csh |
| 4 | #SHELL = @SH@ |
| 5 | |
| 6 | AUTORECONF=autoreconf |
| 7 | |
| 8 | prefix=@prefix@ |
| 9 | exec_prefix=@exec_prefix@ |
| 10 | bindir=@bindir@ |
| 11 | sbindir=@sbindir@ |
| 12 | libexecdir=@libexecdir@ |
| 13 | datadir=@datadir@ |
| 14 | datarootdir=@datarootdir@ |
| 15 | mandir=@mandir@ |
| 16 | mansubdir=@mansubdir@ |
| 17 | sysconfdir=@sysconfdir@ |
| 18 | piddir=@piddir@ |
| 19 | srcdir=@srcdir@ |
| 20 | top_srcdir=@top_srcdir@ |
| 21 | |
| 22 | DESTDIR= |
| 23 | VPATH=@srcdir@ |
| 24 | SSH_PROGRAM=@bindir@/ssh |
| 25 | ASKPASS_PROGRAM=$(libexecdir)/ssh-askpass |
| 26 | SFTP_SERVER=$(libexecdir)/sftp-server |
| 27 | SSH_KEYSIGN=$(libexecdir)/ssh-keysign |
| 28 | SSH_PKCS11_HELPER=$(libexecdir)/ssh-pkcs11-helper |
| 29 | PRIVSEP_PATH=@PRIVSEP_PATH@ |
| 30 | SSH_PRIVSEP_USER=@SSH_PRIVSEP_USER@ |
| 31 | STRIP_OPT=@STRIP_OPT@ |
| 32 | |
| 33 | PATHS= -DSSHDIR=\"$(sysconfdir)\" \ |
| 34 | -D_PATH_SSH_PROGRAM=\"$(SSH_PROGRAM)\" \ |
| 35 | -D_PATH_SSH_ASKPASS_DEFAULT=\"$(ASKPASS_PROGRAM)\" \ |
| 36 | -D_PATH_SFTP_SERVER=\"$(SFTP_SERVER)\" \ |
| 37 | -D_PATH_SSH_KEY_SIGN=\"$(SSH_KEYSIGN)\" \ |
| 38 | -D_PATH_SSH_PKCS11_HELPER=\"$(SSH_PKCS11_HELPER)\" \ |
| 39 | -D_PATH_SSH_PIDDIR=\"$(piddir)\" \ |
| 40 | -D_PATH_PRIVSEP_CHROOT_DIR=\"$(PRIVSEP_PATH)\" \ |
| 41 | |
| 42 | CC=@CC@ |
| 43 | LD=@LD@ |
| 44 | CFLAGS=@CFLAGS@ |
| 45 | CPPFLAGS=-I. -I$(srcdir) @CPPFLAGS@ $(PATHS) @DEFS@ |
| 46 | LIBS=@LIBS@ |
| 47 | SSHLIBS=@SSHLIBS@ |
| 48 | SSHDLIBS=@SSHDLIBS@ |
| 49 | LIBEDIT=@LIBEDIT@ |
| 50 | AR=@AR@ |
| 51 | AWK=@AWK@ |
| 52 | RANLIB=@RANLIB@ |
| 53 | INSTALL=@INSTALL@ |
| 54 | PERL=@PERL@ |
| 55 | SED=@SED@ |
| 56 | ENT=@ENT@ |
| 57 | XAUTH_PATH=@XAUTH_PATH@ |
| 58 | LDFLAGS=-L. -Lopenbsd-compat/ @LDFLAGS@ |
| 59 | EXEEXT=@EXEEXT@ |
| 60 | MANFMT=@MANFMT@ |
| 61 | |
| 62 | TARGETS=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) |
| 63 | |
| 64 | LIBSSH_OBJS=acss.o authfd.o authfile.o bufaux.o bufbn.o buffer.o \ |
| 65 | canohost.o channels.o cipher.o cipher-acss.o cipher-aes.o \ |
| 66 | cipher-bf1.o cipher-ctr.o cipher-3des1.o cleanup.o \ |
| 67 | compat.o compress.o crc32.o deattack.o fatal.o hostfile.o \ |
| 68 | log.o match.o md-sha256.o moduli.o nchan.o packet.o \ |
| 69 | readpass.o rsa.o ttymodes.o xmalloc.o addrmatch.o \ |
| 70 | atomicio.o key.o dispatch.o kex.o mac.o uidswap.o uuencode.o misc.o \ |
| 71 | monitor_fdpass.o rijndael.o ssh-dss.o ssh-ecdsa.o ssh-rsa.o dh.o \ |
| 72 | kexdh.o kexgex.o kexdhc.o kexgexc.o bufec.o kexecdh.o kexecdhc.o \ |
| 73 | msg.o progressmeter.o dns.o entropy.o gss-genr.o umac.o jpake.o \ |
| 74 | schnorr.o ssh-pkcs11.o |
| 75 | |
| 76 | SSHOBJS= ssh.o readconf.o clientloop.o sshtty.o \ |
| 77 | sshconnect.o sshconnect1.o sshconnect2.o mux.o \ |
| 78 | roaming_common.o roaming_client.o |
| 79 | |
| 80 | SSHDOBJS=sshd.o auth-rhosts.o auth-passwd.o auth-rsa.o auth-rh-rsa.o \ |
| 81 | audit.o audit-bsm.o audit-linux.o platform.o \ |
| 82 | sshpty.o sshlogin.o servconf.o serverloop.o \ |
| 83 | auth.o auth1.o auth2.o auth-options.o session.o \ |
| 84 | auth-chall.o auth2-chall.o groupaccess.o \ |
| 85 | auth-skey.o auth-bsdauth.o auth2-hostbased.o auth2-kbdint.o \ |
| 86 | auth2-none.o auth2-passwd.o auth2-pubkey.o auth2-jpake.o \ |
| 87 | monitor_mm.o monitor.o monitor_wrap.o kexdhs.o kexgexs.o kexecdhs.o \ |
| 88 | auth-krb5.o \ |
| 89 | auth2-gss.o gss-serv.o gss-serv-krb5.o \ |
| 90 | loginrec.o auth-pam.o auth-shadow.o auth-sia.o md5crypt.o \ |
| 91 | sftp-server.o sftp-common.o \ |
| 92 | roaming_common.o roaming_serv.o \ |
| 93 | sandbox-null.o sandbox-rlimit.o sandbox-systrace.o sandbox-darwin.o |
| 94 | |
| 95 | MANPAGES = 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 |
| 96 | MANPAGES_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 |
| 97 | MANTYPE = @MANTYPE@ |
| 98 | |
| 99 | CONFIGFILES=sshd_config.out ssh_config.out moduli.out |
| 100 | CONFIGFILES_IN=sshd_config ssh_config moduli |
| 101 | |
| 102 | PATHSUBS = \ |
| 103 | -e 's|/etc/ssh/ssh_config|$(sysconfdir)/ssh_config|g' \ |
| 104 | -e 's|/etc/ssh/ssh_known_hosts|$(sysconfdir)/ssh_known_hosts|g' \ |
| 105 | -e 's|/etc/ssh/sshd_config|$(sysconfdir)/sshd_config|g' \ |
| 106 | -e 's|/usr/libexec|$(libexecdir)|g' \ |
| 107 | -e 's|/etc/shosts.equiv|$(sysconfdir)/shosts.equiv|g' \ |
| 108 | -e 's|/etc/ssh/ssh_host_key|$(sysconfdir)/ssh_host_key|g' \ |
| 109 | -e 's|/etc/ssh/ssh_host_ecdsa_key|$(sysconfdir)/ssh_host_ecdsa_key|g' \ |
| 110 | -e 's|/etc/ssh/ssh_host_dsa_key|$(sysconfdir)/ssh_host_dsa_key|g' \ |
| 111 | -e 's|/etc/ssh/ssh_host_rsa_key|$(sysconfdir)/ssh_host_rsa_key|g' \ |
| 112 | -e 's|/var/run/sshd.pid|$(piddir)/sshd.pid|g' \ |
| 113 | -e 's|/etc/moduli|$(sysconfdir)/moduli|g' \ |
| 114 | -e 's|/etc/ssh/moduli|$(sysconfdir)/moduli|g' \ |
| 115 | -e 's|/etc/ssh/sshrc|$(sysconfdir)/sshrc|g' \ |
| 116 | -e 's|/usr/X11R6/bin/xauth|$(XAUTH_PATH)|g' \ |
| 117 | -e 's|/var/empty|$(PRIVSEP_PATH)|g' \ |
| 118 | -e 's|/usr/bin:/bin:/usr/sbin:/sbin|@user_path@|g' |
| 119 | |
| 120 | FIXPATHSCMD = $(SED) $(PATHSUBS) |
| 121 | |
| 122 | all: $(CONFIGFILES) $(MANPAGES) $(TARGETS) |
| 123 | |
| 124 | $(LIBSSH_OBJS): Makefile.in config.h |
| 125 | $(SSHOBJS): Makefile.in config.h |
| 126 | $(SSHDOBJS): Makefile.in config.h |
| 127 | |
| 128 | .c.o: |
| 129 | $(CC) $(CFLAGS) $(CPPFLAGS) -c $< |
| 130 | |
| 131 | LIBCOMPAT=openbsd-compat/libopenbsd-compat.a |
| 132 | $(LIBCOMPAT): always |
| 133 | (cd openbsd-compat && $(MAKE)) |
| 134 | always: |
| 135 | |
| 136 | libssh.a: $(LIBSSH_OBJS) |
| 137 | $(AR) rv $@ $(LIBSSH_OBJS) |
| 138 | $(RANLIB) $@ |
| 139 | |
| 140 | ssh$(EXEEXT): $(LIBCOMPAT) libssh.a $(SSHOBJS) |
| 141 | $(LD) -o $@ $(SSHOBJS) $(LDFLAGS) -lssh -lopenbsd-compat $(SSHLIBS) $(LIBS) |
| 142 | |
| 143 | sshd$(EXEEXT): libssh.a $(LIBCOMPAT) $(SSHDOBJS) |
| 144 | $(LD) -o $@ $(SSHDOBJS) $(LDFLAGS) -lssh -lopenbsd-compat $(SSHDLIBS) $(LIBS) |
| 145 | |
| 146 | scp$(EXEEXT): $(LIBCOMPAT) libssh.a scp.o progressmeter.o |
| 147 | $(LD) -o $@ scp.o progressmeter.o bufaux.o $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS) |
| 148 | |
| 149 | ssh-add$(EXEEXT): $(LIBCOMPAT) libssh.a ssh-add.o |
| 150 | $(LD) -o $@ ssh-add.o $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS) |
| 151 | |
| 152 | ssh-agent$(EXEEXT): $(LIBCOMPAT) libssh.a ssh-agent.o ssh-pkcs11-client.o |
| 153 | $(LD) -o $@ ssh-agent.o ssh-pkcs11-client.o $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS) |
| 154 | |
| 155 | ssh-keygen$(EXEEXT): $(LIBCOMPAT) libssh.a ssh-keygen.o |
| 156 | $(LD) -o $@ ssh-keygen.o $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS) |
| 157 | |
| 158 | ssh-keysign$(EXEEXT): $(LIBCOMPAT) libssh.a ssh-keysign.o roaming_dummy.o readconf.o |
| 159 | $(LD) -o $@ ssh-keysign.o readconf.o roaming_dummy.o $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS) |
| 160 | |
| 161 | ssh-pkcs11-helper$(EXEEXT): $(LIBCOMPAT) libssh.a ssh-pkcs11-helper.o ssh-pkcs11.o |
| 162 | $(LD) -o $@ ssh-pkcs11-helper.o ssh-pkcs11.o $(LDFLAGS) -lssh -lopenbsd-compat -lssh -lopenbsd-compat $(LIBS) |
| 163 | |
| 164 | ssh-keyscan$(EXEEXT): $(LIBCOMPAT) libssh.a ssh-keyscan.o roaming_dummy.o |
| 165 | $(LD) -o $@ ssh-keyscan.o roaming_dummy.o $(LDFLAGS) -lssh -lopenbsd-compat -lssh $(LIBS) |
| 166 | |
| 167 | sftp-server$(EXEEXT): $(LIBCOMPAT) libssh.a sftp.o sftp-common.o sftp-server.o sftp-server-main.o |
| 168 | $(LD) -o $@ sftp-server.o sftp-common.o sftp-server-main.o $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS) |
| 169 | |
| 170 | sftp$(EXEEXT): $(LIBCOMPAT) libssh.a sftp.o sftp-client.o sftp-common.o sftp-glob.o progressmeter.o |
| 171 | $(LD) -o $@ progressmeter.o sftp.o sftp-client.o sftp-common.o sftp-glob.o $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS) $(LIBEDIT) |
| 172 | |
| 173 | # test driver for the loginrec code - not built by default |
| 174 | logintest: logintest.o $(LIBCOMPAT) libssh.a loginrec.o |
| 175 | $(LD) -o $@ logintest.o $(LDFLAGS) loginrec.o -lopenbsd-compat -lssh $(LIBS) |
| 176 | |
| 177 | $(MANPAGES): $(MANPAGES_IN) |
| 178 | if test "$(MANTYPE)" = "cat"; then \ |
| 179 | manpage=$(srcdir)/`echo $@ | sed 's/\.[1-9]\.out$$/\.0/'`; \ |
| 180 | else \ |
| 181 | manpage=$(srcdir)/`echo $@ | sed 's/\.out$$//'`; \ |
| 182 | fi; \ |
| 183 | if test "$(MANTYPE)" = "man"; then \ |
| 184 | $(FIXPATHSCMD) $${manpage} | $(AWK) -f $(srcdir)/mdoc2man.awk > $@; \ |
| 185 | else \ |
| 186 | $(FIXPATHSCMD) $${manpage} > $@; \ |
| 187 | fi |
| 188 | |
| 189 | $(CONFIGFILES): $(CONFIGFILES_IN) |
| 190 | conffile=`echo $@ | sed 's/.out$$//'`; \ |
| 191 | $(FIXPATHSCMD) $(srcdir)/$${conffile} > $@ |
| 192 | |
| 193 | # fake rule to stop make trying to compile moduli.o into a binary "moduli.o" |
| 194 | moduli: |
| 195 | echo |
| 196 | |
| 197 | clean: regressclean |
| 198 | rm -f *.o *.a $(TARGETS) logintest config.cache config.log |
| 199 | rm -f *.out core survey |
| 200 | (cd openbsd-compat && $(MAKE) clean) |
| 201 | |
| 202 | distclean: regressclean |
| 203 | rm -f *.o *.a $(TARGETS) logintest config.cache config.log |
| 204 | rm -f *.out core opensshd.init openssh.xml |
| 205 | rm -f Makefile buildpkg.sh config.h config.status |
| 206 | rm -f survey.sh openbsd-compat/regress/Makefile *~ |
| 207 | rm -rf autom4te.cache |
| 208 | (cd openbsd-compat && $(MAKE) distclean) |
| 209 | if test -d pkg ; then \ |
| 210 | rm -fr pkg ; \ |
| 211 | fi |
| 212 | |
| 213 | veryclean: distclean |
| 214 | rm -f configure config.h.in *.0 |
| 215 | |
| 216 | cleandir: veryclean |
| 217 | |
| 218 | mrproper: veryclean |
| 219 | |
| 220 | realclean: veryclean |
| 221 | |
| 222 | catman-do: |
| 223 | @for f in $(MANPAGES_IN) ; do \ |
| 224 | base=`echo $$f | sed 's/\..*$$//'` ; \ |
| 225 | echo "$$f -> $$base.0" ; \ |
| 226 | $(MANFMT) $$f | cat -v | sed -e 's/.\^H//g' \ |
| 227 | >$$base.0 ; \ |
| 228 | done |
| 229 | |
| 230 | distprep: catman-do |
| 231 | $(AUTORECONF) |
| 232 | -rm -rf autom4te.cache |
| 233 | |
| 234 | install: $(CONFIGFILES) $(MANPAGES) $(TARGETS) install-files install-sysconf host-key check-config |
| 235 | install-nokeys: $(CONFIGFILES) $(MANPAGES) $(TARGETS) install-files install-sysconf |
| 236 | install-nosysconf: $(CONFIGFILES) $(MANPAGES) $(TARGETS) install-files |
| 237 | |
| 238 | check-config: |
| 239 | -$(DESTDIR)$(sbindir)/sshd -t -f $(DESTDIR)$(sysconfdir)/sshd_config |
| 240 | |
| 241 | install-files: |
| 242 | $(srcdir)/mkinstalldirs $(DESTDIR)$(bindir) |
| 243 | $(srcdir)/mkinstalldirs $(DESTDIR)$(sbindir) |
| 244 | $(srcdir)/mkinstalldirs $(DESTDIR)$(mandir) |
| 245 | $(srcdir)/mkinstalldirs $(DESTDIR)$(mandir)/$(mansubdir)1 |
| 246 | $(srcdir)/mkinstalldirs $(DESTDIR)$(mandir)/$(mansubdir)5 |
| 247 | $(srcdir)/mkinstalldirs $(DESTDIR)$(mandir)/$(mansubdir)8 |
| 248 | $(srcdir)/mkinstalldirs $(DESTDIR)$(libexecdir) |
| 249 | (umask 022 ; $(srcdir)/mkinstalldirs $(DESTDIR)$(PRIVSEP_PATH)) |
| 250 | $(INSTALL) -m 0755 $(STRIP_OPT) ssh$(EXEEXT) $(DESTDIR)$(bindir)/ssh$(EXEEXT) |
| 251 | $(INSTALL) -m 0755 $(STRIP_OPT) scp$(EXEEXT) $(DESTDIR)$(bindir)/scp$(EXEEXT) |
| 252 | $(INSTALL) -m 0755 $(STRIP_OPT) ssh-add$(EXEEXT) $(DESTDIR)$(bindir)/ssh-add$(EXEEXT) |
| 253 | $(INSTALL) -m 0755 $(STRIP_OPT) ssh-agent$(EXEEXT) $(DESTDIR)$(bindir)/ssh-agent$(EXEEXT) |
| 254 | $(INSTALL) -m 0755 $(STRIP_OPT) ssh-keygen$(EXEEXT) $(DESTDIR)$(bindir)/ssh-keygen$(EXEEXT) |
| 255 | $(INSTALL) -m 0755 $(STRIP_OPT) ssh-keyscan$(EXEEXT) $(DESTDIR)$(bindir)/ssh-keyscan$(EXEEXT) |
| 256 | $(INSTALL) -m 0755 $(STRIP_OPT) sshd$(EXEEXT) $(DESTDIR)$(sbindir)/sshd$(EXEEXT) |
| 257 | $(INSTALL) -m 4711 $(STRIP_OPT) ssh-keysign$(EXEEXT) $(DESTDIR)$(SSH_KEYSIGN)$(EXEEXT) |
| 258 | $(INSTALL) -m 0755 $(STRIP_OPT) ssh-pkcs11-helper$(EXEEXT) $(DESTDIR)$(SSH_PKCS11_HELPER)$(EXEEXT) |
| 259 | $(INSTALL) -m 0755 $(STRIP_OPT) sftp$(EXEEXT) $(DESTDIR)$(bindir)/sftp$(EXEEXT) |
| 260 | $(INSTALL) -m 0755 $(STRIP_OPT) sftp-server$(EXEEXT) $(DESTDIR)$(SFTP_SERVER)$(EXEEXT) |
| 261 | $(INSTALL) -m 644 ssh.1.out $(DESTDIR)$(mandir)/$(mansubdir)1/ssh.1 |
| 262 | $(INSTALL) -m 644 scp.1.out $(DESTDIR)$(mandir)/$(mansubdir)1/scp.1 |
| 263 | $(INSTALL) -m 644 ssh-add.1.out $(DESTDIR)$(mandir)/$(mansubdir)1/ssh-add.1 |
| 264 | $(INSTALL) -m 644 ssh-agent.1.out $(DESTDIR)$(mandir)/$(mansubdir)1/ssh-agent.1 |
| 265 | $(INSTALL) -m 644 ssh-keygen.1.out $(DESTDIR)$(mandir)/$(mansubdir)1/ssh-keygen.1 |
| 266 | $(INSTALL) -m 644 ssh-keyscan.1.out $(DESTDIR)$(mandir)/$(mansubdir)1/ssh-keyscan.1 |
| 267 | $(INSTALL) -m 644 moduli.5.out $(DESTDIR)$(mandir)/$(mansubdir)5/moduli.5 |
| 268 | $(INSTALL) -m 644 sshd_config.5.out $(DESTDIR)$(mandir)/$(mansubdir)5/sshd_config.5 |
| 269 | $(INSTALL) -m 644 ssh_config.5.out $(DESTDIR)$(mandir)/$(mansubdir)5/ssh_config.5 |
| 270 | $(INSTALL) -m 644 sshd.8.out $(DESTDIR)$(mandir)/$(mansubdir)8/sshd.8 |
| 271 | $(INSTALL) -m 644 sftp.1.out $(DESTDIR)$(mandir)/$(mansubdir)1/sftp.1 |
| 272 | $(INSTALL) -m 644 sftp-server.8.out $(DESTDIR)$(mandir)/$(mansubdir)8/sftp-server.8 |
| 273 | $(INSTALL) -m 644 ssh-keysign.8.out $(DESTDIR)$(mandir)/$(mansubdir)8/ssh-keysign.8 |
| 274 | $(INSTALL) -m 644 ssh-pkcs11-helper.8.out $(DESTDIR)$(mandir)/$(mansubdir)8/ssh-pkcs11-helper.8 |
| 275 | -rm -f $(DESTDIR)$(bindir)/slogin |
| 276 | ln -s ./ssh$(EXEEXT) $(DESTDIR)$(bindir)/slogin |
| 277 | -rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/slogin.1 |
| 278 | ln -s ./ssh.1 $(DESTDIR)$(mandir)/$(mansubdir)1/slogin.1 |
| 279 | |
| 280 | install-sysconf: |
| 281 | if [ ! -d $(DESTDIR)$(sysconfdir) ]; then \ |
| 282 | $(srcdir)/mkinstalldirs $(DESTDIR)$(sysconfdir); \ |
| 283 | fi |
| 284 | @if [ ! -f $(DESTDIR)$(sysconfdir)/ssh_config ]; then \ |
| 285 | $(INSTALL) -m 644 ssh_config.out $(DESTDIR)$(sysconfdir)/ssh_config; \ |
| 286 | else \ |
| 287 | echo "$(DESTDIR)$(sysconfdir)/ssh_config already exists, install will not overwrite"; \ |
| 288 | fi |
| 289 | @if [ ! -f $(DESTDIR)$(sysconfdir)/sshd_config ]; then \ |
| 290 | $(INSTALL) -m 644 sshd_config.out $(DESTDIR)$(sysconfdir)/sshd_config; \ |
| 291 | else \ |
| 292 | echo "$(DESTDIR)$(sysconfdir)/sshd_config already exists, install will not overwrite"; \ |
| 293 | fi |
| 294 | @if [ ! -f $(DESTDIR)$(sysconfdir)/moduli ]; then \ |
| 295 | if [ -f $(DESTDIR)$(sysconfdir)/primes ]; then \ |
| 296 | echo "moving $(DESTDIR)$(sysconfdir)/primes to $(DESTDIR)$(sysconfdir)/moduli"; \ |
| 297 | mv "$(DESTDIR)$(sysconfdir)/primes" "$(DESTDIR)$(sysconfdir)/moduli"; \ |
| 298 | else \ |
| 299 | $(INSTALL) -m 644 moduli.out $(DESTDIR)$(sysconfdir)/moduli; \ |
| 300 | fi ; \ |
| 301 | else \ |
| 302 | echo "$(DESTDIR)$(sysconfdir)/moduli already exists, install will not overwrite"; \ |
| 303 | fi |
| 304 | |
| 305 | host-key: ssh-keygen$(EXEEXT) |
| 306 | @if [ -z "$(DESTDIR)" ] ; then \ |
| 307 | if [ -f "$(sysconfdir)/ssh_host_key" ] ; then \ |
| 308 | echo "$(sysconfdir)/ssh_host_key already exists, skipping." ; \ |
| 309 | else \ |
| 310 | ./ssh-keygen -t rsa1 -f $(sysconfdir)/ssh_host_key -N "" ; \ |
| 311 | fi ; \ |
| 312 | if [ -f $(sysconfdir)/ssh_host_dsa_key ] ; then \ |
| 313 | echo "$(sysconfdir)/ssh_host_dsa_key already exists, skipping." ; \ |
| 314 | else \ |
| 315 | ./ssh-keygen -t dsa -f $(sysconfdir)/ssh_host_dsa_key -N "" ; \ |
| 316 | fi ; \ |
| 317 | if [ -f $(sysconfdir)/ssh_host_rsa_key ] ; then \ |
| 318 | echo "$(sysconfdir)/ssh_host_rsa_key already exists, skipping." ; \ |
| 319 | else \ |
| 320 | ./ssh-keygen -t rsa -f $(sysconfdir)/ssh_host_rsa_key -N "" ; \ |
| 321 | fi ; \ |
| 322 | if [ -z "@COMMENT_OUT_ECC@" ] ; then \ |
| 323 | if [ -f $(sysconfdir)/ssh_host_ecdsa_key ] ; then \ |
| 324 | echo "$(sysconfdir)/ssh_host_ecdsa_key already exists, skipping." ; \ |
| 325 | else \ |
| 326 | ./ssh-keygen -t ecdsa -f $(sysconfdir)/ssh_host_ecdsa_key -N "" ; \ |
| 327 | fi ; \ |
| 328 | fi ; \ |
| 329 | fi ; |
| 330 | |
| 331 | host-key-force: ssh-keygen$(EXEEXT) |
| 332 | ./ssh-keygen -t rsa1 -f $(DESTDIR)$(sysconfdir)/ssh_host_key -N "" |
| 333 | ./ssh-keygen -t dsa -f $(DESTDIR)$(sysconfdir)/ssh_host_dsa_key -N "" |
| 334 | ./ssh-keygen -t rsa -f $(DESTDIR)$(sysconfdir)/ssh_host_rsa_key -N "" |
| 335 | test -z "@COMMENT_OUT_ECC@" && ./ssh-keygen -t ecdsa -f $(DESTDIR)$(sysconfdir)/ssh_host_ecdsa_key -N "" |
| 336 | |
| 337 | uninstallall: uninstall |
| 338 | -rm -f $(DESTDIR)$(sysconfdir)/ssh_config |
| 339 | -rm -f $(DESTDIR)$(sysconfdir)/sshd_config |
| 340 | -rmdir $(DESTDIR)$(sysconfdir) |
| 341 | -rmdir $(DESTDIR)$(bindir) |
| 342 | -rmdir $(DESTDIR)$(sbindir) |
| 343 | -rmdir $(DESTDIR)$(mandir)/$(mansubdir)1 |
| 344 | -rmdir $(DESTDIR)$(mandir)/$(mansubdir)8 |
| 345 | -rmdir $(DESTDIR)$(mandir) |
| 346 | -rmdir $(DESTDIR)$(libexecdir) |
| 347 | |
| 348 | uninstall: |
| 349 | -rm -f $(DESTDIR)$(bindir)/slogin |
| 350 | -rm -f $(DESTDIR)$(bindir)/ssh$(EXEEXT) |
| 351 | -rm -f $(DESTDIR)$(bindir)/scp$(EXEEXT) |
| 352 | -rm -f $(DESTDIR)$(bindir)/ssh-add$(EXEEXT) |
| 353 | -rm -f $(DESTDIR)$(bindir)/ssh-agent$(EXEEXT) |
| 354 | -rm -f $(DESTDIR)$(bindir)/ssh-keygen$(EXEEXT) |
| 355 | -rm -f $(DESTDIR)$(bindir)/ssh-keyscan$(EXEEXT) |
| 356 | -rm -f $(DESTDIR)$(bindir)/sftp$(EXEEXT) |
| 357 | -rm -f $(DESTDIR)$(sbindir)/sshd$(EXEEXT) |
| 358 | -rm -r $(DESTDIR)$(SFTP_SERVER)$(EXEEXT) |
| 359 | -rm -f $(DESTDIR)$(SSH_KEYSIGN)$(EXEEXT) |
| 360 | -rm -f $(DESTDIR)$(SSH_PKCS11_HELPER)$(EXEEXT) |
| 361 | -rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/ssh.1 |
| 362 | -rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/scp.1 |
| 363 | -rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/ssh-add.1 |
| 364 | -rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/ssh-agent.1 |
| 365 | -rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/ssh-keygen.1 |
| 366 | -rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/sftp.1 |
| 367 | -rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/ssh-keyscan.1 |
| 368 | -rm -f $(DESTDIR)$(mandir)/$(mansubdir)8/sshd.8 |
| 369 | -rm -f $(DESTDIR)$(mandir)/$(mansubdir)8/sftp-server.8 |
| 370 | -rm -f $(DESTDIR)$(mandir)/$(mansubdir)8/ssh-keysign.8 |
| 371 | -rm -f $(DESTDIR)$(mandir)/$(mansubdir)8/ssh-pkcs11-helper.8 |
| 372 | -rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/slogin.1 |
| 373 | |
| 374 | tests interop-tests: $(TARGETS) |
| 375 | BUILDDIR=`pwd`; \ |
| 376 | [ -d `pwd`/regress ] || mkdir -p `pwd`/regress; \ |
| 377 | [ -f `pwd`/regress/Makefile ] || \ |
| 378 | ln -s `cd $(srcdir) && pwd`/regress/Makefile `pwd`/regress/Makefile ; \ |
| 379 | TEST_SHELL="@TEST_SHELL@"; \ |
| 380 | TEST_SSH_SSH="$${BUILDDIR}/ssh"; \ |
| 381 | TEST_SSH_SSHD="$${BUILDDIR}/sshd"; \ |
| 382 | TEST_SSH_SSHAGENT="$${BUILDDIR}/ssh-agent"; \ |
| 383 | TEST_SSH_SSHADD="$${BUILDDIR}/ssh-add"; \ |
| 384 | TEST_SSH_SSHKEYGEN="$${BUILDDIR}/ssh-keygen"; \ |
| 385 | TEST_SSH_SSHPKCS11HELPER="$${BUILDDIR}/ssh-pkcs11-helper"; \ |
| 386 | TEST_SSH_SSHKEYSCAN="$${BUILDDIR}/ssh-keyscan"; \ |
| 387 | TEST_SSH_SFTP="$${BUILDDIR}/sftp"; \ |
| 388 | TEST_SSH_SFTPSERVER="$${BUILDDIR}/sftp-server"; \ |
| 389 | TEST_SSH_PLINK="plink"; \ |
| 390 | TEST_SSH_PUTTYGEN="puttygen"; \ |
| 391 | TEST_SSH_CONCH="conch"; \ |
| 392 | TEST_SSH_IPV6="@TEST_SSH_IPV6@" ; \ |
| 393 | TEST_SSH_ECC="@TEST_SSH_ECC@" ; \ |
| 394 | TEST_SSH_SHA256="@TEST_SSH_SHA256@" ; \ |
| 395 | cd $(srcdir)/regress || exit $$?; \ |
| 396 | $(MAKE) \ |
| 397 | .OBJDIR="$${BUILDDIR}/regress" \ |
| 398 | .CURDIR="`pwd`" \ |
| 399 | BUILDDIR="$${BUILDDIR}" \ |
| 400 | OBJ="$${BUILDDIR}/regress/" \ |
| 401 | PATH="$${BUILDDIR}:$${PATH}" \ |
| 402 | TEST_SHELL="$${TEST_SHELL}" \ |
| 403 | TEST_SSH_SSH="$${TEST_SSH_SSH}" \ |
| 404 | TEST_SSH_SSHD="$${TEST_SSH_SSHD}" \ |
| 405 | TEST_SSH_SSHAGENT="$${TEST_SSH_SSHAGENT}" \ |
| 406 | TEST_SSH_SSHADD="$${TEST_SSH_SSHADD}" \ |
| 407 | TEST_SSH_SSHKEYGEN="$${TEST_SSH_SSHKEYGEN}" \ |
| 408 | TEST_SSH_SSHPKCS11HELPER="$${TEST_SSH_SSHPKCS11HELPER}" \ |
| 409 | TEST_SSH_SSHKEYSCAN="$${TEST_SSH_SSHKEYSCAN}" \ |
| 410 | TEST_SSH_SFTP="$${TEST_SSH_SFTP}" \ |
| 411 | TEST_SSH_SFTPSERVER="$${TEST_SSH_SFTPSERVER}" \ |
| 412 | TEST_SSH_PLINK="$${TEST_SSH_PLINK}" \ |
| 413 | TEST_SSH_PUTTYGEN="$${TEST_SSH_PUTTYGEN}" \ |
| 414 | TEST_SSH_CONCH="$${TEST_SSH_CONCH}" \ |
| 415 | TEST_SSH_IPV6="$${TEST_SSH_IPV6}" \ |
| 416 | TEST_SSH_ECC="$${TEST_SSH_ECC}" \ |
| 417 | TEST_SSH_SHA256="$${TEST_SSH_SHA256}" \ |
| 418 | EXEEXT="$(EXEEXT)" \ |
| 419 | $@ && echo all tests passed |
| 420 | |
| 421 | compat-tests: $(LIBCOMPAT) |
| 422 | (cd openbsd-compat/regress && $(MAKE)) |
| 423 | |
| 424 | regressclean: |
| 425 | if [ -f regress/Makefile ] && [ -r regress/Makefile ]; then \ |
| 426 | (cd regress && $(MAKE) clean) \ |
| 427 | fi |
| 428 | |
| 429 | survey: survey.sh ssh |
| 430 | @$(SHELL) ./survey.sh > survey |
| 431 | @echo 'The survey results have been placed in the file "survey" in the' |
| 432 | @echo 'current directory. Please review the file then send with' |
| 433 | @echo '"make send-survey".' |
| 434 | |
| 435 | send-survey: survey |
| 436 | mail portable-survey@mindrot.org <survey |
| 437 | |
| 438 | package: $(CONFIGFILES) $(MANPAGES) $(TARGETS) |
| 439 | if [ "@MAKE_PACKAGE_SUPPORTED@" = yes ]; then \ |
| 440 | sh buildpkg.sh; \ |
| 441 | fi |
| 442 | |