]>
Commit | Line | Data |
---|---|---|
1 | # $Id$ | |
2 | ||
3 | # uncomment if you run a non bourne compatable shell. Ie. csh | |
4 | #SHELL = @SH@ | |
5 | ||
6 | AUTORECONF=autoreconf | |
7 | ||
8 | prefix=@prefix@ | |
9 | exec_prefix=@exec_prefix@ | |
10 | bindir=@bindir@ | |
11 | sbindir=@sbindir@ | |
12 | libexecdir=@libexecdir@ | |
13 | datadir=@datadir@ | |
14 | datarootdir=@datarootdir@ | |
15 | mandir=@mandir@ | |
16 | mansubdir=@mansubdir@ | |
17 | sysconfdir=@sysconfdir@ | |
18 | piddir=@piddir@ | |
19 | srcdir=@srcdir@ | |
20 | top_srcdir=@top_srcdir@ | |
21 | ||
22 | DESTDIR= | |
23 | VPATH=@srcdir@ | |
24 | SSH_PROGRAM=@bindir@/ssh | |
25 | ASKPASS_PROGRAM=$(libexecdir)/ssh-askpass | |
26 | SFTP_SERVER=$(libexecdir)/sftp-server | |
27 | SSH_KEYSIGN=$(libexecdir)/ssh-keysign | |
28 | RAND_HELPER=$(libexecdir)/ssh-rand-helper | |
29 | PRIVSEP_PATH=@PRIVSEP_PATH@ | |
30 | SSH_PRIVSEP_USER=@SSH_PRIVSEP_USER@ | |
31 | STRIP_OPT=@STRIP_OPT@ | |
32 | ||
33 | PATHS= -DSSHDIR=\"$(sysconfdir)\" \ | |
34 | -D_PATH_SSH_PROGRAM=\"$(SSH_PROGRAM)\" \ | |
35 | -D_PATH_SSH_ASKPASS_DEFAULT=\"$(ASKPASS_PROGRAM)\" \ | |
36 | -D_PATH_SFTP_SERVER=\"$(SFTP_SERVER)\" \ | |
37 | -D_PATH_SSH_KEY_SIGN=\"$(SSH_KEYSIGN)\" \ | |
38 | -D_PATH_SSH_PIDDIR=\"$(piddir)\" \ | |
39 | -D_PATH_PRIVSEP_CHROOT_DIR=\"$(PRIVSEP_PATH)\" \ | |
40 | -DSSH_RAND_HELPER=\"$(RAND_HELPER)\" | |
41 | ||
42 | CC=@CC@ | |
43 | LD=@LD@ | |
44 | CFLAGS=@CFLAGS@ | |
45 | CPPFLAGS=-I. -I$(srcdir) @CPPFLAGS@ $(PATHS) @DEFS@ | |
46 | LIBS=@LIBS@ | |
47 | SSHDLIBS=@SSHDLIBS@ | |
48 | LIBEDIT=@LIBEDIT@ | |
49 | AR=@AR@ | |
50 | AWK=@AWK@ | |
51 | RANLIB=@RANLIB@ | |
52 | INSTALL=@INSTALL@ | |
53 | PERL=@PERL@ | |
54 | SED=@SED@ | |
55 | ENT=@ENT@ | |
56 | XAUTH_PATH=@XAUTH_PATH@ | |
57 | LDFLAGS=-L. -Lopenbsd-compat/ @LDFLAGS@ | |
58 | EXEEXT=@EXEEXT@ | |
59 | ||
60 | INSTALL_SSH_PRNG_CMDS=@INSTALL_SSH_PRNG_CMDS@ | |
61 | INSTALL_SSH_RAND_HELPER=@INSTALL_SSH_RAND_HELPER@ | |
62 | INSTALL_GSISSH=@INSTALL_GSISSH@ | |
63 | ||
64 | TARGETS=ssh$(EXEEXT) sshd$(EXEEXT) ssh-add$(EXEEXT) ssh-keygen$(EXEEXT) ssh-keyscan${EXEEXT} ssh-keysign${EXEEXT} ssh-agent$(EXEEXT) scp$(EXEEXT) ssh-rand-helper${EXEEXT} sftp-server$(EXEEXT) sftp$(EXEEXT) | |
65 | ||
66 | LIBSSH_OBJS=acss.o authfd.o authfile.o bufaux.o bufbn.o buffer.o \ | |
67 | canohost.o channels.o cipher.o cipher-acss.o cipher-aes.o \ | |
68 | cipher-bf1.o cipher-ctr.o cipher-3des1.o cleanup.o \ | |
69 | compat.o compress.o crc32.o deattack.o fatal.o hostfile.o \ | |
70 | log.o match.o md-sha256.o moduli.o nchan.o packet.o \ | |
71 | readpass.o rsa.o ttymodes.o xmalloc.o addrmatch.o \ | |
72 | atomicio.o key.o dispatch.o kex.o mac.o uidswap.o uuencode.o misc.o \ | |
73 | monitor_fdpass.o rijndael.o ssh-dss.o ssh-rsa.o dh.o kexdh.o \ | |
74 | kexgex.o kexdhc.o kexgexc.o scard.o msg.o progressmeter.o dns.o \ | |
75 | entropy.o scard-opensc.o gss-genr.o umac.o jpake.o schnorr.o \ | |
76 | kexgssc.o | |
77 | ||
78 | SSHOBJS= ssh.o readconf.o clientloop.o sshtty.o \ | |
79 | sshconnect.o sshconnect1.o sshconnect2.o mux.o \ | |
80 | roaming_common.o | |
81 | ||
82 | SSHDOBJS=sshd.o auth-rhosts.o auth-passwd.o auth-rsa.o auth-rh-rsa.o \ | |
83 | sshpty.o sshlogin.o servconf.o serverloop.o \ | |
84 | auth.o auth1.o auth2.o auth-options.o session.o \ | |
85 | auth-chall.o auth2-chall.o groupaccess.o \ | |
86 | auth-skey.o auth-bsdauth.o auth2-hostbased.o auth2-kbdint.o \ | |
87 | auth2-none.o auth2-passwd.o auth2-pubkey.o auth2-jpake.o \ | |
88 | monitor_mm.o monitor.o monitor_wrap.o kexdhs.o kexgexs.o \ | |
89 | auth-krb5.o \ | |
90 | auth2-gss.o gss-serv.o gss-serv-krb5.o kexgsss.o\ | |
91 | gss-serv-gsi.o \ | |
92 | loginrec.o auth-pam.o auth-shadow.o auth-sia.o md5crypt.o \ | |
93 | audit.o audit-bsm.o platform.o sftp-server.o sftp-common.o \ | |
94 | roaming_common.o ssh-globus-usage.o | |
95 | ||
96 | MANPAGES = moduli.5.out scp.1.out ssh-add.1.out ssh-agent.1.out ssh-keygen.1.out ssh-keyscan.1.out ssh.1.out sshd.8.out sftp-server.8.out sftp.1.out ssh-rand-helper.8.out ssh-keysign.8.out sshd_config.5.out ssh_config.5.out | |
97 | MANPAGES_IN = moduli.5 scp.1 ssh-add.1 ssh-agent.1 ssh-keygen.1 ssh-keyscan.1 ssh.1 sshd.8 sftp-server.8 sftp.1 ssh-rand-helper.8 ssh-keysign.8 sshd_config.5 ssh_config.5 | |
98 | MANTYPE = @MANTYPE@ | |
99 | ||
100 | CONFIGFILES=sshd_config.out ssh_config.out moduli.out | |
101 | CONFIGFILES_IN=sshd_config ssh_config moduli | |
102 | ||
103 | PATHSUBS = \ | |
104 | -e 's|/etc/ssh/ssh_prng_cmds|$(sysconfdir)/ssh_prng_cmds|g' \ | |
105 | -e 's|/etc/ssh/ssh_config|$(sysconfdir)/ssh_config|g' \ | |
106 | -e 's|/etc/ssh/ssh_known_hosts|$(sysconfdir)/ssh_known_hosts|g' \ | |
107 | -e 's|/etc/ssh/sshd_config|$(sysconfdir)/sshd_config|g' \ | |
108 | -e 's|/usr/libexec|$(libexecdir)|g' \ | |
109 | -e 's|/etc/shosts.equiv|$(sysconfdir)/shosts.equiv|g' \ | |
110 | -e 's|/etc/ssh/ssh_host_key|$(sysconfdir)/ssh_host_key|g' \ | |
111 | -e 's|/etc/ssh/ssh_host_dsa_key|$(sysconfdir)/ssh_host_dsa_key|g' \ | |
112 | -e 's|/etc/ssh/ssh_host_rsa_key|$(sysconfdir)/ssh_host_rsa_key|g' \ | |
113 | -e 's|/var/run/sshd.pid|$(piddir)/sshd.pid|g' \ | |
114 | -e 's|/etc/moduli|$(sysconfdir)/moduli|g' \ | |
115 | -e 's|/etc/ssh/moduli|$(sysconfdir)/moduli|g' \ | |
116 | -e 's|/etc/ssh/sshrc|$(sysconfdir)/sshrc|g' \ | |
117 | -e 's|/usr/X11R6/bin/xauth|$(XAUTH_PATH)|g' \ | |
118 | -e 's|/var/empty|$(PRIVSEP_PATH)|g' \ | |
119 | -e 's|/usr/bin:/bin:/usr/sbin:/sbin|@user_path@|g' | |
120 | ||
121 | FIXPATHSCMD = $(SED) $(PATHSUBS) | |
122 | ||
123 | all: $(CONFIGFILES) ssh_prng_cmds.out $(MANPAGES) $(TARGETS) | |
124 | ||
125 | $(LIBSSH_OBJS): Makefile.in config.h | |
126 | $(SSHOBJS): Makefile.in config.h | |
127 | $(SSHDOBJS): Makefile.in config.h | |
128 | ||
129 | .c.o: | |
130 | $(CC) $(CFLAGS) $(CPPFLAGS) -c $< | |
131 | ||
132 | LIBCOMPAT=openbsd-compat/libopenbsd-compat.a | |
133 | $(LIBCOMPAT): always | |
134 | (cd openbsd-compat && $(MAKE)) | |
135 | always: | |
136 | ||
137 | libssh.a: $(LIBSSH_OBJS) | |
138 | $(AR) rv $@ $(LIBSSH_OBJS) | |
139 | $(RANLIB) $@ | |
140 | ||
141 | ssh$(EXEEXT): $(LIBCOMPAT) libssh.a $(SSHOBJS) | |
142 | $(LD) -o $@ $(SSHOBJS) $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS) | |
143 | ||
144 | sshd$(EXEEXT): libssh.a $(LIBCOMPAT) $(SSHDOBJS) | |
145 | $(LD) -o $@ $(SSHDOBJS) $(LDFLAGS) -lssh -lopenbsd-compat $(SSHDLIBS) $(LIBS) | |
146 | ||
147 | scp$(EXEEXT): $(LIBCOMPAT) libssh.a scp.o progressmeter.o | |
148 | $(LD) -o $@ scp.o progressmeter.o bufaux.o $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS) | |
149 | ||
150 | ssh-add$(EXEEXT): $(LIBCOMPAT) libssh.a ssh-add.o | |
151 | $(LD) -o $@ ssh-add.o $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS) | |
152 | ||
153 | ssh-agent$(EXEEXT): $(LIBCOMPAT) libssh.a ssh-agent.o | |
154 | $(LD) -o $@ ssh-agent.o $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS) | |
155 | ||
156 | ssh-keygen$(EXEEXT): $(LIBCOMPAT) libssh.a ssh-keygen.o | |
157 | $(LD) -o $@ ssh-keygen.o $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS) | |
158 | ||
159 | ssh-keysign$(EXEEXT): $(LIBCOMPAT) libssh.a ssh-keysign.o roaming_dummy.o | |
160 | $(LD) -o $@ ssh-keysign.o readconf.o roaming_dummy.o $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS) | |
161 | ||
162 | ssh-keyscan$(EXEEXT): $(LIBCOMPAT) libssh.a ssh-keyscan.o roaming_dummy.o | |
163 | $(LD) -o $@ ssh-keyscan.o roaming_dummy.o $(LDFLAGS) -lssh -lopenbsd-compat -lssh $(LIBS) | |
164 | ||
165 | sftp-server$(EXEEXT): $(LIBCOMPAT) libssh.a sftp.o sftp-common.o sftp-server.o sftp-server-main.o | |
166 | $(LD) -o $@ sftp-server.o sftp-common.o sftp-server-main.o $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS) | |
167 | ||
168 | sftp$(EXEEXT): $(LIBCOMPAT) libssh.a sftp.o sftp-client.o sftp-common.o sftp-glob.o progressmeter.o | |
169 | $(LD) -o $@ progressmeter.o sftp.o sftp-client.o sftp-common.o sftp-glob.o $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS) $(LIBEDIT) | |
170 | ||
171 | ssh-rand-helper${EXEEXT}: $(LIBCOMPAT) libssh.a ssh-rand-helper.o | |
172 | $(LD) -o $@ ssh-rand-helper.o $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS) | |
173 | ||
174 | # test driver for the loginrec code - not built by default | |
175 | logintest: logintest.o $(LIBCOMPAT) libssh.a loginrec.o | |
176 | $(LD) -o $@ logintest.o $(LDFLAGS) loginrec.o -lopenbsd-compat -lssh $(LIBS) | |
177 | ||
178 | $(MANPAGES): $(MANPAGES_IN) | |
179 | if test "$(MANTYPE)" = "cat"; then \ | |
180 | manpage=$(srcdir)/`echo $@ | sed 's/\.[1-9]\.out$$/\.0/'`; \ | |
181 | else \ | |
182 | manpage=$(srcdir)/`echo $@ | sed 's/\.out$$//'`; \ | |
183 | fi; \ | |
184 | if test "$(MANTYPE)" = "man"; then \ | |
185 | $(FIXPATHSCMD) $${manpage} | $(AWK) -f $(srcdir)/mdoc2man.awk > $@; \ | |
186 | else \ | |
187 | $(FIXPATHSCMD) $${manpage} > $@; \ | |
188 | fi | |
189 | ||
190 | $(CONFIGFILES): $(CONFIGFILES_IN) | |
191 | conffile=`echo $@ | sed 's/.out$$//'`; \ | |
192 | $(FIXPATHSCMD) $(srcdir)/$${conffile} > $@ | |
193 | ||
194 | ssh_prng_cmds.out: ssh_prng_cmds | |
195 | if test ! -z "$(INSTALL_SSH_PRNG_CMDS)"; then \ | |
196 | $(PERL) $(srcdir)/fixprogs ssh_prng_cmds $(ENT); \ | |
197 | fi | |
198 | ||
199 | # fake rule to stop make trying to compile moduli.o into a binary "moduli.o" | |
200 | moduli: | |
201 | echo | |
202 | ||
203 | clean: regressclean | |
204 | rm -f *.o *.a $(TARGETS) logintest config.cache config.log | |
205 | rm -f *.out core survey | |
206 | (cd openbsd-compat && $(MAKE) clean) | |
207 | ||
208 | distclean: regressclean | |
209 | rm -f *.o *.a $(TARGETS) logintest config.cache config.log | |
210 | rm -f *.out core opensshd.init openssh.xml | |
211 | rm -f Makefile buildpkg.sh config.h config.status ssh_prng_cmds | |
212 | rm -f survey.sh openbsd-compat/regress/Makefile *~ | |
213 | rm -rf autom4te.cache | |
214 | (cd openbsd-compat && $(MAKE) distclean) | |
215 | (cd scard && $(MAKE) distclean) | |
216 | if test -d pkg ; then \ | |
217 | rm -fr pkg ; \ | |
218 | fi | |
219 | ||
220 | veryclean: distclean | |
221 | rm -f configure config.h.in *.0 | |
222 | ||
223 | mrproper: veryclean | |
224 | ||
225 | realclean: veryclean | |
226 | ||
227 | catman-do: | |
228 | @for f in $(MANPAGES_IN) ; do \ | |
229 | base=`echo $$f | sed 's/\..*$$//'` ; \ | |
230 | echo "$$f -> $$base.0" ; \ | |
231 | nroff -mandoc $$f | cat -v | sed -e 's/.\^H//g' \ | |
232 | >$$base.0 ; \ | |
233 | done | |
234 | ||
235 | distprep: catman-do | |
236 | $(AUTORECONF) | |
237 | -rm -rf autom4te.cache | |
238 | (cd scard && $(MAKE) -f Makefile.in distprep) | |
239 | ||
240 | install: $(CONFIGFILES) ssh_prng_cmds.out $(MANPAGES) $(TARGETS) install-files install-sysconf host-key check-config | |
241 | install-nokeys: $(CONFIGFILES) ssh_prng_cmds.out $(MANPAGES) $(TARGETS) install-files install-sysconf | |
242 | install-nosysconf: $(CONFIGFILES) ssh_prng_cmds.out $(MANPAGES) $(TARGETS) install-files | |
243 | ||
244 | check-config: | |
245 | -$(DESTDIR)$(sbindir)/sshd -t -f $(DESTDIR)$(sysconfdir)/sshd_config | |
246 | ||
247 | scard-install: | |
248 | (cd scard && env DESTDIR=$(DESTDIR) $(MAKE) DESTDIR=$(DESTDIR) install) | |
249 | ||
250 | install-files: scard-install | |
251 | $(srcdir)/mkinstalldirs $(DESTDIR)$(bindir) | |
252 | $(srcdir)/mkinstalldirs $(DESTDIR)$(sbindir) | |
253 | $(srcdir)/mkinstalldirs $(DESTDIR)$(mandir) | |
254 | $(srcdir)/mkinstalldirs $(DESTDIR)$(datadir) | |
255 | $(srcdir)/mkinstalldirs $(DESTDIR)$(mandir)/$(mansubdir)1 | |
256 | $(srcdir)/mkinstalldirs $(DESTDIR)$(mandir)/$(mansubdir)5 | |
257 | $(srcdir)/mkinstalldirs $(DESTDIR)$(mandir)/$(mansubdir)8 | |
258 | $(srcdir)/mkinstalldirs $(DESTDIR)$(libexecdir) | |
259 | (umask 022 ; $(srcdir)/mkinstalldirs $(DESTDIR)$(PRIVSEP_PATH)) | |
260 | $(INSTALL) -m 0755 $(STRIP_OPT) ssh $(DESTDIR)$(bindir)/ssh | |
261 | $(INSTALL) -m 0755 $(STRIP_OPT) scp $(DESTDIR)$(bindir)/scp | |
262 | $(INSTALL) -m 0755 $(STRIP_OPT) ssh-add $(DESTDIR)$(bindir)/ssh-add | |
263 | $(INSTALL) -m 0755 $(STRIP_OPT) ssh-agent $(DESTDIR)$(bindir)/ssh-agent | |
264 | $(INSTALL) -m 0755 $(STRIP_OPT) ssh-keygen $(DESTDIR)$(bindir)/ssh-keygen | |
265 | $(INSTALL) -m 0755 $(STRIP_OPT) ssh-keyscan $(DESTDIR)$(bindir)/ssh-keyscan | |
266 | $(INSTALL) -m 0755 $(STRIP_OPT) sshd $(DESTDIR)$(sbindir)/sshd | |
267 | if test ! -z "$(INSTALL_SSH_RAND_HELPER)" ; then \ | |
268 | $(INSTALL) -m 0755 $(STRIP_OPT) ssh-rand-helper $(DESTDIR)$(libexecdir)/ssh-rand-helper ; \ | |
269 | fi | |
270 | $(INSTALL) -m 4711 $(STRIP_OPT) ssh-keysign $(DESTDIR)$(SSH_KEYSIGN) | |
271 | $(INSTALL) -m 0755 $(STRIP_OPT) sftp $(DESTDIR)$(bindir)/sftp | |
272 | $(INSTALL) -m 0755 $(STRIP_OPT) sftp-server $(DESTDIR)$(SFTP_SERVER) | |
273 | $(INSTALL) -m 644 ssh.1.out $(DESTDIR)$(mandir)/$(mansubdir)1/ssh.1 | |
274 | $(INSTALL) -m 644 scp.1.out $(DESTDIR)$(mandir)/$(mansubdir)1/scp.1 | |
275 | $(INSTALL) -m 644 ssh-add.1.out $(DESTDIR)$(mandir)/$(mansubdir)1/ssh-add.1 | |
276 | $(INSTALL) -m 644 ssh-agent.1.out $(DESTDIR)$(mandir)/$(mansubdir)1/ssh-agent.1 | |
277 | $(INSTALL) -m 644 ssh-keygen.1.out $(DESTDIR)$(mandir)/$(mansubdir)1/ssh-keygen.1 | |
278 | $(INSTALL) -m 644 ssh-keyscan.1.out $(DESTDIR)$(mandir)/$(mansubdir)1/ssh-keyscan.1 | |
279 | $(INSTALL) -m 644 moduli.5.out $(DESTDIR)$(mandir)/$(mansubdir)5/moduli.5 | |
280 | $(INSTALL) -m 644 sshd_config.5.out $(DESTDIR)$(mandir)/$(mansubdir)5/sshd_config.5 | |
281 | $(INSTALL) -m 644 ssh_config.5.out $(DESTDIR)$(mandir)/$(mansubdir)5/ssh_config.5 | |
282 | $(INSTALL) -m 644 sshd.8.out $(DESTDIR)$(mandir)/$(mansubdir)8/sshd.8 | |
283 | if [ ! -z "$(INSTALL_SSH_RAND_HELPER)" ]; then \ | |
284 | $(INSTALL) -m 644 ssh-rand-helper.8.out $(DESTDIR)$(mandir)/$(mansubdir)8/ssh-rand-helper.8 ; \ | |
285 | fi | |
286 | $(INSTALL) -m 644 sftp.1.out $(DESTDIR)$(mandir)/$(mansubdir)1/sftp.1 | |
287 | $(INSTALL) -m 644 sftp-server.8.out $(DESTDIR)$(mandir)/$(mansubdir)8/sftp-server.8 | |
288 | $(INSTALL) -m 644 ssh-keysign.8.out $(DESTDIR)$(mandir)/$(mansubdir)8/ssh-keysign.8 | |
289 | -rm -f $(DESTDIR)$(bindir)/slogin | |
290 | ln -s ./ssh$(EXEEXT) $(DESTDIR)$(bindir)/slogin | |
291 | -rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/slogin.1 | |
292 | ln -s ./ssh.1 $(DESTDIR)$(mandir)/$(mansubdir)1/slogin.1 | |
293 | if [ ! -z "$(INSTALL_GSISSH)" ]; then \ | |
294 | rm -f $(DESTDIR)$(bindir)/gsissh; \ | |
295 | ln -s ./ssh$(EXEEXT) $(DESTDIR)$(bindir)/gsissh; \ | |
296 | rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/gsissh.1; \ | |
297 | ln -s ./ssh.1 $(DESTDIR)$(mandir)/$(mansubdir)1/gsissh.1; \ | |
298 | rm -f $(DESTDIR)$(bindir)/gsiscp; \ | |
299 | ln -s ./scp$(EXEEXT) $(DESTDIR)$(bindir)/gsiscp; \ | |
300 | rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/gsiscp.1; \ | |
301 | ln -s ./scp.1 $(DESTDIR)$(mandir)/$(mansubdir)1/gsiscp.1; \ | |
302 | rm -f $(DESTDIR)$(bindir)/gsisftp; \ | |
303 | ln -s ./sftp$(EXEEXT) $(DESTDIR)$(bindir)/gsisftp; \ | |
304 | rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/gsisftp.1; \ | |
305 | ln -s ./sftp.1 $(DESTDIR)$(mandir)/$(mansubdir)1/gsisftp.1; \ | |
306 | fi | |
307 | ||
308 | install-sysconf: | |
309 | if [ ! -d $(DESTDIR)$(sysconfdir) ]; then \ | |
310 | $(srcdir)/mkinstalldirs $(DESTDIR)$(sysconfdir); \ | |
311 | fi | |
312 | @if [ ! -f $(DESTDIR)$(sysconfdir)/ssh_config ]; then \ | |
313 | $(INSTALL) -m 644 ssh_config.out $(DESTDIR)$(sysconfdir)/ssh_config; \ | |
314 | else \ | |
315 | echo "$(DESTDIR)$(sysconfdir)/ssh_config already exists, install will not overwrite"; \ | |
316 | fi | |
317 | @if [ ! -f $(DESTDIR)$(sysconfdir)/sshd_config ]; then \ | |
318 | $(INSTALL) -m 644 sshd_config.out $(DESTDIR)$(sysconfdir)/sshd_config; \ | |
319 | else \ | |
320 | echo "$(DESTDIR)$(sysconfdir)/sshd_config already exists, install will not overwrite"; \ | |
321 | fi | |
322 | @if [ -f ssh_prng_cmds ] && [ ! -z "$(INSTALL_SSH_PRNG_CMDS)" ]; then \ | |
323 | if [ ! -f $(DESTDIR)$(sysconfdir)/ssh_prng_cmds ] ; then \ | |
324 | $(INSTALL) -m 644 ssh_prng_cmds.out $(DESTDIR)$(sysconfdir)/ssh_prng_cmds; \ | |
325 | else \ | |
326 | echo "$(DESTDIR)$(sysconfdir)/ssh_prng_cmds already exists, install will not overwrite"; \ | |
327 | fi ; \ | |
328 | fi | |
329 | @if [ ! -f $(DESTDIR)$(sysconfdir)/moduli ]; then \ | |
330 | if [ -f $(DESTDIR)$(sysconfdir)/primes ]; then \ | |
331 | echo "moving $(DESTDIR)$(sysconfdir)/primes to $(DESTDIR)$(sysconfdir)/moduli"; \ | |
332 | mv "$(DESTDIR)$(sysconfdir)/primes" "$(DESTDIR)$(sysconfdir)/moduli"; \ | |
333 | else \ | |
334 | $(INSTALL) -m 644 moduli.out $(DESTDIR)$(sysconfdir)/moduli; \ | |
335 | fi ; \ | |
336 | else \ | |
337 | echo "$(DESTDIR)$(sysconfdir)/moduli already exists, install will not overwrite"; \ | |
338 | fi | |
339 | ||
340 | host-key: ssh-keygen$(EXEEXT) | |
341 | @if [ -z "$(DESTDIR)" ] ; then \ | |
342 | if [ -f "$(DESTDIR)$(sysconfdir)/ssh_host_key" ] ; then \ | |
343 | echo "$(DESTDIR)$(sysconfdir)/ssh_host_key already exists, skipping." ; \ | |
344 | else \ | |
345 | ./ssh-keygen -t rsa1 -f $(DESTDIR)$(sysconfdir)/ssh_host_key -N "" ; \ | |
346 | fi ; \ | |
347 | if [ -f $(DESTDIR)$(sysconfdir)/ssh_host_dsa_key ] ; then \ | |
348 | echo "$(DESTDIR)$(sysconfdir)/ssh_host_dsa_key already exists, skipping." ; \ | |
349 | else \ | |
350 | ./ssh-keygen -t dsa -f $(DESTDIR)$(sysconfdir)/ssh_host_dsa_key -N "" ; \ | |
351 | fi ; \ | |
352 | if [ -f $(DESTDIR)$(sysconfdir)/ssh_host_rsa_key ] ; then \ | |
353 | echo "$(DESTDIR)$(sysconfdir)/ssh_host_rsa_key already exists, skipping." ; \ | |
354 | else \ | |
355 | ./ssh-keygen -t rsa -f $(DESTDIR)$(sysconfdir)/ssh_host_rsa_key -N "" ; \ | |
356 | fi ; \ | |
357 | fi ; | |
358 | ||
359 | host-key-force: ssh-keygen$(EXEEXT) | |
360 | ./ssh-keygen -t rsa1 -f $(DESTDIR)$(sysconfdir)/ssh_host_key -N "" | |
361 | ./ssh-keygen -t dsa -f $(DESTDIR)$(sysconfdir)/ssh_host_dsa_key -N "" | |
362 | ./ssh-keygen -t rsa -f $(DESTDIR)$(sysconfdir)/ssh_host_rsa_key -N "" | |
363 | ||
364 | uninstallall: uninstall | |
365 | -rm -f $(DESTDIR)$(sysconfdir)/ssh_config | |
366 | -rm -f $(DESTDIR)$(sysconfdir)/sshd_config | |
367 | -rm -f $(DESTDIR)$(sysconfdir)/ssh_prng_cmds | |
368 | -rmdir $(DESTDIR)$(sysconfdir) | |
369 | -rmdir $(DESTDIR)$(bindir) | |
370 | -rmdir $(DESTDIR)$(sbindir) | |
371 | -rmdir $(DESTDIR)$(mandir)/$(mansubdir)1 | |
372 | -rmdir $(DESTDIR)$(mandir)/$(mansubdir)8 | |
373 | -rmdir $(DESTDIR)$(mandir) | |
374 | -rmdir $(DESTDIR)$(libexecdir) | |
375 | ||
376 | uninstall: | |
377 | -rm -f $(DESTDIR)$(bindir)/slogin | |
378 | if [ ! -z "$(INSTALL_GSISSH)" ]; then \ | |
379 | rm -f $(DESTDIR)$(bindir)/gsiscp; \ | |
380 | rm -f $(DESTDIR)$(bindir)/gsissh; \ | |
381 | rm -f $(DESTDIR)$(bindir)/gsisftp; \ | |
382 | fi | |
383 | -rm -f $(DESTDIR)$(bindir)/ssh$(EXEEXT) | |
384 | -rm -f $(DESTDIR)$(bindir)/scp$(EXEEXT) | |
385 | -rm -f $(DESTDIR)$(bindir)/ssh-add$(EXEEXT) | |
386 | -rm -f $(DESTDIR)$(bindir)/ssh-agent$(EXEEXT) | |
387 | -rm -f $(DESTDIR)$(bindir)/ssh-keygen$(EXEEXT) | |
388 | -rm -f $(DESTDIR)$(bindir)/ssh-keyscan$(EXEEXT) | |
389 | -rm -f $(DESTDIR)$(bindir)/sftp$(EXEEXT) | |
390 | -rm -f $(DESTDIR)$(sbindir)/sshd$(EXEEXT) | |
391 | -rm -r $(DESTDIR)$(SFTP_SERVER)$(EXEEXT) | |
392 | -rm -f $(DESTDIR)$(SSH_KEYSIGN)$(EXEEXT) | |
393 | -rm -f $(DESTDIR)$(RAND_HELPER)$(EXEEXT) | |
394 | -rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/ssh.1 | |
395 | -rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/scp.1 | |
396 | if [ ! -z "$(INSTALL_GSISSH)" ]; then \ | |
397 | rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/gsissh.1; \ | |
398 | rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/gsiscp.1; \ | |
399 | rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/gsisftp.1; \ | |
400 | fi | |
401 | -rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/ssh-add.1 | |
402 | -rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/ssh-agent.1 | |
403 | -rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/ssh-keygen.1 | |
404 | -rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/sftp.1 | |
405 | -rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/ssh-keyscan.1 | |
406 | -rm -f $(DESTDIR)$(mandir)/$(mansubdir)8/sshd.8 | |
407 | -rm -f $(DESTDIR)$(mandir)/$(mansubdir)8/ssh-rand-helper.8 | |
408 | -rm -f $(DESTDIR)$(mandir)/$(mansubdir)8/sftp-server.8 | |
409 | -rm -f $(DESTDIR)$(mandir)/$(mansubdir)8/ssh-keysign.8 | |
410 | -rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/slogin.1 | |
411 | ||
412 | tests interop-tests: $(TARGETS) | |
413 | BUILDDIR=`pwd`; \ | |
414 | [ -d `pwd`/regress ] || mkdir -p `pwd`/regress; \ | |
415 | [ -f `pwd`/regress/Makefile ] || \ | |
416 | ln -s `cd $(srcdir) && pwd`/regress/Makefile `pwd`/regress/Makefile ; \ | |
417 | TEST_SHELL="@TEST_SHELL@"; \ | |
418 | TEST_SSH_SSH="$${BUILDDIR}/ssh"; \ | |
419 | TEST_SSH_SSHD="$${BUILDDIR}/sshd"; \ | |
420 | TEST_SSH_SSHAGENT="$${BUILDDIR}/ssh-agent"; \ | |
421 | TEST_SSH_SSHADD="$${BUILDDIR}/ssh-add"; \ | |
422 | TEST_SSH_SSHKEYGEN="$${BUILDDIR}/ssh-keygen"; \ | |
423 | TEST_SSH_SSHKEYSCAN="$${BUILDDIR}/ssh-keyscan"; \ | |
424 | TEST_SSH_SFTP="$${BUILDDIR}/sftp"; \ | |
425 | TEST_SSH_SFTPSERVER="$${BUILDDIR}/sftp-server"; \ | |
426 | TEST_SSH_PLINK="plink"; \ | |
427 | TEST_SSH_PUTTYGEN="puttygen"; \ | |
428 | TEST_SSH_CONCH="conch"; \ | |
429 | TEST_SSH_IPV6="@TEST_SSH_IPV6@" ; \ | |
430 | cd $(srcdir)/regress || exit $$?; \ | |
431 | $(MAKE) \ | |
432 | .OBJDIR="$${BUILDDIR}/regress" \ | |
433 | .CURDIR="`pwd`" \ | |
434 | BUILDDIR="$${BUILDDIR}" \ | |
435 | OBJ="$${BUILDDIR}/regress/" \ | |
436 | PATH="$${BUILDDIR}:$${PATH}" \ | |
437 | TEST_SHELL="$${TEST_SHELL}" \ | |
438 | TEST_SSH_SSH="$${TEST_SSH_SSH}" \ | |
439 | TEST_SSH_SSHD="$${TEST_SSH_SSHD}" \ | |
440 | TEST_SSH_SSHAGENT="$${TEST_SSH_SSHAGENT}" \ | |
441 | TEST_SSH_SSHADD="$${TEST_SSH_SSHADD}" \ | |
442 | TEST_SSH_SSHKEYGEN="$${TEST_SSH_SSHKEYGEN}" \ | |
443 | TEST_SSH_SSHKEYSCAN="$${TEST_SSH_SSHKEYSCAN}" \ | |
444 | TEST_SSH_SFTP="$${TEST_SSH_SFTP}" \ | |
445 | TEST_SSH_SFTPSERVER="$${TEST_SSH_SFTPSERVER}" \ | |
446 | TEST_SSH_PLINK="$${TEST_SSH_PLINK}" \ | |
447 | TEST_SSH_PUTTYGEN="$${TEST_SSH_PUTTYGEN}" \ | |
448 | TEST_SSH_CONCH="$${TEST_SSH_CONCH}" \ | |
449 | TEST_SSH_IPV6="@TEST_SSH_IPV6@" \ | |
450 | EXEEXT="$(EXEEXT)" \ | |
451 | $@ && echo all tests passed | |
452 | ||
453 | compat-tests: $(LIBCOMPAT) | |
454 | (cd openbsd-compat/regress && $(MAKE)) | |
455 | ||
456 | regressclean: | |
457 | if [ -f regress/Makefile ] && [ -r regress/Makefile ]; then \ | |
458 | (cd regress && $(MAKE) clean) \ | |
459 | fi | |
460 | ||
461 | survey: survey.sh ssh | |
462 | @$(SHELL) ./survey.sh > survey | |
463 | @echo 'The survey results have been placed in the file "survey" in the' | |
464 | @echo 'current directory. Please review the file then send with' | |
465 | @echo '"make send-survey".' | |
466 | ||
467 | send-survey: survey | |
468 | mail portable-survey@mindrot.org <survey | |
469 | ||
470 | package: $(CONFIGFILES) ssh_prng_cmds.out $(MANPAGES) $(TARGETS) | |
471 | if [ "@MAKE_PACKAGE_SUPPORTED@" = yes ]; then \ | |
472 | sh buildpkg.sh; \ | |
473 | fi | |
474 |