]>
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@ | |
ff7ec503 | 14 | datarootdir=@datarootdir@ |
3c0ef626 | 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 | |
f5799ae1 | 27 | SSH_KEYSIGN=$(libexecdir)/ssh-keysign |
28 | RAND_HELPER=$(libexecdir)/ssh-rand-helper | |
700318f3 | 29 | PRIVSEP_PATH=@PRIVSEP_PATH@ |
680cee3b | 30 | SSH_PRIVSEP_USER=@SSH_PRIVSEP_USER@ |
6a9b3198 | 31 | STRIP_OPT=@STRIP_OPT@ |
3c0ef626 | 32 | |
e9a17296 | 33 | PATHS= -DSSHDIR=\"$(sysconfdir)\" \ |
3c0ef626 | 34 | -D_PATH_SSH_PROGRAM=\"$(SSH_PROGRAM)\" \ |
35 | -D_PATH_SSH_ASKPASS_DEFAULT=\"$(ASKPASS_PROGRAM)\" \ | |
36 | -D_PATH_SFTP_SERVER=\"$(SFTP_SERVER)\" \ | |
f5799ae1 | 37 | -D_PATH_SSH_KEY_SIGN=\"$(SSH_KEYSIGN)\" \ |
e9a17296 | 38 | -D_PATH_SSH_PIDDIR=\"$(piddir)\" \ |
700318f3 | 39 | -D_PATH_PRIVSEP_CHROOT_DIR=\"$(PRIVSEP_PATH)\" \ |
f5799ae1 | 40 | -DSSH_RAND_HELPER=\"$(RAND_HELPER)\" |
3c0ef626 | 41 | |
42 | CC=@CC@ | |
43 | LD=@LD@ | |
44 | CFLAGS=@CFLAGS@ | |
45 | CPPFLAGS=-I. -I$(srcdir) @CPPFLAGS@ $(PATHS) @DEFS@ | |
46 | LIBS=@LIBS@ | |
9108f8d9 | 47 | SSHDLIBS=@SSHDLIBS@ |
996d5e62 | 48 | LIBEDIT=@LIBEDIT@ |
3c0ef626 | 49 | AR=@AR@ |
0fff78ff | 50 | AWK=@AWK@ |
3c0ef626 | 51 | RANLIB=@RANLIB@ |
52 | INSTALL=@INSTALL@ | |
53 | PERL=@PERL@ | |
6a9b3198 | 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@ | |
e9a17296 | 61 | INSTALL_SSH_RAND_HELPER=@INSTALL_SSH_RAND_HELPER@ |
3c0ef626 | 62 | |
6a9b3198 | 63 | 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) |
64 | ||
9108f8d9 | 65 | LIBSSH_OBJS=acss.o authfd.o authfile.o bufaux.o bufbn.o buffer.o \ |
cdd66111 | 66 | canohost.o channels.o cipher.o cipher-acss.o cipher-aes.o \ |
67 | cipher-bf1.o cipher-ctr.o cipher-3des1.o cleanup.o \ | |
68 | compat.o compress.o crc32.o deattack.o fatal.o hostfile.o \ | |
9108f8d9 | 69 | log.o match.o md-sha256.o moduli.o nchan.o packet.o \ |
22616013 | 70 | readpass.o rsa.o ttymodes.o xmalloc.o addrmatch.o \ |
c9f39d2c | 71 | atomicio.o key.o dispatch.o kex.o mac.o uidswap.o uuencode.o misc.o \ |
72 | monitor_fdpass.o rijndael.o ssh-dss.o ssh-rsa.o dh.o kexdh.o \ | |
73 | kexgex.o kexdhc.o kexgexc.o scard.o msg.o progressmeter.o dns.o \ | |
91d9cdd3 | 74 | entropy.o scard-opensc.o gss-genr.o umac.o jpake.o schnorr.o |
6a9b3198 | 75 | |
76 | SSHOBJS= ssh.o readconf.o clientloop.o sshtty.o \ | |
3d738e65 | 77 | sshconnect.o sshconnect1.o sshconnect2.o mux.o \ |
78 | roaming_common.o | |
6a9b3198 | 79 | |
80 | SSHDOBJS=sshd.o auth-rhosts.o auth-passwd.o auth-rsa.o auth-rh-rsa.o \ | |
c9f39d2c | 81 | sshpty.o sshlogin.o servconf.o serverloop.o \ |
6a9b3198 | 82 | auth.o auth1.o auth2.o auth-options.o session.o \ |
83 | auth-chall.o auth2-chall.o groupaccess.o \ | |
84 | auth-skey.o auth-bsdauth.o auth2-hostbased.o auth2-kbdint.o \ | |
91d9cdd3 | 85 | auth2-none.o auth2-passwd.o auth2-pubkey.o auth2-jpake.o \ |
c9f39d2c | 86 | monitor_mm.o monitor.o monitor_wrap.o kexdhs.o kexgexs.o \ |
0fff78ff | 87 | auth-krb5.o \ |
88 | auth2-gss.o gss-serv.o gss-serv-krb5.o \ | |
996d5e62 | 89 | loginrec.o auth-pam.o auth-shadow.o auth-sia.o md5crypt.o \ |
3d738e65 | 90 | audit.o audit-bsm.o platform.o sftp-server.o sftp-common.o \ |
91 | roaming_common.o | |
3c0ef626 | 92 | |
22616013 | 93 | 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 |
94 | 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 | |
3c0ef626 | 95 | MANTYPE = @MANTYPE@ |
96 | ||
97 | CONFIGFILES=sshd_config.out ssh_config.out moduli.out | |
98 | CONFIGFILES_IN=sshd_config ssh_config moduli | |
99 | ||
100 | PATHSUBS = \ | |
6a9b3198 | 101 | -e 's|/etc/ssh/ssh_prng_cmds|$(sysconfdir)/ssh_prng_cmds|g' \ |
102 | -e 's|/etc/ssh/ssh_config|$(sysconfdir)/ssh_config|g' \ | |
103 | -e 's|/etc/ssh/ssh_known_hosts|$(sysconfdir)/ssh_known_hosts|g' \ | |
104 | -e 's|/etc/ssh/sshd_config|$(sysconfdir)/sshd_config|g' \ | |
105 | -e 's|/usr/libexec|$(libexecdir)|g' \ | |
106 | -e 's|/etc/shosts.equiv|$(sysconfdir)/shosts.equiv|g' \ | |
107 | -e 's|/etc/ssh/ssh_host_key|$(sysconfdir)/ssh_host_key|g' \ | |
108 | -e 's|/etc/ssh/ssh_host_dsa_key|$(sysconfdir)/ssh_host_dsa_key|g' \ | |
109 | -e 's|/etc/ssh/ssh_host_rsa_key|$(sysconfdir)/ssh_host_rsa_key|g' \ | |
110 | -e 's|/var/run/sshd.pid|$(piddir)/sshd.pid|g' \ | |
22616013 | 111 | -e 's|/etc/moduli|$(sysconfdir)/moduli|g' \ |
6a9b3198 | 112 | -e 's|/etc/ssh/moduli|$(sysconfdir)/moduli|g' \ |
9108f8d9 | 113 | -e 's|/etc/ssh/sshrc|$(sysconfdir)/sshrc|g' \ |
6a9b3198 | 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 | |
0fff78ff | 120 | all: $(CONFIGFILES) ssh_prng_cmds.out $(MANPAGES) $(TARGETS) |
3c0ef626 | 121 | |
0fff78ff | 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) | |
d4487008 | 142 | $(LD) -o $@ $(SSHDOBJS) $(LDFLAGS) -lssh -lopenbsd-compat $(SSHDLIBS) $(LIBS) |
3c0ef626 | 143 | |
6a9b3198 | 144 | scp$(EXEEXT): $(LIBCOMPAT) libssh.a scp.o progressmeter.o |
2c06c99b | 145 | $(LD) -o $@ scp.o progressmeter.o bufaux.o $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS) |
3c0ef626 | 146 | |
147 | ssh-add$(EXEEXT): $(LIBCOMPAT) libssh.a ssh-add.o | |
cdd66111 | 148 | $(LD) -o $@ ssh-add.o $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS) |
3c0ef626 | 149 | |
150 | ssh-agent$(EXEEXT): $(LIBCOMPAT) libssh.a ssh-agent.o | |
cdd66111 | 151 | $(LD) -o $@ ssh-agent.o $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS) |
3c0ef626 | 152 | |
153 | ssh-keygen$(EXEEXT): $(LIBCOMPAT) libssh.a ssh-keygen.o | |
cdd66111 | 154 | $(LD) -o $@ ssh-keygen.o $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS) |
3c0ef626 | 155 | |
3d738e65 | 156 | ssh-keysign$(EXEEXT): $(LIBCOMPAT) libssh.a ssh-keysign.o roaming_dummy.o |
157 | $(LD) -o $@ ssh-keysign.o readconf.o roaming_dummy.o $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS) | |
f5799ae1 | 158 | |
3d738e65 | 159 | ssh-keyscan$(EXEEXT): $(LIBCOMPAT) libssh.a ssh-keyscan.o roaming_dummy.o |
160 | $(LD) -o $@ ssh-keyscan.o roaming_dummy.o $(LDFLAGS) -lssh -lopenbsd-compat -lssh $(LIBS) | |
3c0ef626 | 161 | |
47686178 | 162 | sftp-server$(EXEEXT): $(LIBCOMPAT) libssh.a sftp.o sftp-common.o sftp-server.o sftp-server-main.o |
163 | $(LD) -o $@ sftp-server.o sftp-common.o sftp-server-main.o $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS) | |
3c0ef626 | 164 | |
cdd66111 | 165 | sftp$(EXEEXT): $(LIBCOMPAT) libssh.a sftp.o sftp-client.o sftp-common.o sftp-glob.o progressmeter.o |
996d5e62 | 166 | $(LD) -o $@ progressmeter.o sftp.o sftp-client.o sftp-common.o sftp-glob.o $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS) $(LIBEDIT) |
3c0ef626 | 167 | |
e9a17296 | 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 \ | |
0fff78ff | 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 | ||
0fff78ff | 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 | ||
665a873d | 196 | # fake rule to stop make trying to compile moduli.o into a binary "moduli.o" |
0fff78ff | 197 | moduli: |
198 | echo | |
199 | ||
acc3d05e | 200 | clean: regressclean |
cdd66111 | 201 | rm -f *.o *.a $(TARGETS) logintest config.cache config.log |
996d5e62 | 202 | rm -f *.out core survey |
3c0ef626 | 203 | (cd openbsd-compat && $(MAKE) clean) |
204 | ||
acc3d05e | 205 | distclean: regressclean |
cdd66111 | 206 | rm -f *.o *.a $(TARGETS) logintest config.cache config.log |
9108f8d9 | 207 | rm -f *.out core opensshd.init openssh.xml |
208 | rm -f Makefile buildpkg.sh config.h config.status ssh_prng_cmds | |
209 | rm -f survey.sh openbsd-compat/regress/Makefile *~ | |
3c0ef626 | 210 | rm -rf autom4te.cache |
211 | (cd openbsd-compat && $(MAKE) distclean) | |
212 | (cd scard && $(MAKE) distclean) | |
c9f39d2c | 213 | if test -d pkg ; then \ |
214 | rm -fr pkg ; \ | |
215 | fi | |
3c0ef626 | 216 | |
0fff78ff | 217 | veryclean: distclean |
3c0ef626 | 218 | rm -f configure config.h.in *.0 |
3c0ef626 | 219 | |
0fff78ff | 220 | mrproper: veryclean |
221 | ||
222 | realclean: veryclean | |
3c0ef626 | 223 | |
224 | catman-do: | |
225 | @for f in $(MANPAGES_IN) ; do \ | |
226 | base=`echo $$f | sed 's/\..*$$//'` ; \ | |
227 | echo "$$f -> $$base.0" ; \ | |
228 | nroff -mandoc $$f | cat -v | sed -e 's/.\^H//g' \ | |
229 | >$$base.0 ; \ | |
230 | done | |
231 | ||
232 | distprep: catman-do | |
700318f3 | 233 | $(AUTORECONF) |
cdd66111 | 234 | -rm -rf autom4te.cache |
3c0ef626 | 235 | (cd scard && $(MAKE) -f Makefile.in distprep) |
236 | ||
996d5e62 | 237 | install: $(CONFIGFILES) ssh_prng_cmds.out $(MANPAGES) $(TARGETS) install-files install-sysconf host-key check-config |
238 | install-nokeys: $(CONFIGFILES) ssh_prng_cmds.out $(MANPAGES) $(TARGETS) install-files install-sysconf | |
239 | install-nosysconf: $(CONFIGFILES) ssh_prng_cmds.out $(MANPAGES) $(TARGETS) install-files | |
3c0ef626 | 240 | |
41b2f314 | 241 | check-config: |
242 | -$(DESTDIR)$(sbindir)/sshd -t -f $(DESTDIR)$(sysconfdir)/sshd_config | |
680cee3b | 243 | |
3c0ef626 | 244 | scard-install: |
3d738e65 | 245 | (cd scard && env DESTDIR=$(DESTDIR) $(MAKE) DESTDIR=$(DESTDIR) install) |
3c0ef626 | 246 | |
247 | install-files: scard-install | |
248 | $(srcdir)/mkinstalldirs $(DESTDIR)$(bindir) | |
249 | $(srcdir)/mkinstalldirs $(DESTDIR)$(sbindir) | |
250 | $(srcdir)/mkinstalldirs $(DESTDIR)$(mandir) | |
251 | $(srcdir)/mkinstalldirs $(DESTDIR)$(datadir) | |
252 | $(srcdir)/mkinstalldirs $(DESTDIR)$(mandir)/$(mansubdir)1 | |
f5799ae1 | 253 | $(srcdir)/mkinstalldirs $(DESTDIR)$(mandir)/$(mansubdir)5 |
3c0ef626 | 254 | $(srcdir)/mkinstalldirs $(DESTDIR)$(mandir)/$(mansubdir)8 |
255 | $(srcdir)/mkinstalldirs $(DESTDIR)$(libexecdir) | |
41b2f314 | 256 | (umask 022 ; $(srcdir)/mkinstalldirs $(DESTDIR)$(PRIVSEP_PATH)) |
6a9b3198 | 257 | $(INSTALL) -m 0755 $(STRIP_OPT) ssh $(DESTDIR)$(bindir)/ssh |
258 | $(INSTALL) -m 0755 $(STRIP_OPT) scp $(DESTDIR)$(bindir)/scp | |
259 | $(INSTALL) -m 0755 $(STRIP_OPT) ssh-add $(DESTDIR)$(bindir)/ssh-add | |
260 | $(INSTALL) -m 0755 $(STRIP_OPT) ssh-agent $(DESTDIR)$(bindir)/ssh-agent | |
261 | $(INSTALL) -m 0755 $(STRIP_OPT) ssh-keygen $(DESTDIR)$(bindir)/ssh-keygen | |
262 | $(INSTALL) -m 0755 $(STRIP_OPT) ssh-keyscan $(DESTDIR)$(bindir)/ssh-keyscan | |
263 | $(INSTALL) -m 0755 $(STRIP_OPT) sshd $(DESTDIR)$(sbindir)/sshd | |
e9a17296 | 264 | if test ! -z "$(INSTALL_SSH_RAND_HELPER)" ; then \ |
6a9b3198 | 265 | $(INSTALL) -m 0755 $(STRIP_OPT) ssh-rand-helper $(DESTDIR)$(libexecdir)/ssh-rand-helper ; \ |
e9a17296 | 266 | fi |
6a9b3198 | 267 | $(INSTALL) -m 4711 $(STRIP_OPT) ssh-keysign $(DESTDIR)$(SSH_KEYSIGN) |
268 | $(INSTALL) -m 0755 $(STRIP_OPT) sftp $(DESTDIR)$(bindir)/sftp | |
269 | $(INSTALL) -m 0755 $(STRIP_OPT) sftp-server $(DESTDIR)$(SFTP_SERVER) | |
3c0ef626 | 270 | $(INSTALL) -m 644 ssh.1.out $(DESTDIR)$(mandir)/$(mansubdir)1/ssh.1 |
271 | $(INSTALL) -m 644 scp.1.out $(DESTDIR)$(mandir)/$(mansubdir)1/scp.1 | |
272 | $(INSTALL) -m 644 ssh-add.1.out $(DESTDIR)$(mandir)/$(mansubdir)1/ssh-add.1 | |
273 | $(INSTALL) -m 644 ssh-agent.1.out $(DESTDIR)$(mandir)/$(mansubdir)1/ssh-agent.1 | |
274 | $(INSTALL) -m 644 ssh-keygen.1.out $(DESTDIR)$(mandir)/$(mansubdir)1/ssh-keygen.1 | |
275 | $(INSTALL) -m 644 ssh-keyscan.1.out $(DESTDIR)$(mandir)/$(mansubdir)1/ssh-keyscan.1 | |
22616013 | 276 | $(INSTALL) -m 644 moduli.5.out $(DESTDIR)$(mandir)/$(mansubdir)5/moduli.5 |
f5799ae1 | 277 | $(INSTALL) -m 644 sshd_config.5.out $(DESTDIR)$(mandir)/$(mansubdir)5/sshd_config.5 |
278 | $(INSTALL) -m 644 ssh_config.5.out $(DESTDIR)$(mandir)/$(mansubdir)5/ssh_config.5 | |
3c0ef626 | 279 | $(INSTALL) -m 644 sshd.8.out $(DESTDIR)$(mandir)/$(mansubdir)8/sshd.8 |
680cee3b | 280 | if [ ! -z "$(INSTALL_SSH_RAND_HELPER)" ]; then \ |
700318f3 | 281 | $(INSTALL) -m 644 ssh-rand-helper.8.out $(DESTDIR)$(mandir)/$(mansubdir)8/ssh-rand-helper.8 ; \ |
282 | fi | |
6a9b3198 | 283 | $(INSTALL) -m 644 sftp.1.out $(DESTDIR)$(mandir)/$(mansubdir)1/sftp.1 |
284 | $(INSTALL) -m 644 sftp-server.8.out $(DESTDIR)$(mandir)/$(mansubdir)8/sftp-server.8 | |
f5799ae1 | 285 | $(INSTALL) -m 644 ssh-keysign.8.out $(DESTDIR)$(mandir)/$(mansubdir)8/ssh-keysign.8 |
3c0ef626 | 286 | -rm -f $(DESTDIR)$(bindir)/slogin |
41b2f314 | 287 | ln -s ./ssh$(EXEEXT) $(DESTDIR)$(bindir)/slogin |
3c0ef626 | 288 | -rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/slogin.1 |
41b2f314 | 289 | ln -s ./ssh.1 $(DESTDIR)$(mandir)/$(mansubdir)1/slogin.1 |
996d5e62 | 290 | |
291 | install-sysconf: | |
3c0ef626 | 292 | if [ ! -d $(DESTDIR)$(sysconfdir) ]; then \ |
293 | $(srcdir)/mkinstalldirs $(DESTDIR)$(sysconfdir); \ | |
294 | fi | |
41b2f314 | 295 | @if [ ! -f $(DESTDIR)$(sysconfdir)/ssh_config ]; then \ |
3c0ef626 | 296 | $(INSTALL) -m 644 ssh_config.out $(DESTDIR)$(sysconfdir)/ssh_config; \ |
297 | else \ | |
298 | echo "$(DESTDIR)$(sysconfdir)/ssh_config already exists, install will not overwrite"; \ | |
299 | fi | |
41b2f314 | 300 | @if [ ! -f $(DESTDIR)$(sysconfdir)/sshd_config ]; then \ |
3c0ef626 | 301 | $(INSTALL) -m 644 sshd_config.out $(DESTDIR)$(sysconfdir)/sshd_config; \ |
302 | else \ | |
303 | echo "$(DESTDIR)$(sysconfdir)/sshd_config already exists, install will not overwrite"; \ | |
304 | fi | |
996d5e62 | 305 | @if [ -f ssh_prng_cmds ] && [ ! -z "$(INSTALL_SSH_PRNG_CMDS)" ]; then \ |
3c0ef626 | 306 | if [ ! -f $(DESTDIR)$(sysconfdir)/ssh_prng_cmds ] ; then \ |
307 | $(INSTALL) -m 644 ssh_prng_cmds.out $(DESTDIR)$(sysconfdir)/ssh_prng_cmds; \ | |
308 | else \ | |
309 | echo "$(DESTDIR)$(sysconfdir)/ssh_prng_cmds already exists, install will not overwrite"; \ | |
310 | fi ; \ | |
311 | fi | |
41b2f314 | 312 | @if [ ! -f $(DESTDIR)$(sysconfdir)/moduli ]; then \ |
3c0ef626 | 313 | if [ -f $(DESTDIR)$(sysconfdir)/primes ]; then \ |
314 | echo "moving $(DESTDIR)$(sysconfdir)/primes to $(DESTDIR)$(sysconfdir)/moduli"; \ | |
315 | mv "$(DESTDIR)$(sysconfdir)/primes" "$(DESTDIR)$(sysconfdir)/moduli"; \ | |
316 | else \ | |
317 | $(INSTALL) -m 644 moduli.out $(DESTDIR)$(sysconfdir)/moduli; \ | |
318 | fi ; \ | |
319 | else \ | |
320 | echo "$(DESTDIR)$(sysconfdir)/moduli already exists, install will not overwrite"; \ | |
321 | fi | |
322 | ||
323 | host-key: ssh-keygen$(EXEEXT) | |
41b2f314 | 324 | @if [ -z "$(DESTDIR)" ] ; then \ |
3c0ef626 | 325 | if [ -f "$(DESTDIR)$(sysconfdir)/ssh_host_key" ] ; then \ |
326 | echo "$(DESTDIR)$(sysconfdir)/ssh_host_key already exists, skipping." ; \ | |
327 | else \ | |
328 | ./ssh-keygen -t rsa1 -f $(DESTDIR)$(sysconfdir)/ssh_host_key -N "" ; \ | |
329 | fi ; \ | |
330 | if [ -f $(DESTDIR)$(sysconfdir)/ssh_host_dsa_key ] ; then \ | |
331 | echo "$(DESTDIR)$(sysconfdir)/ssh_host_dsa_key already exists, skipping." ; \ | |
332 | else \ | |
333 | ./ssh-keygen -t dsa -f $(DESTDIR)$(sysconfdir)/ssh_host_dsa_key -N "" ; \ | |
334 | fi ; \ | |
335 | if [ -f $(DESTDIR)$(sysconfdir)/ssh_host_rsa_key ] ; then \ | |
336 | echo "$(DESTDIR)$(sysconfdir)/ssh_host_rsa_key already exists, skipping." ; \ | |
337 | else \ | |
338 | ./ssh-keygen -t rsa -f $(DESTDIR)$(sysconfdir)/ssh_host_rsa_key -N "" ; \ | |
339 | fi ; \ | |
340 | fi ; | |
341 | ||
342 | host-key-force: ssh-keygen$(EXEEXT) | |
343 | ./ssh-keygen -t rsa1 -f $(DESTDIR)$(sysconfdir)/ssh_host_key -N "" | |
344 | ./ssh-keygen -t dsa -f $(DESTDIR)$(sysconfdir)/ssh_host_dsa_key -N "" | |
345 | ./ssh-keygen -t rsa -f $(DESTDIR)$(sysconfdir)/ssh_host_rsa_key -N "" | |
346 | ||
347 | uninstallall: uninstall | |
348 | -rm -f $(DESTDIR)$(sysconfdir)/ssh_config | |
349 | -rm -f $(DESTDIR)$(sysconfdir)/sshd_config | |
350 | -rm -f $(DESTDIR)$(sysconfdir)/ssh_prng_cmds | |
351 | -rmdir $(DESTDIR)$(sysconfdir) | |
352 | -rmdir $(DESTDIR)$(bindir) | |
353 | -rmdir $(DESTDIR)$(sbindir) | |
354 | -rmdir $(DESTDIR)$(mandir)/$(mansubdir)1 | |
355 | -rmdir $(DESTDIR)$(mandir)/$(mansubdir)8 | |
356 | -rmdir $(DESTDIR)$(mandir) | |
357 | -rmdir $(DESTDIR)$(libexecdir) | |
358 | ||
cdd66111 | 359 | uninstall: |
3c0ef626 | 360 | -rm -f $(DESTDIR)$(bindir)/slogin |
361 | -rm -f $(DESTDIR)$(bindir)/ssh$(EXEEXT) | |
362 | -rm -f $(DESTDIR)$(bindir)/scp$(EXEEXT) | |
363 | -rm -f $(DESTDIR)$(bindir)/ssh-add$(EXEEXT) | |
364 | -rm -f $(DESTDIR)$(bindir)/ssh-agent$(EXEEXT) | |
365 | -rm -f $(DESTDIR)$(bindir)/ssh-keygen$(EXEEXT) | |
366 | -rm -f $(DESTDIR)$(bindir)/ssh-keyscan$(EXEEXT) | |
367 | -rm -f $(DESTDIR)$(bindir)/sftp$(EXEEXT) | |
368 | -rm -f $(DESTDIR)$(sbindir)/sshd$(EXEEXT) | |
369 | -rm -r $(DESTDIR)$(SFTP_SERVER)$(EXEEXT) | |
f5799ae1 | 370 | -rm -f $(DESTDIR)$(SSH_KEYSIGN)$(EXEEXT) |
371 | -rm -f $(DESTDIR)$(RAND_HELPER)$(EXEEXT) | |
3c0ef626 | 372 | -rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/ssh.1 |
373 | -rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/scp.1 | |
374 | -rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/ssh-add.1 | |
375 | -rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/ssh-agent.1 | |
376 | -rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/ssh-keygen.1 | |
377 | -rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/sftp.1 | |
378 | -rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/ssh-keyscan.1 | |
379 | -rm -f $(DESTDIR)$(mandir)/$(mansubdir)8/sshd.8 | |
700318f3 | 380 | -rm -f $(DESTDIR)$(mandir)/$(mansubdir)8/ssh-rand-helper.8 |
3c0ef626 | 381 | -rm -f $(DESTDIR)$(mandir)/$(mansubdir)8/sftp-server.8 |
f5799ae1 | 382 | -rm -f $(DESTDIR)$(mandir)/$(mansubdir)8/ssh-keysign.8 |
3c0ef626 | 383 | -rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/slogin.1 |
0fff78ff | 384 | |
47686178 | 385 | tests interop-tests: $(TARGETS) |
0fff78ff | 386 | BUILDDIR=`pwd`; \ |
387 | [ -d `pwd`/regress ] || mkdir -p `pwd`/regress; \ | |
acc3d05e | 388 | [ -f `pwd`/regress/Makefile ] || \ |
996d5e62 | 389 | ln -s `cd $(srcdir) && pwd`/regress/Makefile `pwd`/regress/Makefile ; \ |
c9f39d2c | 390 | TEST_SHELL="@TEST_SHELL@"; \ |
0fff78ff | 391 | TEST_SSH_SSH="$${BUILDDIR}/ssh"; \ |
392 | TEST_SSH_SSHD="$${BUILDDIR}/sshd"; \ | |
393 | TEST_SSH_SSHAGENT="$${BUILDDIR}/ssh-agent"; \ | |
394 | TEST_SSH_SSHADD="$${BUILDDIR}/ssh-add"; \ | |
395 | TEST_SSH_SSHKEYGEN="$${BUILDDIR}/ssh-keygen"; \ | |
396 | TEST_SSH_SSHKEYSCAN="$${BUILDDIR}/ssh-keyscan"; \ | |
397 | TEST_SSH_SFTP="$${BUILDDIR}/sftp"; \ | |
398 | TEST_SSH_SFTPSERVER="$${BUILDDIR}/sftp-server"; \ | |
47686178 | 399 | TEST_SSH_PLINK="plink"; \ |
400 | TEST_SSH_PUTTYGEN="puttygen"; \ | |
22616013 | 401 | TEST_SSH_CONCH="conch"; \ |
402 | TEST_SSH_IPV6="@TEST_SSH_IPV6@" ; \ | |
0fff78ff | 403 | cd $(srcdir)/regress || exit $$?; \ |
404 | $(MAKE) \ | |
405 | .OBJDIR="$${BUILDDIR}/regress" \ | |
406 | .CURDIR="`pwd`" \ | |
407 | BUILDDIR="$${BUILDDIR}" \ | |
408 | OBJ="$${BUILDDIR}/regress/" \ | |
409 | PATH="$${BUILDDIR}:$${PATH}" \ | |
cdd66111 | 410 | TEST_SHELL="$${TEST_SHELL}" \ |
0fff78ff | 411 | TEST_SSH_SSH="$${TEST_SSH_SSH}" \ |
412 | TEST_SSH_SSHD="$${TEST_SSH_SSHD}" \ | |
413 | TEST_SSH_SSHAGENT="$${TEST_SSH_SSHAGENT}" \ | |
414 | TEST_SSH_SSHADD="$${TEST_SSH_SSHADD}" \ | |
415 | TEST_SSH_SSHKEYGEN="$${TEST_SSH_SSHKEYGEN}" \ | |
416 | TEST_SSH_SSHKEYSCAN="$${TEST_SSH_SSHKEYSCAN}" \ | |
417 | TEST_SSH_SFTP="$${TEST_SSH_SFTP}" \ | |
418 | TEST_SSH_SFTPSERVER="$${TEST_SSH_SFTPSERVER}" \ | |
47686178 | 419 | TEST_SSH_PLINK="$${TEST_SSH_PLINK}" \ |
420 | TEST_SSH_PUTTYGEN="$${TEST_SSH_PUTTYGEN}" \ | |
22616013 | 421 | TEST_SSH_CONCH="$${TEST_SSH_CONCH}" \ |
422 | TEST_SSH_IPV6="@TEST_SSH_IPV6@" \ | |
0fff78ff | 423 | EXEEXT="$(EXEEXT)" \ |
22616013 | 424 | $@ && echo all tests passed |
acc3d05e | 425 | |
9108f8d9 | 426 | compat-tests: $(LIBCOMPAT) |
427 | (cd openbsd-compat/regress && $(MAKE)) | |
428 | ||
acc3d05e | 429 | regressclean: |
996d5e62 | 430 | if [ -f regress/Makefile ] && [ -r regress/Makefile ]; then \ |
acc3d05e | 431 | (cd regress && $(MAKE) clean) \ |
432 | fi | |
c9f39d2c | 433 | |
996d5e62 | 434 | survey: survey.sh ssh |
435 | @$(SHELL) ./survey.sh > survey | |
436 | @echo 'The survey results have been placed in the file "survey" in the' | |
437 | @echo 'current directory. Please review the file then send with' | |
438 | @echo '"make send-survey".' | |
439 | ||
440 | send-survey: survey | |
441 | mail portable-survey@mindrot.org <survey | |
442 | ||
c9f39d2c | 443 | package: $(CONFIGFILES) ssh_prng_cmds.out $(MANPAGES) $(TARGETS) |
444 | if [ "@MAKE_PACKAGE_SUPPORTED@" = yes ]; then \ | |
445 | sh buildpkg.sh; \ | |
446 | fi | |
447 |