Makefile.in revision 137015
1226031Sstas# $Id: Makefile.in,v 1.263 2004/08/15 11:01:37 dtucker Exp $
2226031Sstas
3226031Sstas# uncomment if you run a non bourne compatable shell. Ie. csh
4226031Sstas#SHELL = @SH@
5226031Sstas
6226031SstasAUTORECONF=autoreconf
7226031Sstas
8226031Sstasprefix=@prefix@
9226031Sstasexec_prefix=@exec_prefix@
10226031Sstasbindir=@bindir@
11226031Sstassbindir=@sbindir@
12226031Sstaslibexecdir=@libexecdir@
13226031Sstasdatadir=@datadir@
14226031Sstasmandir=@mandir@
15226031Sstasmansubdir=@mansubdir@
16226031Sstassysconfdir=@sysconfdir@
17226031Sstaspiddir=@piddir@
18226031Sstassrcdir=@srcdir@
19226031Sstastop_srcdir=@top_srcdir@
20226031Sstas
21226031SstasDESTDIR=
22226031SstasVPATH=@srcdir@
23226031SstasSSH_PROGRAM=@bindir@/ssh
24226031SstasASKPASS_PROGRAM=$(libexecdir)/ssh-askpass
25226031SstasSFTP_SERVER=$(libexecdir)/sftp-server
26226031SstasSSH_KEYSIGN=$(libexecdir)/ssh-keysign
27226031SstasRAND_HELPER=$(libexecdir)/ssh-rand-helper
28226031SstasPRIVSEP_PATH=@PRIVSEP_PATH@
29226031SstasSSH_PRIVSEP_USER=@SSH_PRIVSEP_USER@
30226031SstasSTRIP_OPT=@STRIP_OPT@
31226031Sstas
32226031SstasPATHS= -DSSHDIR=\"$(sysconfdir)\" \
33226031Sstas	-D_PATH_SSH_PROGRAM=\"$(SSH_PROGRAM)\" \
34226031Sstas	-D_PATH_SSH_ASKPASS_DEFAULT=\"$(ASKPASS_PROGRAM)\" \
35226031Sstas	-D_PATH_SFTP_SERVER=\"$(SFTP_SERVER)\" \
36226031Sstas	-D_PATH_SSH_KEY_SIGN=\"$(SSH_KEYSIGN)\" \
37226031Sstas	-D_PATH_SSH_PIDDIR=\"$(piddir)\" \
38226031Sstas	-D_PATH_PRIVSEP_CHROOT_DIR=\"$(PRIVSEP_PATH)\" \
39226031Sstas	-DSSH_RAND_HELPER=\"$(RAND_HELPER)\"
40226031Sstas
41226031SstasCC=@CC@
42226031SstasLD=@LD@
43226031SstasCFLAGS=@CFLAGS@
44226031SstasCPPFLAGS=-I. -I$(srcdir) @CPPFLAGS@ $(PATHS) @DEFS@
45226031SstasLIBS=@LIBS@
46226031SstasLIBPAM=@LIBPAM@
47226031SstasLIBWRAP=@LIBWRAP@
48226031SstasAR=@AR@
49226031SstasAWK=@AWK@
50226031SstasRANLIB=@RANLIB@
51226031SstasINSTALL=@INSTALL@
52226031SstasPERL=@PERL@
53226031SstasSED=@SED@
54226031SstasENT=@ENT@
55226031SstasXAUTH_PATH=@XAUTH_PATH@
56226031SstasLDFLAGS=-L. -Lopenbsd-compat/ @LDFLAGS@
57226031SstasEXEEXT=@EXEEXT@
58226031Sstas
59226031SstasINSTALL_SSH_PRNG_CMDS=@INSTALL_SSH_PRNG_CMDS@
60226031SstasINSTALL_SSH_RAND_HELPER=@INSTALL_SSH_RAND_HELPER@
61226031Sstas
62226031SstasTARGETS=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)
63226031Sstas
64226031SstasLIBSSH_OBJS=acss.o authfd.o authfile.o bufaux.o buffer.o \
65226031Sstas	canohost.o channels.o cipher.o cipher-acss.o cipher-aes.o \
66226031Sstas	cipher-bf1.o cipher-ctr.o cipher-3des1.o cleanup.o \
67226031Sstas	compat.o compress.o crc32.o deattack.o fatal.o hostfile.o \
68226031Sstas	log.o match.o moduli.o mpaux.o nchan.o packet.o \
69226031Sstas	readpass.o rsa.o tildexpand.o ttymodes.o xmalloc.o \
70226031Sstas	atomicio.o key.o dispatch.o kex.o mac.o uidswap.o uuencode.o misc.o \
71226031Sstas	monitor_fdpass.o rijndael.o ssh-dss.o ssh-rsa.o dh.o kexdh.o \
72226031Sstas	kexgex.o kexdhc.o kexgexc.o scard.o msg.o progressmeter.o dns.o \
73226031Sstas	entropy.o scard-opensc.o gss-genr.o
74226031Sstas
75226031SstasSSHOBJS= ssh.o readconf.o clientloop.o sshtty.o \
76226031Sstas	sshconnect.o sshconnect1.o sshconnect2.o
77226031Sstas
78226031SstasSSHDOBJS=sshd.o auth-rhosts.o auth-passwd.o auth-rsa.o auth-rh-rsa.o \
79226031Sstas	sshpty.o sshlogin.o servconf.o serverloop.o \
80226031Sstas	auth.o auth1.o auth2.o auth-options.o session.o \
81226031Sstas	auth-chall.o auth2-chall.o groupaccess.o \
82226031Sstas	auth-skey.o auth-bsdauth.o auth2-hostbased.o auth2-kbdint.o \
83226031Sstas	auth2-none.o auth2-passwd.o auth2-pubkey.o \
84226031Sstas	monitor_mm.o monitor.o monitor_wrap.o kexdhs.o kexgexs.o \
85226031Sstas	auth-krb5.o \
86226031Sstas	auth2-gss.o gss-serv.o gss-serv-krb5.o \
87226031Sstas	loginrec.o auth-pam.o auth-shadow.o auth-sia.o md5crypt.o
88226031Sstas
89226031SstasMANPAGES	= 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
90226031SstasMANPAGES_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
91226031SstasMANTYPE		= @MANTYPE@
92226031Sstas
93226031SstasCONFIGFILES=sshd_config.out ssh_config.out moduli.out
94226031SstasCONFIGFILES_IN=sshd_config ssh_config moduli
95226031Sstas
96226031SstasPATHSUBS	= \
97226031Sstas	-e 's|/etc/ssh/ssh_prng_cmds|$(sysconfdir)/ssh_prng_cmds|g' \
98226031Sstas	-e 's|/etc/ssh/ssh_config|$(sysconfdir)/ssh_config|g' \
99226031Sstas	-e 's|/etc/ssh/ssh_known_hosts|$(sysconfdir)/ssh_known_hosts|g' \
100226031Sstas	-e 's|/etc/ssh/sshd_config|$(sysconfdir)/sshd_config|g' \
101226031Sstas	-e 's|/usr/libexec|$(libexecdir)|g' \
102226031Sstas	-e 's|/etc/shosts.equiv|$(sysconfdir)/shosts.equiv|g' \
103226031Sstas	-e 's|/etc/ssh/ssh_host_key|$(sysconfdir)/ssh_host_key|g' \
104226031Sstas	-e 's|/etc/ssh/ssh_host_dsa_key|$(sysconfdir)/ssh_host_dsa_key|g' \
105226031Sstas	-e 's|/etc/ssh/ssh_host_rsa_key|$(sysconfdir)/ssh_host_rsa_key|g' \
106226031Sstas	-e 's|/var/run/sshd.pid|$(piddir)/sshd.pid|g' \
107226031Sstas	-e 's|/etc/ssh/moduli|$(sysconfdir)/moduli|g' \
108226031Sstas	-e 's|/etc/sshrc|$(sysconfdir)/sshrc|g' \
109226031Sstas	-e 's|/usr/X11R6/bin/xauth|$(XAUTH_PATH)|g' \
110226031Sstas	-e 's|/var/empty|$(PRIVSEP_PATH)|g' \
111226031Sstas	-e 's|/usr/bin:/bin:/usr/sbin:/sbin|@user_path@|g'
112226031Sstas
113226031SstasFIXPATHSCMD	= $(SED) $(PATHSUBS)
114226031Sstas
115226031Sstasall: $(CONFIGFILES) ssh_prng_cmds.out $(MANPAGES) $(TARGETS)
116226031Sstas
117226031Sstas$(LIBSSH_OBJS): Makefile.in config.h
118226031Sstas$(SSHOBJS): Makefile.in config.h
119226031Sstas$(SSHDOBJS): Makefile.in config.h
120226031Sstas
121226031Sstas.c.o:
122226031Sstas	$(CC) $(CFLAGS) $(CPPFLAGS) -c $<
123226031Sstas
124226031SstasLIBCOMPAT=openbsd-compat/libopenbsd-compat.a
125226031Sstas$(LIBCOMPAT): always
126226031Sstas	(cd openbsd-compat && $(MAKE))
127226031Sstasalways:
128226031Sstas
129226031Sstaslibssh.a: $(LIBSSH_OBJS)
130226031Sstas	$(AR) rv $@ $(LIBSSH_OBJS)
131226031Sstas	$(RANLIB) $@
132226031Sstas
133226031Sstasssh$(EXEEXT): $(LIBCOMPAT) libssh.a $(SSHOBJS)
134226031Sstas	$(LD) -o $@ $(SSHOBJS) $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS)
135226031Sstas
136226031Sstassshd$(EXEEXT): libssh.a	$(LIBCOMPAT) $(SSHDOBJS)
137226031Sstas	$(LD) -o $@ $(SSHDOBJS) $(LDFLAGS) -lssh -lopenbsd-compat $(LIBWRAP) $(LIBPAM) $(LIBS)
138226031Sstas
139226031Sstasscp$(EXEEXT): $(LIBCOMPAT) libssh.a scp.o progressmeter.o
140226031Sstas	$(LD) -o $@ scp.o progressmeter.o $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS)
141226031Sstas
142226031Sstasssh-add$(EXEEXT): $(LIBCOMPAT) libssh.a ssh-add.o
143226031Sstas	$(LD) -o $@ ssh-add.o $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS)
144226031Sstas
145226031Sstasssh-agent$(EXEEXT): $(LIBCOMPAT) libssh.a ssh-agent.o
146226031Sstas	$(LD) -o $@ ssh-agent.o $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS)
147226031Sstas
148226031Sstasssh-keygen$(EXEEXT): $(LIBCOMPAT) libssh.a ssh-keygen.o
149226031Sstas	$(LD) -o $@ ssh-keygen.o $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS)
150226031Sstas
151226031Sstasssh-keysign$(EXEEXT): $(LIBCOMPAT) libssh.a ssh-keysign.o
152226031Sstas	$(LD) -o $@ ssh-keysign.o readconf.o $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS)
153226031Sstas
154226031Sstasssh-keyscan$(EXEEXT): $(LIBCOMPAT) libssh.a ssh-keyscan.o
155226031Sstas	$(LD) -o $@ ssh-keyscan.o $(LDFLAGS) -lssh -lopenbsd-compat -lssh $(LIBS)
156226031Sstas
157226031Sstassftp-server$(EXEEXT): $(LIBCOMPAT) libssh.a sftp.o sftp-common.o sftp-server.o
158226031Sstas	$(LD) -o $@ sftp-server.o sftp-common.o $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS)
159226031Sstas
160226031Sstassftp$(EXEEXT): $(LIBCOMPAT) libssh.a sftp.o sftp-client.o sftp-common.o sftp-glob.o progressmeter.o
161226031Sstas	$(LD) -o $@ progressmeter.o sftp.o sftp-client.o sftp-common.o sftp-glob.o $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS)
162226031Sstas
163226031Sstasssh-rand-helper${EXEEXT}: $(LIBCOMPAT) libssh.a ssh-rand-helper.o
164226031Sstas	$(LD) -o $@ ssh-rand-helper.o $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS)
165226031Sstas
166226031Sstas# test driver for the loginrec code - not built by default
167226031Sstaslogintest: logintest.o $(LIBCOMPAT) libssh.a loginrec.o
168226031Sstas	$(LD) -o $@ logintest.o $(LDFLAGS) loginrec.o -lopenbsd-compat -lssh $(LIBS)
169226031Sstas
170226031Sstas$(MANPAGES): $(MANPAGES_IN)
171226031Sstas	if test "$(MANTYPE)" = "cat"; then \
172226031Sstas		manpage=$(srcdir)/`echo $@ | sed 's/\.[1-9]\.out$$/\.0/'`; \
173226031Sstas	else \
174226031Sstas		manpage=$(srcdir)/`echo $@ | sed 's/\.out$$//'`; \
175226031Sstas	fi; \
176226031Sstas	if test "$(MANTYPE)" = "man"; then \
177226031Sstas		$(FIXPATHSCMD) $${manpage} | $(AWK) -f $(srcdir)/mdoc2man.awk > $@; \
178226031Sstas	else \
179226031Sstas		$(FIXPATHSCMD) $${manpage} > $@; \
180226031Sstas	fi
181226031Sstas
182226031Sstas$(CONFIGFILES): $(CONFIGFILES_IN)
183226031Sstas	conffile=`echo $@ | sed 's/.out$$//'`; \
184226031Sstas	$(FIXPATHSCMD) $(srcdir)/$${conffile} > $@
185226031Sstas
186226031Sstasssh_prng_cmds.out:	ssh_prng_cmds
187226031Sstas	if test ! -z "$(INSTALL_SSH_PRNG_CMDS)"; then \
188226031Sstas		$(PERL) $(srcdir)/fixprogs ssh_prng_cmds $(ENT); \
189226031Sstas	fi
190226031Sstas
191226031Sstas# fake rule to stop make trying to compile moduli.o into a binary "modulo"
192226031Sstasmoduli:
193226031Sstas	echo
194226031Sstas
195226031Sstasclean:	regressclean
196226031Sstas	rm -f *.o *.a $(TARGETS) logintest config.cache config.log
197226031Sstas	rm -f *.out core
198226031Sstas	(cd openbsd-compat && $(MAKE) clean)
199226031Sstas
200226031Sstasdistclean:	regressclean
201226031Sstas	rm -f *.o *.a $(TARGETS) logintest config.cache config.log
202226031Sstas	rm -f *.out core opensshd.init
203226031Sstas	rm -f Makefile buildpkg.sh config.h config.status ssh_prng_cmds *~
204226031Sstas	rm -rf autom4te.cache
205226031Sstas	(cd openbsd-compat && $(MAKE) distclean)
206226031Sstas	(cd scard && $(MAKE) distclean)
207226031Sstas	if test -d pkg ; then \
208226031Sstas		rm -fr pkg ; \
209226031Sstas	fi
210226031Sstas
211226031Sstasveryclean: distclean
212226031Sstas	rm -f configure config.h.in *.0
213226031Sstas
214226031Sstasmrproper: veryclean
215226031Sstas
216226031Sstasrealclean: veryclean
217226031Sstas
218226031Sstascatman-do:
219226031Sstas	@for f in $(MANPAGES_IN) ; do \
220226031Sstas		base=`echo $$f | sed 's/\..*$$//'` ; \
221226031Sstas		echo "$$f -> $$base.0" ; \
222226031Sstas		nroff -mandoc $$f | cat -v | sed -e 's/.\^H//g' \
223226031Sstas			>$$base.0 ; \
224226031Sstas	done
225226031Sstas
226226031Sstasdistprep: catman-do
227226031Sstas	$(AUTORECONF)
228226031Sstas	-rm -rf autom4te.cache
229226031Sstas	(cd scard && $(MAKE) -f Makefile.in distprep)
230226031Sstas
231226031Sstasinstall: $(CONFIGFILES) ssh_prng_cmds.out $(MANPAGES) $(TARGETS) install-files host-key check-config
232226031Sstasinstall-nokeys: $(CONFIGFILES) ssh_prng_cmds.out $(MANPAGES) $(TARGETS) install-files
233226031Sstas
234226031Sstascheck-config:
235226031Sstas	-$(DESTDIR)$(sbindir)/sshd -t -f $(DESTDIR)$(sysconfdir)/sshd_config
236226031Sstas
237226031Sstasscard-install:
238226031Sstas	(cd scard && $(MAKE) DESTDIR=$(DESTDIR) install)
239226031Sstas
240226031Sstasinstall-files: scard-install
241226031Sstas	$(srcdir)/mkinstalldirs $(DESTDIR)$(bindir)
242226031Sstas	$(srcdir)/mkinstalldirs $(DESTDIR)$(sbindir)
243226031Sstas	$(srcdir)/mkinstalldirs $(DESTDIR)$(mandir)
244226031Sstas	$(srcdir)/mkinstalldirs $(DESTDIR)$(datadir)
245226031Sstas	$(srcdir)/mkinstalldirs $(DESTDIR)$(mandir)/$(mansubdir)1
246226031Sstas	$(srcdir)/mkinstalldirs $(DESTDIR)$(mandir)/$(mansubdir)5
247226031Sstas	$(srcdir)/mkinstalldirs $(DESTDIR)$(mandir)/$(mansubdir)8
248226031Sstas	$(srcdir)/mkinstalldirs $(DESTDIR)$(libexecdir)
249226031Sstas	(umask 022 ; $(srcdir)/mkinstalldirs $(DESTDIR)$(PRIVSEP_PATH))
250226031Sstas	$(INSTALL) -m 0755 $(STRIP_OPT) ssh $(DESTDIR)$(bindir)/ssh
251226031Sstas	$(INSTALL) -m 0755 $(STRIP_OPT) scp $(DESTDIR)$(bindir)/scp
252226031Sstas	$(INSTALL) -m 0755 $(STRIP_OPT) ssh-add $(DESTDIR)$(bindir)/ssh-add
253226031Sstas	$(INSTALL) -m 0755 $(STRIP_OPT) ssh-agent $(DESTDIR)$(bindir)/ssh-agent
254226031Sstas	$(INSTALL) -m 0755 $(STRIP_OPT) ssh-keygen $(DESTDIR)$(bindir)/ssh-keygen
255226031Sstas	$(INSTALL) -m 0755 $(STRIP_OPT) ssh-keyscan $(DESTDIR)$(bindir)/ssh-keyscan
256226031Sstas	$(INSTALL) -m 0755 $(STRIP_OPT) sshd $(DESTDIR)$(sbindir)/sshd
257226031Sstas	if test ! -z "$(INSTALL_SSH_RAND_HELPER)" ; then \
258226031Sstas		$(INSTALL) -m 0755 $(STRIP_OPT) ssh-rand-helper $(DESTDIR)$(libexecdir)/ssh-rand-helper ; \
259226031Sstas	fi
260226031Sstas	$(INSTALL) -m 4711 $(STRIP_OPT) ssh-keysign $(DESTDIR)$(SSH_KEYSIGN)
261226031Sstas	$(INSTALL) -m 0755 $(STRIP_OPT) sftp $(DESTDIR)$(bindir)/sftp
262226031Sstas	$(INSTALL) -m 0755 $(STRIP_OPT) sftp-server $(DESTDIR)$(SFTP_SERVER)
263226031Sstas	$(INSTALL) -m 644 ssh.1.out $(DESTDIR)$(mandir)/$(mansubdir)1/ssh.1
264226031Sstas	$(INSTALL) -m 644 scp.1.out $(DESTDIR)$(mandir)/$(mansubdir)1/scp.1
265226031Sstas	$(INSTALL) -m 644 ssh-add.1.out $(DESTDIR)$(mandir)/$(mansubdir)1/ssh-add.1
266226031Sstas	$(INSTALL) -m 644 ssh-agent.1.out $(DESTDIR)$(mandir)/$(mansubdir)1/ssh-agent.1
267226031Sstas	$(INSTALL) -m 644 ssh-keygen.1.out $(DESTDIR)$(mandir)/$(mansubdir)1/ssh-keygen.1
268226031Sstas	$(INSTALL) -m 644 ssh-keyscan.1.out $(DESTDIR)$(mandir)/$(mansubdir)1/ssh-keyscan.1
269226031Sstas	$(INSTALL) -m 644 sshd_config.5.out $(DESTDIR)$(mandir)/$(mansubdir)5/sshd_config.5
270226031Sstas	$(INSTALL) -m 644 ssh_config.5.out $(DESTDIR)$(mandir)/$(mansubdir)5/ssh_config.5
271226031Sstas	$(INSTALL) -m 644 sshd.8.out $(DESTDIR)$(mandir)/$(mansubdir)8/sshd.8
272226031Sstas	if [ ! -z "$(INSTALL_SSH_RAND_HELPER)" ]; then \
273226031Sstas		$(INSTALL) -m 644 ssh-rand-helper.8.out $(DESTDIR)$(mandir)/$(mansubdir)8/ssh-rand-helper.8 ; \
274226031Sstas	fi
275226031Sstas	$(INSTALL) -m 644 sftp.1.out $(DESTDIR)$(mandir)/$(mansubdir)1/sftp.1
276226031Sstas	$(INSTALL) -m 644 sftp-server.8.out $(DESTDIR)$(mandir)/$(mansubdir)8/sftp-server.8
277226031Sstas	$(INSTALL) -m 644 ssh-keysign.8.out $(DESTDIR)$(mandir)/$(mansubdir)8/ssh-keysign.8
278226031Sstas	-rm -f $(DESTDIR)$(bindir)/slogin
279226031Sstas	ln -s ./ssh$(EXEEXT) $(DESTDIR)$(bindir)/slogin
280226031Sstas	-rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/slogin.1
281226031Sstas	ln -s ./ssh.1 $(DESTDIR)$(mandir)/$(mansubdir)1/slogin.1
282226031Sstas	if [ ! -d $(DESTDIR)$(sysconfdir) ]; then \
283226031Sstas		$(srcdir)/mkinstalldirs $(DESTDIR)$(sysconfdir); \
284226031Sstas	fi
285226031Sstas	@if [ ! -f $(DESTDIR)$(sysconfdir)/ssh_config ]; then \
286226031Sstas		$(INSTALL) -m 644 ssh_config.out $(DESTDIR)$(sysconfdir)/ssh_config; \
287226031Sstas	else \
288226031Sstas		echo "$(DESTDIR)$(sysconfdir)/ssh_config already exists, install will not overwrite"; \
289226031Sstas	fi
290226031Sstas	@if [ ! -f $(DESTDIR)$(sysconfdir)/sshd_config ]; then \
291226031Sstas		$(INSTALL) -m 644 sshd_config.out $(DESTDIR)$(sysconfdir)/sshd_config; \
292226031Sstas	else \
293226031Sstas		echo "$(DESTDIR)$(sysconfdir)/sshd_config already exists, install will not overwrite"; \
294226031Sstas	fi
295226031Sstas	@if [ -f ssh_prng_cmds -a ! -z "$(INSTALL_SSH_PRNG_CMDS)" ]; then \
296226031Sstas		if [ ! -f $(DESTDIR)$(sysconfdir)/ssh_prng_cmds ] ; then \
297226031Sstas			$(INSTALL) -m 644 ssh_prng_cmds.out $(DESTDIR)$(sysconfdir)/ssh_prng_cmds; \
298226031Sstas		else \
299226031Sstas			echo "$(DESTDIR)$(sysconfdir)/ssh_prng_cmds already exists, install will not overwrite"; \
300226031Sstas		fi ; \
301226031Sstas	fi
302226031Sstas	@if [ ! -f $(DESTDIR)$(sysconfdir)/moduli ]; then \
303226031Sstas		if [ -f $(DESTDIR)$(sysconfdir)/primes ]; then \
304226031Sstas			echo "moving $(DESTDIR)$(sysconfdir)/primes to $(DESTDIR)$(sysconfdir)/moduli"; \
305226031Sstas			mv "$(DESTDIR)$(sysconfdir)/primes" "$(DESTDIR)$(sysconfdir)/moduli"; \
306226031Sstas		else \
307226031Sstas			$(INSTALL) -m 644 moduli.out $(DESTDIR)$(sysconfdir)/moduli; \
308226031Sstas		fi ; \
309226031Sstas	else \
310226031Sstas		echo "$(DESTDIR)$(sysconfdir)/moduli already exists, install will not overwrite"; \
311226031Sstas	fi
312226031Sstas
313226031Sstashost-key: ssh-keygen$(EXEEXT)
314226031Sstas	@if [ -z "$(DESTDIR)" ] ; then \
315226031Sstas		if [ -f "$(DESTDIR)$(sysconfdir)/ssh_host_key" ] ; then \
316226031Sstas			echo "$(DESTDIR)$(sysconfdir)/ssh_host_key already exists, skipping." ; \
317226031Sstas		else \
318226031Sstas			./ssh-keygen -t rsa1 -f $(DESTDIR)$(sysconfdir)/ssh_host_key -N "" ; \
319226031Sstas		fi ; \
320226031Sstas		if [ -f $(DESTDIR)$(sysconfdir)/ssh_host_dsa_key ] ; then \
321226031Sstas			echo "$(DESTDIR)$(sysconfdir)/ssh_host_dsa_key already exists, skipping." ; \
322226031Sstas		else \
323226031Sstas			./ssh-keygen -t dsa -f $(DESTDIR)$(sysconfdir)/ssh_host_dsa_key -N "" ; \
324226031Sstas		fi ; \
325226031Sstas		if [ -f $(DESTDIR)$(sysconfdir)/ssh_host_rsa_key ] ; then \
326226031Sstas			echo "$(DESTDIR)$(sysconfdir)/ssh_host_rsa_key already exists, skipping." ; \
327226031Sstas		else \
328226031Sstas			./ssh-keygen -t rsa -f $(DESTDIR)$(sysconfdir)/ssh_host_rsa_key -N "" ; \
329226031Sstas		fi ; \
330226031Sstas	fi ;
331226031Sstas
332226031Sstashost-key-force: ssh-keygen$(EXEEXT)
333226031Sstas	./ssh-keygen -t rsa1 -f $(DESTDIR)$(sysconfdir)/ssh_host_key -N ""
334226031Sstas	./ssh-keygen -t dsa -f $(DESTDIR)$(sysconfdir)/ssh_host_dsa_key -N ""
335226031Sstas	./ssh-keygen -t rsa -f $(DESTDIR)$(sysconfdir)/ssh_host_rsa_key -N ""
336226031Sstas
337226031Sstasuninstallall:	uninstall
338226031Sstas	-rm -f $(DESTDIR)$(sysconfdir)/ssh_config
339226031Sstas	-rm -f $(DESTDIR)$(sysconfdir)/sshd_config
340226031Sstas	-rm -f $(DESTDIR)$(sysconfdir)/ssh_prng_cmds
341226031Sstas	-rmdir $(DESTDIR)$(sysconfdir)
342226031Sstas	-rmdir $(DESTDIR)$(bindir)
343226031Sstas	-rmdir $(DESTDIR)$(sbindir)
344226031Sstas	-rmdir $(DESTDIR)$(mandir)/$(mansubdir)1
345226031Sstas	-rmdir $(DESTDIR)$(mandir)/$(mansubdir)8
346226031Sstas	-rmdir $(DESTDIR)$(mandir)
347226031Sstas	-rmdir $(DESTDIR)$(libexecdir)
348226031Sstas
349226031Sstasuninstall:
350226031Sstas	-rm -f $(DESTDIR)$(bindir)/slogin
351226031Sstas	-rm -f $(DESTDIR)$(bindir)/ssh$(EXEEXT)
352226031Sstas	-rm -f $(DESTDIR)$(bindir)/scp$(EXEEXT)
353226031Sstas	-rm -f $(DESTDIR)$(bindir)/ssh-add$(EXEEXT)
354226031Sstas	-rm -f $(DESTDIR)$(bindir)/ssh-agent$(EXEEXT)
355226031Sstas	-rm -f $(DESTDIR)$(bindir)/ssh-keygen$(EXEEXT)
356226031Sstas	-rm -f $(DESTDIR)$(bindir)/ssh-keyscan$(EXEEXT)
357226031Sstas	-rm -f $(DESTDIR)$(bindir)/sftp$(EXEEXT)
358226031Sstas	-rm -f $(DESTDIR)$(sbindir)/sshd$(EXEEXT)
359226031Sstas	-rm -r $(DESTDIR)$(SFTP_SERVER)$(EXEEXT)
360226031Sstas	-rm -f $(DESTDIR)$(SSH_KEYSIGN)$(EXEEXT)
361226031Sstas	-rm -f $(DESTDIR)$(RAND_HELPER)$(EXEEXT)
362226031Sstas	-rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/ssh.1
363226031Sstas	-rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/scp.1
364226031Sstas	-rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/ssh-add.1
365226031Sstas	-rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/ssh-agent.1
366226031Sstas	-rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/ssh-keygen.1
367226031Sstas	-rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/sftp.1
368226031Sstas	-rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/ssh-keyscan.1
369226031Sstas	-rm -f $(DESTDIR)$(mandir)/$(mansubdir)8/sshd.8
370226031Sstas	-rm -f $(DESTDIR)$(mandir)/$(mansubdir)8/ssh-rand-helper.8
371226031Sstas	-rm -f $(DESTDIR)$(mandir)/$(mansubdir)8/sftp-server.8
372226031Sstas	-rm -f $(DESTDIR)$(mandir)/$(mansubdir)8/ssh-keysign.8
373226031Sstas	-rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/slogin.1
374226031Sstas
375226031Sstastests:	$(TARGETS)
376226031Sstas	BUILDDIR=`pwd`; \
377226031Sstas	[ -d `pwd`/regress ]  ||  mkdir -p `pwd`/regress; \
378226031Sstas	[ -f `pwd`/regress/Makefile ]  || \
379226031Sstas	    ln -s $(srcdir)/regress/Makefile `pwd`/regress/Makefile ; \
380226031Sstas	TEST_SHELL="@TEST_SHELL@"; \
381226031Sstas	TEST_SSH_SSH="$${BUILDDIR}/ssh"; \
382226031Sstas	TEST_SSH_SSHD="$${BUILDDIR}/sshd"; \
383226031Sstas	TEST_SSH_SSHAGENT="$${BUILDDIR}/ssh-agent"; \
384226031Sstas	TEST_SSH_SSHADD="$${BUILDDIR}/ssh-add"; \
385226031Sstas	TEST_SSH_SSHKEYGEN="$${BUILDDIR}/ssh-keygen"; \
386226031Sstas	TEST_SSH_SSHKEYSCAN="$${BUILDDIR}/ssh-keyscan"; \
387226031Sstas	TEST_SSH_SFTP="$${BUILDDIR}/sftp"; \
388226031Sstas	TEST_SSH_SFTPSERVER="$${BUILDDIR}/sftp-server"; \
389226031Sstas	cd $(srcdir)/regress || exit $$?; \
390226031Sstas	$(MAKE) \
391226031Sstas		.OBJDIR="$${BUILDDIR}/regress" \
392226031Sstas		.CURDIR="`pwd`" \
393226031Sstas		BUILDDIR="$${BUILDDIR}" \
394226031Sstas		OBJ="$${BUILDDIR}/regress/" \
395226031Sstas		PATH="$${BUILDDIR}:$${PATH}" \
396226031Sstas		TEST_SHELL="$${TEST_SHELL}" \
397226031Sstas		TEST_SSH_SSH="$${TEST_SSH_SSH}" \
398226031Sstas		TEST_SSH_SSHD="$${TEST_SSH_SSHD}" \
399226031Sstas		TEST_SSH_SSHAGENT="$${TEST_SSH_SSHAGENT}" \
400226031Sstas		TEST_SSH_SSHADD="$${TEST_SSH_SSHADD}" \
401226031Sstas		TEST_SSH_SSHKEYGEN="$${TEST_SSH_SSHKEYGEN}" \
402226031Sstas		TEST_SSH_SSHKEYSCAN="$${TEST_SSH_SSHKEYSCAN}" \
403226031Sstas		TEST_SSH_SFTP="$${TEST_SSH_SFTP}" \
404226031Sstas		TEST_SSH_SFTPSERVER="$${TEST_SSH_SFTPSERVER}" \
405226031Sstas		EXEEXT="$(EXEEXT)" \
406226031Sstas		$@
407226031Sstas
408226031Sstasregressclean:
409226031Sstas	if [ -f regress/Makefile -a -r regress/Makefile ]; then \
410226031Sstas		(cd regress && $(MAKE) clean) \
411226031Sstas	fi
412226031Sstas
413226031Sstaspackage: $(CONFIGFILES) ssh_prng_cmds.out $(MANPAGES) $(TARGETS)
414226031Sstas	if [ "@MAKE_PACKAGE_SUPPORTED@" = yes ]; then \
415226031Sstas		sh buildpkg.sh; \
416226031Sstas	fi
417226031Sstas
418226031Sstas