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