]>
Commit | Line | Data |
---|---|---|
1 | prefix=@prefix@ | |
2 | exec_prefix=@exec_prefix@ | |
3 | bindir=@bindir@ | |
4 | sbindir=@sbindir@ | |
5 | libexecdir=@libexecdir@ | |
6 | mandir=@mandir@ | |
7 | sysconfdir=@sysconfdir@ | |
8 | ||
9 | SSH_PROGRAM=@bindir@/ssh | |
10 | ASKPASS_LOCATION=@libexecdir@/ssh | |
11 | ASKPASS_PROGRAM=$(ASKPASS_LOCATION)/ssh-askpass | |
12 | ||
13 | CC=@CC@ | |
14 | PATHS=-DETCDIR=\"$(sysconfdir)\" -DSSH_PROGRAM=\"$(SSH_PROGRAM)\" -DSSH_ASKPASS_DEFAULT=\"$(ASKPASS_PROGRAM)\" | |
15 | CFLAGS=@CFLAGS@ $(PATHS) @DEFS@ | |
16 | EXTRA_TARGETS=@GNOME_ASKPASS@ | |
17 | TARGETS=libssh.a ssh sshd ssh-add ssh-keygen ssh-agent scp $(EXTRA_TARGETS) | |
18 | LIBS=@LIBS@ | |
19 | LIBWRAP=@LIBWRAP@ | |
20 | AR=@AR@ | |
21 | RANLIB=@RANLIB@ | |
22 | INSTALL=@INSTALL@ | |
23 | LDFLAGS=-L. @LDFLAGS@ | |
24 | ||
25 | GNOME_CFLAGS=`gnome-config --cflags gnome gnomeui` | |
26 | GNOME_LIBS=`gnome-config --libs gnome gnomeui` | |
27 | ||
28 | OBJS= atomicio.o authfd.o authfile.o auth-krb4.o auth-passwd.o \ | |
29 | auth-rhosts.o auth-rh-rsa.o auth-rsa.o auth-skey.o bsd-daemon.o \ | |
30 | bsd-login.o bsd-mktemp.o bsd-snprintf.o bsd-strlcat.o bsd-strlcpy.o \ | |
31 | bufaux.o buffer.o canohost.o channels.o cipher.o clientloop.o \ | |
32 | compress.o crc32.o deattack.o helper.o helper.o hostfile.o \ | |
33 | log-client.o login.o log-server.o match.o md5crypt.o mpaux.o \ | |
34 | packet.o pty.o radix.o readconf.o readpass.o rsa.o servconf.o \ | |
35 | serverloop.o sshconnect.o tildexpand.o ttymodes.o uidswap.o \ | |
36 | xmalloc.o | |
37 | ||
38 | LIBOBJS= atomicio.o authfd.o authfile.o bsd-daemon.o bsd-mktemp.o \ | |
39 | bsd-snprintf.o bsd-strlcat.o bsd-strlcpy.o bufaux.o \ | |
40 | buffer.o canohost.o channels.o cipher.o compat.o \ | |
41 | compress.o crc32.o deattack.o fingerprint.o helper.o \ | |
42 | hostfile.o log.o match.o mpaux.o nchan.o packet.o \ | |
43 | radix.o readpass.o rsa.o tildexpand.o ttymodes.o uidswap.o \ | |
44 | xmalloc.o | |
45 | ||
46 | all: $(OBJS) $(TARGETS) | |
47 | ||
48 | $(OBJS): config.h | |
49 | ||
50 | $(LIBOBJS): config.h | |
51 | ||
52 | libssh.a: $(LIBOBJS) | |
53 | $(AR) rv $@ $(LIBOBJS) | |
54 | $(RANLIB) $@ | |
55 | ||
56 | ssh: ssh.o sshconnect.o log-client.o readconf.o clientloop.o libssh.a | |
57 | $(CC) -o $@ ssh.o sshconnect.o log-client.o readconf.o \ | |
58 | clientloop.o $(LDFLAGS) -lssh $(LIBS) | |
59 | ||
60 | sshd: sshd.o auth-rhosts.o auth-krb4.o auth-passwd.o auth-rsa.o \ | |
61 | auth-rh-rsa.o pty.o log-server.o login.o servconf.o serverloop.o \ | |
62 | bsd-login.o md5crypt.o libssh.a | |
63 | $(CC) -o $@ sshd.o auth-rhosts.o auth-krb4.o auth-passwd.o \ | |
64 | auth-rsa.o auth-rh-rsa.o pty.o log-server.o login.o servconf.o \ | |
65 | serverloop.o bsd-login.o md5crypt.o $(LDFLAGS) -lssh $(LIBS) $(LIBWRAP) | |
66 | ||
67 | scp: scp.o libssh.a | |
68 | $(CC) -o $@ scp.o $(LDFLAGS) -lssh $(LIBS) | |
69 | ||
70 | ssh-add: ssh-add.o log-client.o libssh.a | |
71 | $(CC) -o $@ ssh-add.o log-client.o $(LDFLAGS) -lssh $(LIBS) | |
72 | ||
73 | ssh-agent: ssh-agent.o log-client.o libssh.a | |
74 | $(CC) -o $@ ssh-agent.o log-client.o $(LDFLAGS) -lssh $(LIBS) | |
75 | ||
76 | ssh-keygen: ssh-keygen.o log-client.o libssh.a | |
77 | $(CC) -o $@ ssh-keygen.o log-client.o $(LDFLAGS) -lssh $(LIBS) | |
78 | ||
79 | gnome-ssh-askpass: gnome-ssh-askpass.c | |
80 | $(CC) $(CFLAGS) $(GNOME_CFLAGS) -o $@ gnome-ssh-askpass.c $(GNOME_LIBS) | |
81 | ||
82 | clean: | |
83 | rm -f *.o core $(TARGETS) config.status config.cache config.log | |
84 | ||
85 | install: all | |
86 | $(INSTALL) -d $(bindir) | |
87 | $(INSTALL) -d $(sbindir) | |
88 | $(INSTALL) -d $(mandir) | |
89 | $(INSTALL) -d $(mandir)/man1 | |
90 | $(INSTALL) -d $(mandir)/man8 | |
91 | $(INSTALL) -s ssh $(bindir)/ssh | |
92 | $(INSTALL) -s scp $(bindir)/scp | |
93 | $(INSTALL) -s ssh-add $(bindir)/ssh-add | |
94 | $(INSTALL) -s ssh-agent $(bindir)/ssh-agent | |
95 | $(INSTALL) -s ssh-keygen $(bindir)/ssh-keygen | |
96 | $(INSTALL) -s sshd $(sbindir)/sshd | |
97 | $(INSTALL) -m 644 ssh.1 $(mandir)/man1/ssh.1 | |
98 | $(INSTALL) -m 644 scp.1 $(mandir)/man1/scp.1 | |
99 | $(INSTALL) -m 644 ssh-add.1 $(mandir)/man1/ssh-add.1 | |
100 | $(INSTALL) -m 644 ssh-agent.1 $(mandir)/man1/ssh-agent.1 | |
101 | $(INSTALL) -m 644 ssh-keygen.1 $(mandir)/man1/ssh-keygen.1 | |
102 | $(INSTALL) -m 644 sshd.8 $(mandir)/man8/sshd.8 | |
103 | -rm -f $(bindir)/slogin | |
104 | ln -s ssh $(bindir)/slogin | |
105 | -rm -f $(mandir)/man1/slogin.1 | |
106 | ln -s ssh.1 $(mandir)/man1/slogin.1 | |
107 | ||
108 | if [ ! -z "@GNOME_ASKPASS@" ] ; then \ | |
109 | $(INSTALL) -d $(libexecdir) ; \ | |
110 | $(INSTALL) -d $(libexecdir)/ssh ; \ | |
111 | $(INSTALL) -s @GNOME_ASKPASS@ ${ASKPASS_LOCATION} ; \ | |
112 | fi | |
113 | ||
114 | if [ ! -f $(sysconfdir)/ssh_config -a ! -f $(sysconfdir)/sshd_config ]; then \ | |
115 | $(INSTALL) -d $(sysconfdir); \ | |
116 | $(INSTALL) -m 644 ssh_config $(sysconfdir)/ssh_config; \ | |
117 | $(INSTALL) -m 644 sshd_config $(sysconfdir)/sshd_config; \ | |
118 | fi | |
119 | ||
120 | uninstallall: uninstall | |
121 | -rm -f $(sysconfdir)/ssh_config | |
122 | -rm -f $(sysconfdir)/sshd_config | |
123 | -rmdir $(sysconfdir) | |
124 | -rmdir $(bindir) | |
125 | -rmdir $(sbindir) | |
126 | -rmdir $(mandir)/man1 | |
127 | -rmdir $(mandir)/man8 | |
128 | -rmdir $(mandir) | |
129 | -rmdir $(libexecdir) | |
130 | ||
131 | uninstall: | |
132 | -rm -f $(bindir)/ssh | |
133 | -rm -f $(bindir)/scp | |
134 | -rm -f $(bindir)/ssh-add | |
135 | -rm -f $(bindir)/ssh-agent | |
136 | -rm -f $(bindir)/ssh-keygen | |
137 | -rm -f $(sbindir)/sshd | |
138 | -rm -f $(mandir)/man1/ssh.1 | |
139 | -rm -f $(mandir)/man1/scp.1 | |
140 | -rm -f $(mandir)/man1/ssh-add.1 | |
141 | -rm -f $(mandir)/man1/ssh-agent.1 | |
142 | -rm -f $(mandir)/man1/ssh-keygen.1 | |
143 | -rm -f $(mandir)/man8/sshd.8 | |
144 | -rm -f $(bindir)/slogin | |
145 | -rm -f $(mandir)/man1/slogin.1 | |
146 | -rm -f ${ASKPASS_PROGRAM} | |
147 | -rmdir $(libexecdir)/ssh ; | |
148 | ||
149 | distclean: clean | |
150 | rm -f Makefile config.h core *~ | |
151 | ||
152 | mrproper: distclean | |
153 | ||
154 | veryclean: distclean | |
155 | rm -f configure config.h.in | |
156 |