Damien Miller | 7f6ea02 | 1999-10-28 13:25:17 +1000 | [diff] [blame] | 1 | prefix=@prefix@ |
| 2 | exec_prefix=@exec_prefix@ |
| 3 | bindir=@bindir@ |
| 4 | sbindir=@sbindir@ |
Damien Miller | e232455 | 1999-11-19 17:18:57 +1100 | [diff] [blame] | 5 | libexecdir=@libexecdir@ |
Damien Miller | 9438816 | 1999-10-29 09:57:31 +1000 | [diff] [blame] | 6 | mandir=@mandir@ |
Damien Miller | 670a4b8 | 2000-01-22 13:53:11 +1100 | [diff] [blame] | 7 | mansubdir=@mansubdir@ |
Damien Miller | 296a546 | 1999-11-13 10:48:51 +1100 | [diff] [blame] | 8 | sysconfdir=@sysconfdir@ |
Damien Miller | b13c73e | 2000-01-17 22:02:17 +1100 | [diff] [blame] | 9 | piddir=@piddir@ |
| 10 | srcdir=@srcdir@ |
| 11 | top_srcdir=@top_srcdir@ |
Damien Miller | 7f6ea02 | 1999-10-28 13:25:17 +1000 | [diff] [blame] | 12 | |
Damien Miller | 7d7c60d | 2000-01-26 14:37:48 +1100 | [diff] [blame] | 13 | DESTDIR= |
| 14 | |
Damien Miller | c0d7390 | 1999-12-27 09:23:58 +1100 | [diff] [blame] | 15 | VPATH=@srcdir@ |
| 16 | |
Damien Miller | c7b38ce | 1999-11-09 10:28:04 +1100 | [diff] [blame] | 17 | SSH_PROGRAM=@bindir@/ssh |
Damien Miller | 3688440 | 1999-12-26 12:26:21 +1100 | [diff] [blame] | 18 | ASKPASS_LOCATION=@libexecdir@/ssh |
| 19 | ASKPASS_PROGRAM=$(ASKPASS_LOCATION)/ssh-askpass |
Damien Miller | c7b38ce | 1999-11-09 10:28:04 +1100 | [diff] [blame] | 20 | |
Damien Miller | 7f6ea02 | 1999-10-28 13:25:17 +1000 | [diff] [blame] | 21 | CC=@CC@ |
Damien Miller | 3bc14dd | 1999-12-07 14:54:53 +1100 | [diff] [blame] | 22 | PATHS=-DETCDIR=\"$(sysconfdir)\" -DSSH_PROGRAM=\"$(SSH_PROGRAM)\" -DSSH_ASKPASS_DEFAULT=\"$(ASKPASS_PROGRAM)\" |
Damien Miller | c7b38ce | 1999-11-09 10:28:04 +1100 | [diff] [blame] | 23 | CFLAGS=@CFLAGS@ $(PATHS) @DEFS@ |
Damien Miller | e0d444c | 1999-11-09 14:23:45 +1100 | [diff] [blame] | 24 | EXTRA_TARGETS=@GNOME_ASKPASS@ |
Damien Miller | d3dcfaf | 1999-11-09 13:52:33 +1100 | [diff] [blame] | 25 | LIBS=@LIBS@ |
Damien Miller | 7f6ea02 | 1999-10-28 13:25:17 +1000 | [diff] [blame] | 26 | AR=@AR@ |
| 27 | RANLIB=@RANLIB@ |
Damien Miller | d8087f6 | 1999-11-25 12:31:26 +1100 | [diff] [blame] | 28 | INSTALL=@INSTALL@ |
Damien Miller | e79334a | 1999-12-29 10:03:37 +1100 | [diff] [blame] | 29 | PERL=@PERL@ |
Damien Miller | 18ccf85 | 1999-12-16 13:06:18 +1100 | [diff] [blame] | 30 | LDFLAGS=-L. @LDFLAGS@ |
Damien Miller | 7f6ea02 | 1999-10-28 13:25:17 +1000 | [diff] [blame] | 31 | |
Damien Miller | d3dcfaf | 1999-11-09 13:52:33 +1100 | [diff] [blame] | 32 | GNOME_CFLAGS=`gnome-config --cflags gnome gnomeui` |
| 33 | GNOME_LIBS=`gnome-config --libs gnome gnomeui` |
| 34 | |
Damien Miller | 34132e5 | 2000-01-14 15:45:46 +1100 | [diff] [blame] | 35 | TARGETS=ssh sshd ssh-add ssh-keygen ssh-agent scp $(EXTRA_TARGETS) |
Damien Miller | 7f6ea02 | 1999-10-28 13:25:17 +1000 | [diff] [blame] | 36 | |
Damien Miller | f07390e | 2000-01-29 20:40:22 +1100 | [diff] [blame] | 37 | LIBOBJS= atomicio.o authfd.o authfile.o bsd-bindresvport.o bsd-daemon.o bsd-misc.o bsd-mktemp.o bsd-rresvport.o bsd-snprintf.o bsd-strlcat.o bsd-strlcpy.o bufaux.o buffer.o canohost.o channels.o cipher.o compat.o compress.o crc32.o deattack.o fake-getaddrinfo.o fake-getnameinfo.o fingerprint.o hostfile.o log.o match.o mpaux.o nchan.o packet.o radix.o random.o readpass.o rsa.o tildexpand.o ttymodes.o uidswap.o xmalloc.o |
Damien Miller | 18ccf85 | 1999-12-16 13:06:18 +1100 | [diff] [blame] | 38 | |
Damien Miller | e72b7af | 1999-12-30 15:08:44 +1100 | [diff] [blame] | 39 | SSHOBJS= ssh.o sshconnect.o log-client.o readconf.o clientloop.o |
| 40 | |
Damien Miller | 34132e5 | 2000-01-14 15:45:46 +1100 | [diff] [blame] | 41 | SSHDOBJS= sshd.o auth-rhosts.o auth-krb4.o auth-pam.o auth-passwd.o auth-rsa.o auth-rh-rsa.o pty.o log-server.o login.o servconf.o serverloop.o bsd-login.o md5crypt.o |
Damien Miller | e72b7af | 1999-12-30 15:08:44 +1100 | [diff] [blame] | 42 | |
Damien Miller | 670a4b8 | 2000-01-22 13:53:11 +1100 | [diff] [blame] | 43 | TROFFMAN = scp.1 ssh-add.1 ssh-agent.1 ssh-keygen.1 ssh.1 sshd.8 |
| 44 | CATMAN = scp.0 ssh-add.0 ssh-agent.0 ssh-keygen.0 ssh.0 sshd.0 |
| 45 | MANPAGES = @MANTYPE@ |
Damien Miller | 645c598 | 2000-01-03 14:42:09 +1100 | [diff] [blame] | 46 | |
| 47 | CONFIGFILES=sshd_config ssh_config |
| 48 | |
Damien Miller | 6d84493 | 2000-01-26 12:17:50 +1100 | [diff] [blame] | 49 | PATHSUBS = -D/etc/ssh_config=$(sysconfdir)/ssh_config -D/etc/known_hosts=$(sysconfdir)/ssh_known_hosts -D/etc/sshd_config=$(sysconfdir)/sshd_config -D/etc/shosts.equiv=$(sysconfdir)/shosts.equiv -D/etc/ssh_host_key=$(sysconfdir)/ssh_host_key -D/var/run/sshd.pid=$(piddir)/sshd.pid |
Damien Miller | 886c63a | 2000-01-20 23:13:36 +1100 | [diff] [blame] | 50 | |
| 51 | FIXPATHSCMD = $(PERL) $(srcdir)/fixpaths $(PATHSUBS) |
| 52 | |
Damien Miller | 34132e5 | 2000-01-14 15:45:46 +1100 | [diff] [blame] | 53 | all: $(TARGETS) $(MANPAGES) $(CONFIGFILES) |
Damien Miller | 18ccf85 | 1999-12-16 13:06:18 +1100 | [diff] [blame] | 54 | |
Damien Miller | 32b3cf2 | 1999-12-26 10:21:48 +1100 | [diff] [blame] | 55 | $(LIBOBJS): config.h |
| 56 | |
Damien Miller | 18ccf85 | 1999-12-16 13:06:18 +1100 | [diff] [blame] | 57 | libssh.a: $(LIBOBJS) |
| 58 | $(AR) rv $@ $(LIBOBJS) |
Damien Miller | 7f6ea02 | 1999-10-28 13:25:17 +1000 | [diff] [blame] | 59 | $(RANLIB) $@ |
| 60 | |
Damien Miller | 34132e5 | 2000-01-14 15:45:46 +1100 | [diff] [blame] | 61 | ssh: libssh.a $(SSHOBJS) |
Damien Miller | e72b7af | 1999-12-30 15:08:44 +1100 | [diff] [blame] | 62 | $(CC) -o $@ $(SSHOBJS) $(LDFLAGS) -lssh $(LIBS) |
Damien Miller | 7f6ea02 | 1999-10-28 13:25:17 +1000 | [diff] [blame] | 63 | |
Damien Miller | 34132e5 | 2000-01-14 15:45:46 +1100 | [diff] [blame] | 64 | sshd: libssh.a $(SSHDOBJS) |
Damien Miller | 105b7f0 | 2000-01-07 08:45:55 +1100 | [diff] [blame] | 65 | $(CC) -o $@ $(SSHDOBJS) $(LDFLAGS) -lssh $(LIBS) |
Damien Miller | 7f6ea02 | 1999-10-28 13:25:17 +1000 | [diff] [blame] | 66 | |
Damien Miller | 34132e5 | 2000-01-14 15:45:46 +1100 | [diff] [blame] | 67 | scp: libssh.a scp.o |
Damien Miller | 18ccf85 | 1999-12-16 13:06:18 +1100 | [diff] [blame] | 68 | $(CC) -o $@ scp.o $(LDFLAGS) -lssh $(LIBS) |
Damien Miller | 7f6ea02 | 1999-10-28 13:25:17 +1000 | [diff] [blame] | 69 | |
Damien Miller | 34132e5 | 2000-01-14 15:45:46 +1100 | [diff] [blame] | 70 | ssh-add: libssh.a ssh-add.o log-client.o |
Damien Miller | 18ccf85 | 1999-12-16 13:06:18 +1100 | [diff] [blame] | 71 | $(CC) -o $@ ssh-add.o log-client.o $(LDFLAGS) -lssh $(LIBS) |
Damien Miller | 7f6ea02 | 1999-10-28 13:25:17 +1000 | [diff] [blame] | 72 | |
Damien Miller | 34132e5 | 2000-01-14 15:45:46 +1100 | [diff] [blame] | 73 | ssh-agent: libssh.a ssh-agent.o log-client.o |
Damien Miller | 18ccf85 | 1999-12-16 13:06:18 +1100 | [diff] [blame] | 74 | $(CC) -o $@ ssh-agent.o log-client.o $(LDFLAGS) -lssh $(LIBS) |
Damien Miller | 7f6ea02 | 1999-10-28 13:25:17 +1000 | [diff] [blame] | 75 | |
Damien Miller | 34132e5 | 2000-01-14 15:45:46 +1100 | [diff] [blame] | 76 | ssh-keygen: libssh.a ssh-keygen.o log-client.o |
Damien Miller | 18ccf85 | 1999-12-16 13:06:18 +1100 | [diff] [blame] | 77 | $(CC) -o $@ ssh-keygen.o log-client.o $(LDFLAGS) -lssh $(LIBS) |
Damien Miller | 7f6ea02 | 1999-10-28 13:25:17 +1000 | [diff] [blame] | 78 | |
Damien Miller | d3dcfaf | 1999-11-09 13:52:33 +1100 | [diff] [blame] | 79 | gnome-ssh-askpass: gnome-ssh-askpass.c |
| 80 | $(CC) $(CFLAGS) $(GNOME_CFLAGS) -o $@ gnome-ssh-askpass.c $(GNOME_LIBS) |
| 81 | |
Damien Miller | 886c63a | 2000-01-20 23:13:36 +1100 | [diff] [blame] | 82 | $(MANPAGES) $(CONFIGFILES):: |
| 83 | $(FIXPATHSCMD) $(srcdir)/$@ |
Damien Miller | 645c598 | 2000-01-03 14:42:09 +1100 | [diff] [blame] | 84 | |
Damien Miller | 34132e5 | 2000-01-14 15:45:46 +1100 | [diff] [blame] | 85 | clean: |
| 86 | rm -f *.o *.a $(TARGETS) config.status config.cache config.log |
Damien Miller | 886c63a | 2000-01-20 23:13:36 +1100 | [diff] [blame] | 87 | rm -f *.out core |
Damien Miller | 34132e5 | 2000-01-14 15:45:46 +1100 | [diff] [blame] | 88 | |
| 89 | distclean: clean |
| 90 | rm -f Makefile config.h core *~ |
| 91 | |
| 92 | mrproper: distclean |
| 93 | |
| 94 | veryclean: distclean |
Damien Miller | 670a4b8 | 2000-01-22 13:53:11 +1100 | [diff] [blame] | 95 | rm -f configure config.h.in *.0 |
| 96 | |
| 97 | catman-do: |
| 98 | @for f in $(TROFFMAN) ; do \ |
| 99 | echo "$$f -> $${f%%.[18]}.0" ; \ |
| 100 | nroff -mandoc $$f | cat -v | sed -e 's/.\^H//g' \ |
| 101 | >$${f%%.[18]}.0 ; \ |
| 102 | done |
Damien Miller | 34132e5 | 2000-01-14 15:45:46 +1100 | [diff] [blame] | 103 | |
Damien Miller | 645c598 | 2000-01-03 14:42:09 +1100 | [diff] [blame] | 104 | install: $(TARGETS) |
Damien Miller | 7d7c60d | 2000-01-26 14:37:48 +1100 | [diff] [blame] | 105 | $(INSTALL) -d $(DESTDIR)$(bindir) |
| 106 | $(INSTALL) -d $(DESTDIR)$(sbindir) |
| 107 | $(INSTALL) -d $(DESTDIR)$(mandir) |
| 108 | $(INSTALL) -d $(DESTDIR)$(mandir)/$(mansubdir)1 |
| 109 | $(INSTALL) -d $(DESTDIR)$(mandir)/$(mansubdir)8 |
Damien Miller | 3aa0fa4 | 2000-01-27 14:15:48 +1100 | [diff] [blame] | 110 | $(INSTALL) -m 4755 -s ssh $(DESTDIR)$(bindir)/ssh |
Damien Miller | 7d7c60d | 2000-01-26 14:37:48 +1100 | [diff] [blame] | 111 | $(INSTALL) -s scp $(DESTDIR)$(bindir)/scp |
| 112 | $(INSTALL) -s ssh-add $(DESTDIR)$(bindir)/ssh-add |
| 113 | $(INSTALL) -s ssh-agent $(DESTDIR)$(bindir)/ssh-agent |
| 114 | $(INSTALL) -s ssh-keygen $(DESTDIR)$(bindir)/ssh-keygen |
| 115 | $(INSTALL) -s sshd $(DESTDIR)$(sbindir)/sshd |
| 116 | $(INSTALL) -m 644 ssh.[01].out $(DESTDIR)$(mandir)/$(mansubdir)1/ssh.1 |
| 117 | $(INSTALL) -m 644 scp.[01].out $(DESTDIR)$(mandir)/$(mansubdir)1/scp.1 |
| 118 | $(INSTALL) -m 644 ssh-add.[01].out $(DESTDIR)$(mandir)/$(mansubdir)1/ssh-add.1 |
| 119 | $(INSTALL) -m 644 ssh-agent.[01].out $(DESTDIR)$(mandir)/$(mansubdir)1/ssh-agent.1 |
| 120 | $(INSTALL) -m 644 ssh-keygen.[01].out $(DESTDIR)$(mandir)/$(mansubdir)1/ssh-keygen.1 |
| 121 | $(INSTALL) -m 644 sshd.[08].out $(DESTDIR)$(mandir)/$(mansubdir)8/sshd.8 |
| 122 | -rm -f $(DESTDIR)$(bindir)/slogin |
| 123 | ln -s ssh $(DESTDIR)$(bindir)/slogin |
| 124 | -rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/slogin.1 |
| 125 | ln -s ssh.1 $(DESTDIR)$(mandir)/$(mansubdir)1/slogin.1 |
Damien Miller | 3d1b22c | 1999-11-12 15:46:08 +1100 | [diff] [blame] | 126 | |
Damien Miller | f066d6e | 1999-11-25 13:40:22 +1100 | [diff] [blame] | 127 | if [ ! -z "@GNOME_ASKPASS@" ] ; then \ |
Damien Miller | 7d7c60d | 2000-01-26 14:37:48 +1100 | [diff] [blame] | 128 | $(INSTALL) -d $(DESTDIR)$(libexecdir) ; \ |
| 129 | $(INSTALL) -d $(DESTDIR)$(libexecdir)/ssh ; \ |
| 130 | $(INSTALL) -s @GNOME_ASKPASS@ $(DESTDIR)${ASKPASS_LOCATION} ; \ |
Damien Miller | 3d1b22c | 1999-11-12 15:46:08 +1100 | [diff] [blame] | 131 | fi |
Damien Miller | 7f6ea02 | 1999-10-28 13:25:17 +1000 | [diff] [blame] | 132 | |
Damien Miller | 7d7c60d | 2000-01-26 14:37:48 +1100 | [diff] [blame] | 133 | if [ ! -f $(DESTDIR)$(sysconfdir)/ssh_config -a ! -f $(DESTDIR)$(sysconfdir)/sshd_config ]; then \ |
| 134 | $(INSTALL) -d $(DESTDIR)$(sysconfdir); \ |
| 135 | $(INSTALL) -m 644 ssh_config.out $(DESTDIR)$(sysconfdir)/ssh_config; \ |
| 136 | $(INSTALL) -m 644 sshd_config.out $(DESTDIR)$(sysconfdir)/sshd_config; \ |
Damien Miller | 296a546 | 1999-11-13 10:48:51 +1100 | [diff] [blame] | 137 | fi |
| 138 | |
Damien Miller | bf1c9b2 | 1999-12-09 10:16:54 +1100 | [diff] [blame] | 139 | uninstallall: uninstall |
Damien Miller | 7d7c60d | 2000-01-26 14:37:48 +1100 | [diff] [blame] | 140 | -rm -f $(DESTDIR)$(sysconfdir)/ssh_config |
| 141 | -rm -f $(DESTDIR)$(sysconfdir)/sshd_config |
| 142 | -rmdir $(DESTDIR)$(sysconfdir) |
| 143 | -rmdir $(DESTDIR)$(bindir) |
| 144 | -rmdir $(DESTDIR)$(sbindir) |
| 145 | -rmdir $(DESTDIR)$(mandir)/$(mansubdir)1 |
| 146 | -rmdir $(DESTDIR)$(mandir)/$(mansubdir)8 |
| 147 | -rmdir $(DESTDIR)$(mandir) |
| 148 | -rmdir $(DESTDIR)$(libexecdir) |
Damien Miller | bf1c9b2 | 1999-12-09 10:16:54 +1100 | [diff] [blame] | 149 | |
| 150 | uninstall: |
Damien Miller | 7d7c60d | 2000-01-26 14:37:48 +1100 | [diff] [blame] | 151 | -rm -f $(DESTDIR)$(bindir)/ssh |
| 152 | -rm -f $(DESTDIR)$(bindir)/scp |
| 153 | -rm -f $(DESTDIR)$(bindir)/ssh-add |
| 154 | -rm -f $(DESTDIR)$(bindir)/ssh-agent |
| 155 | -rm -f $(DESTDIR)$(bindir)/ssh-keygen |
| 156 | -rm -f $(DESTDIR)$(sbindir)/sshd |
| 157 | -rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/ssh.1 |
| 158 | -rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/scp.1 |
| 159 | -rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/ssh-add.1 |
| 160 | -rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/ssh-agent.1 |
| 161 | -rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/ssh-keygen.1 |
| 162 | -rm -f $(DESTDIR)$(mandir)/$(mansubdir)8/sshd.8 |
| 163 | -rm -f $(DESTDIR)$(bindir)/slogin |
| 164 | -rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/slogin.1 |
| 165 | -rm -f $(DESTDIR)${ASKPASS_PROGRAM} |
| 166 | -rmdir $(DESTDIR)$(libexecdir)/ssh ; |