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