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