]>
Commit | Line | Data |
---|---|---|
5881cd60 | 1 | prefix=@prefix@ |
2 | exec_prefix=@exec_prefix@ | |
3 | bindir=@bindir@ | |
4 | sbindir=@sbindir@ | |
42b89914 | 5 | libexecdir=@libexecdir@ |
bb0dd7f6 | 6 | mandir=@mandir@ |
c54a6257 | 7 | mansubdir=@mansubdir@ |
af381f02 | 8 | sysconfdir=@sysconfdir@ |
19d9ac2a | 9 | piddir=@piddir@ |
10 | srcdir=@srcdir@ | |
11 | top_srcdir=@top_srcdir@ | |
5881cd60 | 12 | |
ff8ecdb8 | 13 | DESTDIR= |
14 | ||
d2dcff5f | 15 | VPATH=@srcdir@ |
16 | ||
d4f11b59 | 17 | SSH_PROGRAM=@bindir@/ssh |
bc7ea646 | 18 | ASKPASS_LOCATION=@libexecdir@/ssh |
19 | ASKPASS_PROGRAM=$(ASKPASS_LOCATION)/ssh-askpass | |
d4f11b59 | 20 | |
5881cd60 | 21 | CC=@CC@ |
db28aeb5 | 22 | PATHS=-DETCDIR=\"$(sysconfdir)\" -DSSH_PROGRAM=\"$(SSH_PROGRAM)\" -DSSH_ASKPASS_DEFAULT=\"$(ASKPASS_PROGRAM)\" |
d4f11b59 | 23 | CFLAGS=@CFLAGS@ $(PATHS) @DEFS@ |
17f0f4a7 | 24 | LIBS=@LIBS@ |
5881cd60 | 25 | AR=@AR@ |
26 | RANLIB=@RANLIB@ | |
cf8dd513 | 27 | INSTALL=@INSTALL@ |
a0f84251 | 28 | PERL=@PERL@ |
6cfb695b | 29 | LDFLAGS=-L. @LDFLAGS@ |
5881cd60 | 30 | |
48e671d5 | 31 | TARGETS=ssh sshd ssh-add ssh-keygen ssh-agent scp $(EXTRA_TARGETS) |
32 | ||
69c76614 | 33 | 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 |
6cfb695b | 34 | |
a5c9cd31 | 35 | SSHOBJS= ssh.o sshconnect.o log-client.o readconf.o clientloop.o |
36 | ||
48e671d5 | 37 | 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 |
a5c9cd31 | 38 | |
c54a6257 | 39 | TROFFMAN = scp.1 ssh-add.1 ssh-agent.1 ssh-keygen.1 ssh.1 sshd.8 |
40 | CATMAN = scp.0 ssh-add.0 ssh-agent.0 ssh-keygen.0 ssh.0 sshd.0 | |
41 | MANPAGES = @MANTYPE@ | |
a1ec4d79 | 42 | |
43 | CONFIGFILES=sshd_config ssh_config | |
44 | ||
7e31dc81 | 45 | 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 |
5f4fdfae | 46 | |
47 | FIXPATHSCMD = $(PERL) $(srcdir)/fixpaths $(PATHSUBS) | |
48 | ||
48e671d5 | 49 | all: $(TARGETS) $(MANPAGES) $(CONFIGFILES) |
6cfb695b | 50 | |
f74efc8d | 51 | $(LIBOBJS): config.h |
52 | ||
6cfb695b | 53 | libssh.a: $(LIBOBJS) |
54 | $(AR) rv $@ $(LIBOBJS) | |
5881cd60 | 55 | $(RANLIB) $@ |
56 | ||
48e671d5 | 57 | ssh: libssh.a $(SSHOBJS) |
a5c9cd31 | 58 | $(CC) -o $@ $(SSHOBJS) $(LDFLAGS) -lssh $(LIBS) |
5881cd60 | 59 | |
48e671d5 | 60 | sshd: libssh.a $(SSHDOBJS) |
dfb95100 | 61 | $(CC) -o $@ $(SSHDOBJS) $(LDFLAGS) -lssh $(LIBS) |
5881cd60 | 62 | |
48e671d5 | 63 | scp: libssh.a scp.o |
6cfb695b | 64 | $(CC) -o $@ scp.o $(LDFLAGS) -lssh $(LIBS) |
5881cd60 | 65 | |
48e671d5 | 66 | ssh-add: libssh.a ssh-add.o log-client.o |
6cfb695b | 67 | $(CC) -o $@ ssh-add.o log-client.o $(LDFLAGS) -lssh $(LIBS) |
5881cd60 | 68 | |
48e671d5 | 69 | ssh-agent: libssh.a ssh-agent.o log-client.o |
6cfb695b | 70 | $(CC) -o $@ ssh-agent.o log-client.o $(LDFLAGS) -lssh $(LIBS) |
5881cd60 | 71 | |
48e671d5 | 72 | ssh-keygen: libssh.a ssh-keygen.o log-client.o |
6cfb695b | 73 | $(CC) -o $@ ssh-keygen.o log-client.o $(LDFLAGS) -lssh $(LIBS) |
5881cd60 | 74 | |
5f4fdfae | 75 | $(MANPAGES) $(CONFIGFILES):: |
76 | $(FIXPATHSCMD) $(srcdir)/$@ | |
e1a9c08d | 77 | |
48e671d5 | 78 | clean: |
79 | rm -f *.o *.a $(TARGETS) config.status config.cache config.log | |
5f4fdfae | 80 | rm -f *.out core |
48e671d5 | 81 | |
82 | distclean: clean | |
83 | rm -f Makefile config.h core *~ | |
84 | ||
85 | mrproper: distclean | |
86 | ||
87 | veryclean: distclean | |
c54a6257 | 88 | rm -f configure config.h.in *.0 |
89 | ||
90 | catman-do: | |
91 | @for f in $(TROFFMAN) ; do \ | |
92 | echo "$$f -> $${f%%.[18]}.0" ; \ | |
93 | nroff -mandoc $$f | cat -v | sed -e 's/.\^H//g' \ | |
94 | >$${f%%.[18]}.0 ; \ | |
95 | done | |
48e671d5 | 96 | |
a1ec4d79 | 97 | install: $(TARGETS) |
ff8ecdb8 | 98 | $(INSTALL) -d $(DESTDIR)$(bindir) |
99 | $(INSTALL) -d $(DESTDIR)$(sbindir) | |
100 | $(INSTALL) -d $(DESTDIR)$(mandir) | |
101 | $(INSTALL) -d $(DESTDIR)$(mandir)/$(mansubdir)1 | |
102 | $(INSTALL) -d $(DESTDIR)$(mandir)/$(mansubdir)8 | |
05e84bdf | 103 | $(INSTALL) -m 4755 -s ssh $(DESTDIR)$(bindir)/ssh |
ff8ecdb8 | 104 | $(INSTALL) -s scp $(DESTDIR)$(bindir)/scp |
105 | $(INSTALL) -s ssh-add $(DESTDIR)$(bindir)/ssh-add | |
106 | $(INSTALL) -s ssh-agent $(DESTDIR)$(bindir)/ssh-agent | |
107 | $(INSTALL) -s ssh-keygen $(DESTDIR)$(bindir)/ssh-keygen | |
108 | $(INSTALL) -s sshd $(DESTDIR)$(sbindir)/sshd | |
109 | $(INSTALL) -m 644 ssh.[01].out $(DESTDIR)$(mandir)/$(mansubdir)1/ssh.1 | |
110 | $(INSTALL) -m 644 scp.[01].out $(DESTDIR)$(mandir)/$(mansubdir)1/scp.1 | |
111 | $(INSTALL) -m 644 ssh-add.[01].out $(DESTDIR)$(mandir)/$(mansubdir)1/ssh-add.1 | |
112 | $(INSTALL) -m 644 ssh-agent.[01].out $(DESTDIR)$(mandir)/$(mansubdir)1/ssh-agent.1 | |
113 | $(INSTALL) -m 644 ssh-keygen.[01].out $(DESTDIR)$(mandir)/$(mansubdir)1/ssh-keygen.1 | |
114 | $(INSTALL) -m 644 sshd.[08].out $(DESTDIR)$(mandir)/$(mansubdir)8/sshd.8 | |
115 | -rm -f $(DESTDIR)$(bindir)/slogin | |
116 | ln -s ssh $(DESTDIR)$(bindir)/slogin | |
117 | -rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/slogin.1 | |
118 | ln -s ssh.1 $(DESTDIR)$(mandir)/$(mansubdir)1/slogin.1 | |
045672f9 | 119 | |
ff8ecdb8 | 120 | if [ ! -f $(DESTDIR)$(sysconfdir)/ssh_config -a ! -f $(DESTDIR)$(sysconfdir)/sshd_config ]; then \ |
121 | $(INSTALL) -d $(DESTDIR)$(sysconfdir); \ | |
122 | $(INSTALL) -m 644 ssh_config.out $(DESTDIR)$(sysconfdir)/ssh_config; \ | |
123 | $(INSTALL) -m 644 sshd_config.out $(DESTDIR)$(sysconfdir)/sshd_config; \ | |
af381f02 | 124 | fi |
125 | ||
6bf4d066 | 126 | host-key: ssh-keygen |
127 | ./ssh-keygen -b 1024 -f $(sysconfdir)/ssh_host_key -N '' | |
128 | ||
8946db53 | 129 | uninstallall: uninstall |
ff8ecdb8 | 130 | -rm -f $(DESTDIR)$(sysconfdir)/ssh_config |
131 | -rm -f $(DESTDIR)$(sysconfdir)/sshd_config | |
132 | -rmdir $(DESTDIR)$(sysconfdir) | |
133 | -rmdir $(DESTDIR)$(bindir) | |
134 | -rmdir $(DESTDIR)$(sbindir) | |
135 | -rmdir $(DESTDIR)$(mandir)/$(mansubdir)1 | |
136 | -rmdir $(DESTDIR)$(mandir)/$(mansubdir)8 | |
137 | -rmdir $(DESTDIR)$(mandir) | |
138 | -rmdir $(DESTDIR)$(libexecdir) | |
8946db53 | 139 | |
140 | uninstall: | |
ff8ecdb8 | 141 | -rm -f $(DESTDIR)$(bindir)/ssh |
142 | -rm -f $(DESTDIR)$(bindir)/scp | |
143 | -rm -f $(DESTDIR)$(bindir)/ssh-add | |
144 | -rm -f $(DESTDIR)$(bindir)/ssh-agent | |
145 | -rm -f $(DESTDIR)$(bindir)/ssh-keygen | |
146 | -rm -f $(DESTDIR)$(sbindir)/sshd | |
147 | -rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/ssh.1 | |
148 | -rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/scp.1 | |
149 | -rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/ssh-add.1 | |
150 | -rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/ssh-agent.1 | |
151 | -rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/ssh-keygen.1 | |
152 | -rm -f $(DESTDIR)$(mandir)/$(mansubdir)8/sshd.8 | |
153 | -rm -f $(DESTDIR)$(bindir)/slogin | |
154 | -rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/slogin.1 | |
155 | -rm -f $(DESTDIR)${ASKPASS_PROGRAM} | |
156 | -rmdir $(DESTDIR)$(libexecdir)/ssh ; |