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 | 166bd44 | 2000-03-16 10:48:25 +1100 | [diff] [blame] | 22 | LD=@LD@ |
Damien Miller | 3bc14dd | 1999-12-07 14:54:53 +1100 | [diff] [blame] | 23 | PATHS=-DETCDIR=\"$(sysconfdir)\" -DSSH_PROGRAM=\"$(SSH_PROGRAM)\" -DSSH_ASKPASS_DEFAULT=\"$(ASKPASS_PROGRAM)\" |
Damien Miller | c7b38ce | 1999-11-09 10:28:04 +1100 | [diff] [blame] | 24 | CFLAGS=@CFLAGS@ $(PATHS) @DEFS@ |
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 | 34132e5 | 2000-01-14 15:45:46 +1100 | [diff] [blame] | 32 | TARGETS=ssh sshd ssh-add ssh-keygen ssh-agent scp $(EXTRA_TARGETS) |
Damien Miller | 7f6ea02 | 1999-10-28 13:25:17 +1000 | [diff] [blame] | 33 | |
Damien Miller | 33b1356 | 2000-04-04 14:38:59 +1000 | [diff] [blame] | 34 | LIBOBJS= atomicio.o authfd.o authfile.o bsd-bindresvport.o bsd-daemon.o bsd-misc.o bsd-mktemp.o bsd-rresvport.o bsd-setenv.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 dispatch.o dsa.o fake-getaddrinfo.o fake-getnameinfo.o fingerprint.o hmac.o hostfile.o key.o kex.o log.o match.o mpaux.o nchan.o packet.o radix.o entropy.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] | 35 | |
Damien Miller | e72b7af | 1999-12-30 15:08:44 +1100 | [diff] [blame] | 36 | SSHOBJS= ssh.o sshconnect.o log-client.o readconf.o clientloop.o |
| 37 | |
Damien Miller | b38eff8 | 2000-04-01 11:09:21 +1000 | [diff] [blame] | 38 | 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 session.o auth.o |
Damien Miller | e72b7af | 1999-12-30 15:08:44 +1100 | [diff] [blame] | 39 | |
Damien Miller | 670a4b8 | 2000-01-22 13:53:11 +1100 | [diff] [blame] | 40 | TROFFMAN = scp.1 ssh-add.1 ssh-agent.1 ssh-keygen.1 ssh.1 sshd.8 |
| 41 | CATMAN = scp.0 ssh-add.0 ssh-agent.0 ssh-keygen.0 ssh.0 sshd.0 |
| 42 | MANPAGES = @MANTYPE@ |
Damien Miller | 645c598 | 2000-01-03 14:42:09 +1100 | [diff] [blame] | 43 | |
| 44 | CONFIGFILES=sshd_config ssh_config |
| 45 | |
Damien Miller | 6d84493 | 2000-01-26 12:17:50 +1100 | [diff] [blame] | 46 | 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] | 47 | |
| 48 | FIXPATHSCMD = $(PERL) $(srcdir)/fixpaths $(PATHSUBS) |
| 49 | |
Damien Miller | 74a333b | 2000-04-04 15:04:09 +1000 | [diff] [blame^] | 50 | all: $(TARGETS) $(CONFIGFILES) |
| 51 | |
| 52 | manpages: $(MANPAGES) |
Damien Miller | 18ccf85 | 1999-12-16 13:06:18 +1100 | [diff] [blame] | 53 | |
Damien Miller | 32b3cf2 | 1999-12-26 10:21:48 +1100 | [diff] [blame] | 54 | $(LIBOBJS): config.h |
| 55 | |
Damien Miller | 18ccf85 | 1999-12-16 13:06:18 +1100 | [diff] [blame] | 56 | libssh.a: $(LIBOBJS) |
| 57 | $(AR) rv $@ $(LIBOBJS) |
Damien Miller | 7f6ea02 | 1999-10-28 13:25:17 +1000 | [diff] [blame] | 58 | $(RANLIB) $@ |
| 59 | |
Damien Miller | 34132e5 | 2000-01-14 15:45:46 +1100 | [diff] [blame] | 60 | ssh: libssh.a $(SSHOBJS) |
Damien Miller | 166bd44 | 2000-03-16 10:48:25 +1100 | [diff] [blame] | 61 | $(LD) -o $@ $(SSHOBJS) $(LDFLAGS) -lssh $(LIBS) |
Damien Miller | 7f6ea02 | 1999-10-28 13:25:17 +1000 | [diff] [blame] | 62 | |
Damien Miller | 34132e5 | 2000-01-14 15:45:46 +1100 | [diff] [blame] | 63 | sshd: libssh.a $(SSHDOBJS) |
Damien Miller | 166bd44 | 2000-03-16 10:48:25 +1100 | [diff] [blame] | 64 | $(LD) -o $@ $(SSHDOBJS) $(LDFLAGS) -lssh $(LIBS) |
Damien Miller | 7f6ea02 | 1999-10-28 13:25:17 +1000 | [diff] [blame] | 65 | |
Damien Miller | 34132e5 | 2000-01-14 15:45:46 +1100 | [diff] [blame] | 66 | scp: libssh.a scp.o |
Damien Miller | 166bd44 | 2000-03-16 10:48:25 +1100 | [diff] [blame] | 67 | $(LD) -o $@ scp.o $(LDFLAGS) -lssh $(LIBS) |
Damien Miller | 7f6ea02 | 1999-10-28 13:25:17 +1000 | [diff] [blame] | 68 | |
Damien Miller | 34132e5 | 2000-01-14 15:45:46 +1100 | [diff] [blame] | 69 | ssh-add: libssh.a ssh-add.o log-client.o |
Damien Miller | 166bd44 | 2000-03-16 10:48:25 +1100 | [diff] [blame] | 70 | $(LD) -o $@ ssh-add.o log-client.o $(LDFLAGS) -lssh $(LIBS) |
Damien Miller | 7f6ea02 | 1999-10-28 13:25:17 +1000 | [diff] [blame] | 71 | |
Damien Miller | 34132e5 | 2000-01-14 15:45:46 +1100 | [diff] [blame] | 72 | ssh-agent: libssh.a ssh-agent.o log-client.o |
Damien Miller | 166bd44 | 2000-03-16 10:48:25 +1100 | [diff] [blame] | 73 | $(LD) -o $@ ssh-agent.o log-client.o $(LDFLAGS) -lssh $(LIBS) |
Damien Miller | 7f6ea02 | 1999-10-28 13:25:17 +1000 | [diff] [blame] | 74 | |
Damien Miller | 34132e5 | 2000-01-14 15:45:46 +1100 | [diff] [blame] | 75 | ssh-keygen: libssh.a ssh-keygen.o log-client.o |
Damien Miller | 166bd44 | 2000-03-16 10:48:25 +1100 | [diff] [blame] | 76 | $(LD) -o $@ ssh-keygen.o log-client.o $(LDFLAGS) -lssh $(LIBS) |
Damien Miller | 7f6ea02 | 1999-10-28 13:25:17 +1000 | [diff] [blame] | 77 | |
Damien Miller | 886c63a | 2000-01-20 23:13:36 +1100 | [diff] [blame] | 78 | $(MANPAGES) $(CONFIGFILES):: |
| 79 | $(FIXPATHSCMD) $(srcdir)/$@ |
Damien Miller | 645c598 | 2000-01-03 14:42:09 +1100 | [diff] [blame] | 80 | |
Damien Miller | 34132e5 | 2000-01-14 15:45:46 +1100 | [diff] [blame] | 81 | clean: |
| 82 | rm -f *.o *.a $(TARGETS) config.status config.cache config.log |
Damien Miller | 886c63a | 2000-01-20 23:13:36 +1100 | [diff] [blame] | 83 | rm -f *.out core |
Damien Miller | 34132e5 | 2000-01-14 15:45:46 +1100 | [diff] [blame] | 84 | |
| 85 | distclean: clean |
| 86 | rm -f Makefile config.h core *~ |
| 87 | |
| 88 | mrproper: distclean |
| 89 | |
| 90 | veryclean: distclean |
Damien Miller | 670a4b8 | 2000-01-22 13:53:11 +1100 | [diff] [blame] | 91 | rm -f configure config.h.in *.0 |
| 92 | |
| 93 | catman-do: |
| 94 | @for f in $(TROFFMAN) ; do \ |
| 95 | echo "$$f -> $${f%%.[18]}.0" ; \ |
| 96 | nroff -mandoc $$f | cat -v | sed -e 's/.\^H//g' \ |
| 97 | >$${f%%.[18]}.0 ; \ |
| 98 | done |
Damien Miller | 34132e5 | 2000-01-14 15:45:46 +1100 | [diff] [blame] | 99 | |
Damien Miller | 74a333b | 2000-04-04 15:04:09 +1000 | [diff] [blame^] | 100 | install: manpages $(TARGETS) |
Damien Miller | 7d7c60d | 2000-01-26 14:37:48 +1100 | [diff] [blame] | 101 | $(INSTALL) -d $(DESTDIR)$(bindir) |
| 102 | $(INSTALL) -d $(DESTDIR)$(sbindir) |
| 103 | $(INSTALL) -d $(DESTDIR)$(mandir) |
| 104 | $(INSTALL) -d $(DESTDIR)$(mandir)/$(mansubdir)1 |
| 105 | $(INSTALL) -d $(DESTDIR)$(mandir)/$(mansubdir)8 |
Damien Miller | 3aa0fa4 | 2000-01-27 14:15:48 +1100 | [diff] [blame] | 106 | $(INSTALL) -m 4755 -s ssh $(DESTDIR)$(bindir)/ssh |
Damien Miller | 7d7c60d | 2000-01-26 14:37:48 +1100 | [diff] [blame] | 107 | $(INSTALL) -s scp $(DESTDIR)$(bindir)/scp |
| 108 | $(INSTALL) -s ssh-add $(DESTDIR)$(bindir)/ssh-add |
| 109 | $(INSTALL) -s ssh-agent $(DESTDIR)$(bindir)/ssh-agent |
| 110 | $(INSTALL) -s ssh-keygen $(DESTDIR)$(bindir)/ssh-keygen |
| 111 | $(INSTALL) -s sshd $(DESTDIR)$(sbindir)/sshd |
| 112 | $(INSTALL) -m 644 ssh.[01].out $(DESTDIR)$(mandir)/$(mansubdir)1/ssh.1 |
| 113 | $(INSTALL) -m 644 scp.[01].out $(DESTDIR)$(mandir)/$(mansubdir)1/scp.1 |
| 114 | $(INSTALL) -m 644 ssh-add.[01].out $(DESTDIR)$(mandir)/$(mansubdir)1/ssh-add.1 |
| 115 | $(INSTALL) -m 644 ssh-agent.[01].out $(DESTDIR)$(mandir)/$(mansubdir)1/ssh-agent.1 |
| 116 | $(INSTALL) -m 644 ssh-keygen.[01].out $(DESTDIR)$(mandir)/$(mansubdir)1/ssh-keygen.1 |
| 117 | $(INSTALL) -m 644 sshd.[08].out $(DESTDIR)$(mandir)/$(mansubdir)8/sshd.8 |
| 118 | -rm -f $(DESTDIR)$(bindir)/slogin |
| 119 | ln -s ssh $(DESTDIR)$(bindir)/slogin |
| 120 | -rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/slogin.1 |
| 121 | ln -s ssh.1 $(DESTDIR)$(mandir)/$(mansubdir)1/slogin.1 |
Damien Miller | 3d1b22c | 1999-11-12 15:46:08 +1100 | [diff] [blame] | 122 | |
Damien Miller | 7d7c60d | 2000-01-26 14:37:48 +1100 | [diff] [blame] | 123 | if [ ! -f $(DESTDIR)$(sysconfdir)/ssh_config -a ! -f $(DESTDIR)$(sysconfdir)/sshd_config ]; then \ |
| 124 | $(INSTALL) -d $(DESTDIR)$(sysconfdir); \ |
| 125 | $(INSTALL) -m 644 ssh_config.out $(DESTDIR)$(sysconfdir)/ssh_config; \ |
| 126 | $(INSTALL) -m 644 sshd_config.out $(DESTDIR)$(sysconfdir)/sshd_config; \ |
Damien Miller | 296a546 | 1999-11-13 10:48:51 +1100 | [diff] [blame] | 127 | fi |
| 128 | |
Damien Miller | 4095f89 | 2000-03-03 22:13:52 +1100 | [diff] [blame] | 129 | host-key: ssh-keygen |
| 130 | ./ssh-keygen -b 1024 -f $(sysconfdir)/ssh_host_key -N '' |
| 131 | |
Damien Miller | bf1c9b2 | 1999-12-09 10:16:54 +1100 | [diff] [blame] | 132 | uninstallall: uninstall |
Damien Miller | 7d7c60d | 2000-01-26 14:37:48 +1100 | [diff] [blame] | 133 | -rm -f $(DESTDIR)$(sysconfdir)/ssh_config |
| 134 | -rm -f $(DESTDIR)$(sysconfdir)/sshd_config |
| 135 | -rmdir $(DESTDIR)$(sysconfdir) |
| 136 | -rmdir $(DESTDIR)$(bindir) |
| 137 | -rmdir $(DESTDIR)$(sbindir) |
| 138 | -rmdir $(DESTDIR)$(mandir)/$(mansubdir)1 |
| 139 | -rmdir $(DESTDIR)$(mandir)/$(mansubdir)8 |
| 140 | -rmdir $(DESTDIR)$(mandir) |
| 141 | -rmdir $(DESTDIR)$(libexecdir) |
Damien Miller | bf1c9b2 | 1999-12-09 10:16:54 +1100 | [diff] [blame] | 142 | |
| 143 | uninstall: |
Damien Miller | 7d7c60d | 2000-01-26 14:37:48 +1100 | [diff] [blame] | 144 | -rm -f $(DESTDIR)$(bindir)/ssh |
| 145 | -rm -f $(DESTDIR)$(bindir)/scp |
| 146 | -rm -f $(DESTDIR)$(bindir)/ssh-add |
| 147 | -rm -f $(DESTDIR)$(bindir)/ssh-agent |
| 148 | -rm -f $(DESTDIR)$(bindir)/ssh-keygen |
| 149 | -rm -f $(DESTDIR)$(sbindir)/sshd |
| 150 | -rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/ssh.1 |
| 151 | -rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/scp.1 |
| 152 | -rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/ssh-add.1 |
| 153 | -rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/ssh-agent.1 |
| 154 | -rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/ssh-keygen.1 |
| 155 | -rm -f $(DESTDIR)$(mandir)/$(mansubdir)8/sshd.8 |
| 156 | -rm -f $(DESTDIR)$(bindir)/slogin |
| 157 | -rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/slogin.1 |
| 158 | -rm -f $(DESTDIR)${ASKPASS_PROGRAM} |
| 159 | -rmdir $(DESTDIR)$(libexecdir)/ssh ; |