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