blob: 020b632649a3515ff8e20acf5108da0c01df5080 [file] [log] [blame]
Damien Miller7f6ea021999-10-28 13:25:17 +10001prefix=@prefix@
2exec_prefix=@exec_prefix@
3bindir=@bindir@
4sbindir=@sbindir@
Damien Millere2324551999-11-19 17:18:57 +11005libexecdir=@libexecdir@
Damien Miller94388161999-10-29 09:57:31 +10006mandir=@mandir@
Damien Miller296a5461999-11-13 10:48:51 +11007sysconfdir=@sysconfdir@
Damien Millerb13c73e2000-01-17 22:02:17 +11008piddir=@piddir@
9srcdir=@srcdir@
10top_srcdir=@top_srcdir@
Damien Miller7f6ea021999-10-28 13:25:17 +100011
Damien Millerc0d73901999-12-27 09:23:58 +110012VPATH=@srcdir@
13
Damien Millerc7b38ce1999-11-09 10:28:04 +110014SSH_PROGRAM=@bindir@/ssh
Damien Miller36884401999-12-26 12:26:21 +110015ASKPASS_LOCATION=@libexecdir@/ssh
16ASKPASS_PROGRAM=$(ASKPASS_LOCATION)/ssh-askpass
Damien Millerc7b38ce1999-11-09 10:28:04 +110017
Damien Miller7f6ea021999-10-28 13:25:17 +100018CC=@CC@
Damien Miller3bc14dd1999-12-07 14:54:53 +110019PATHS=-DETCDIR=\"$(sysconfdir)\" -DSSH_PROGRAM=\"$(SSH_PROGRAM)\" -DSSH_ASKPASS_DEFAULT=\"$(ASKPASS_PROGRAM)\"
Damien Millerc7b38ce1999-11-09 10:28:04 +110020CFLAGS=@CFLAGS@ $(PATHS) @DEFS@
Damien Millere0d444c1999-11-09 14:23:45 +110021EXTRA_TARGETS=@GNOME_ASKPASS@
Damien Millerd3dcfaf1999-11-09 13:52:33 +110022LIBS=@LIBS@
Damien Miller7f6ea021999-10-28 13:25:17 +100023AR=@AR@
24RANLIB=@RANLIB@
Damien Millerd8087f61999-11-25 12:31:26 +110025INSTALL=@INSTALL@
Damien Millere79334a1999-12-29 10:03:37 +110026PERL=@PERL@
Damien Miller18ccf851999-12-16 13:06:18 +110027LDFLAGS=-L. @LDFLAGS@
Damien Miller7f6ea021999-10-28 13:25:17 +100028
Damien Millerd3dcfaf1999-11-09 13:52:33 +110029GNOME_CFLAGS=`gnome-config --cflags gnome gnomeui`
30GNOME_LIBS=`gnome-config --libs gnome gnomeui`
31
Damien Miller34132e52000-01-14 15:45:46 +110032TARGETS=ssh sshd ssh-add ssh-keygen ssh-agent scp $(EXTRA_TARGETS)
Damien Miller7f6ea021999-10-28 13:25:17 +100033
Damien Miller34132e52000-01-14 15:45:46 +110034LIBOBJS= atomicio.o authfd.o authfile.o bsd-bindresvport.o bsd-daemon.o bsd-misc.o bsd-mktemp.o bsd-rresvport.o bsd-snprintf.o bsd-strlcat.o bsd-strlcpy.o bufaux.o buffer.o canohost.o channels.o cipher.o compat.o compress.o crc32.o deattack.o fake-getaddrinfo.o fake-getnameinfo.o fingerprint.o hostfile.o log.o match.o mpaux.o nchan.o packet.o radix.o readpass.o rsa.o tildexpand.o ttymodes.o uidswap.o xmalloc.o
Damien Miller18ccf851999-12-16 13:06:18 +110035
Damien Millere72b7af1999-12-30 15:08:44 +110036SSHOBJS= ssh.o sshconnect.o log-client.o readconf.o clientloop.o
37
Damien Miller34132e52000-01-14 15:45:46 +110038SSHDOBJS= sshd.o auth-rhosts.o auth-krb4.o auth-pam.o auth-passwd.o auth-rsa.o auth-rh-rsa.o pty.o log-server.o login.o servconf.o serverloop.o bsd-login.o md5crypt.o
Damien Millere72b7af1999-12-30 15:08:44 +110039
Damien Miller886c63a2000-01-20 23:13:36 +110040MANPAGES = scp.1 ssh-add.1 ssh-agent.1 ssh-keygen.1 ssh.1 sshd.8
Damien Miller645c5982000-01-03 14:42:09 +110041
42CONFIGFILES=sshd_config ssh_config
43
Damien Miller886c63a2000-01-20 23:13:36 +110044PATHSUBS = -D/etc/ssh_config=$(sysconfdir)/ssh_config -D/etc/sshd_config=$(sysconfdir)/sshd_config -D/etc/shosts.equiv=$(sysconfdir)/shosts.equiv -D/etc/ssh_host_key=$(sysconfdir)/ssh_host_key -D/var/run/sshd.pid=$(piddir)/sshd.pid
45
46FIXPATHSCMD = $(PERL) $(srcdir)/fixpaths $(PATHSUBS)
47
Damien Miller34132e52000-01-14 15:45:46 +110048all: $(TARGETS) $(MANPAGES) $(CONFIGFILES)
Damien Miller18ccf851999-12-16 13:06:18 +110049
Damien Miller32b3cf21999-12-26 10:21:48 +110050$(LIBOBJS): config.h
51
Damien Miller18ccf851999-12-16 13:06:18 +110052libssh.a: $(LIBOBJS)
53 $(AR) rv $@ $(LIBOBJS)
Damien Miller7f6ea021999-10-28 13:25:17 +100054 $(RANLIB) $@
55
Damien Miller34132e52000-01-14 15:45:46 +110056ssh: libssh.a $(SSHOBJS)
Damien Millere72b7af1999-12-30 15:08:44 +110057 $(CC) -o $@ $(SSHOBJS) $(LDFLAGS) -lssh $(LIBS)
Damien Miller7f6ea021999-10-28 13:25:17 +100058
Damien Miller34132e52000-01-14 15:45:46 +110059sshd: libssh.a $(SSHDOBJS)
Damien Miller105b7f02000-01-07 08:45:55 +110060 $(CC) -o $@ $(SSHDOBJS) $(LDFLAGS) -lssh $(LIBS)
Damien Miller7f6ea021999-10-28 13:25:17 +100061
Damien Miller34132e52000-01-14 15:45:46 +110062scp: libssh.a scp.o
Damien Miller18ccf851999-12-16 13:06:18 +110063 $(CC) -o $@ scp.o $(LDFLAGS) -lssh $(LIBS)
Damien Miller7f6ea021999-10-28 13:25:17 +100064
Damien Miller34132e52000-01-14 15:45:46 +110065ssh-add: libssh.a ssh-add.o log-client.o
Damien Miller18ccf851999-12-16 13:06:18 +110066 $(CC) -o $@ ssh-add.o log-client.o $(LDFLAGS) -lssh $(LIBS)
Damien Miller7f6ea021999-10-28 13:25:17 +100067
Damien Miller34132e52000-01-14 15:45:46 +110068ssh-agent: libssh.a ssh-agent.o log-client.o
Damien Miller18ccf851999-12-16 13:06:18 +110069 $(CC) -o $@ ssh-agent.o log-client.o $(LDFLAGS) -lssh $(LIBS)
Damien Miller7f6ea021999-10-28 13:25:17 +100070
Damien Miller34132e52000-01-14 15:45:46 +110071ssh-keygen: libssh.a ssh-keygen.o log-client.o
Damien Miller18ccf851999-12-16 13:06:18 +110072 $(CC) -o $@ ssh-keygen.o log-client.o $(LDFLAGS) -lssh $(LIBS)
Damien Miller7f6ea021999-10-28 13:25:17 +100073
Damien Millerd3dcfaf1999-11-09 13:52:33 +110074gnome-ssh-askpass: gnome-ssh-askpass.c
75 $(CC) $(CFLAGS) $(GNOME_CFLAGS) -o $@ gnome-ssh-askpass.c $(GNOME_LIBS)
76
Damien Miller886c63a2000-01-20 23:13:36 +110077$(MANPAGES) $(CONFIGFILES)::
78 $(FIXPATHSCMD) $(srcdir)/$@
Damien Miller645c5982000-01-03 14:42:09 +110079
Damien Miller34132e52000-01-14 15:45:46 +110080clean:
81 rm -f *.o *.a $(TARGETS) config.status config.cache config.log
Damien Miller886c63a2000-01-20 23:13:36 +110082 rm -f *.out core
Damien Miller34132e52000-01-14 15:45:46 +110083
84distclean: clean
85 rm -f Makefile config.h core *~
86
87mrproper: distclean
88
89veryclean: distclean
90 rm -f configure config.h.in
91
Damien Miller645c5982000-01-03 14:42:09 +110092install: $(TARGETS)
Damien Millerd8087f61999-11-25 12:31:26 +110093 $(INSTALL) -d $(bindir)
94 $(INSTALL) -d $(sbindir)
95 $(INSTALL) -d $(mandir)
96 $(INSTALL) -d $(mandir)/man1
97 $(INSTALL) -d $(mandir)/man8
Damien Millerf958fab1999-11-25 13:36:42 +110098 $(INSTALL) -s ssh $(bindir)/ssh
99 $(INSTALL) -s scp $(bindir)/scp
100 $(INSTALL) -s ssh-add $(bindir)/ssh-add
101 $(INSTALL) -s ssh-agent $(bindir)/ssh-agent
102 $(INSTALL) -s ssh-keygen $(bindir)/ssh-keygen
103 $(INSTALL) -s sshd $(sbindir)/sshd
Damien Miller886c63a2000-01-20 23:13:36 +1100104 $(INSTALL) -m 644 ssh.1.out $(mandir)/man1/ssh.1
105 $(INSTALL) -m 644 scp.1.out $(mandir)/man1/scp.1
106 $(INSTALL) -m 644 ssh-add.1.out $(mandir)/man1/ssh-add.1
107 $(INSTALL) -m 644 ssh-agent.1.out $(mandir)/man1/ssh-agent.1
108 $(INSTALL) -m 644 ssh-keygen.1.out $(mandir)/man1/ssh-keygen.1
109 $(INSTALL) -m 644 sshd.8.out $(mandir)/man8/sshd.8
Damien Miller1f7833d1999-11-30 09:47:52 +1100110 -rm -f $(bindir)/slogin
111 ln -s ssh $(bindir)/slogin
112 -rm -f $(mandir)/man1/slogin.1
113 ln -s ssh.1 $(mandir)/man1/slogin.1
Damien Miller3d1b22c1999-11-12 15:46:08 +1100114
Damien Millerf066d6e1999-11-25 13:40:22 +1100115 if [ ! -z "@GNOME_ASKPASS@" ] ; then \
Damien Miller11ba8d41999-12-15 16:42:45 +1100116 $(INSTALL) -d $(libexecdir) ; \
117 $(INSTALL) -d $(libexecdir)/ssh ; \
Damien Miller36884401999-12-26 12:26:21 +1100118 $(INSTALL) -s @GNOME_ASKPASS@ ${ASKPASS_LOCATION} ; \
Damien Miller3d1b22c1999-11-12 15:46:08 +1100119 fi
Damien Miller7f6ea021999-10-28 13:25:17 +1000120
Damien Miller296a5461999-11-13 10:48:51 +1100121 if [ ! -f $(sysconfdir)/ssh_config -a ! -f $(sysconfdir)/sshd_config ]; then \
Damien Millerd8087f61999-11-25 12:31:26 +1100122 $(INSTALL) -d $(sysconfdir); \
Damien Miller886c63a2000-01-20 23:13:36 +1100123 $(INSTALL) -m 644 ssh_config.out $(sysconfdir)/ssh_config; \
124 $(INSTALL) -m 644 sshd_config.out $(sysconfdir)/sshd_config; \
Damien Miller296a5461999-11-13 10:48:51 +1100125 fi
126
Damien Millerbf1c9b21999-12-09 10:16:54 +1100127uninstallall: uninstall
128 -rm -f $(sysconfdir)/ssh_config
129 -rm -f $(sysconfdir)/sshd_config
130 -rmdir $(sysconfdir)
131 -rmdir $(bindir)
132 -rmdir $(sbindir)
133 -rmdir $(mandir)/man1
134 -rmdir $(mandir)/man8
135 -rmdir $(mandir)
136 -rmdir $(libexecdir)
137
138uninstall:
139 -rm -f $(bindir)/ssh
140 -rm -f $(bindir)/scp
141 -rm -f $(bindir)/ssh-add
142 -rm -f $(bindir)/ssh-agent
143 -rm -f $(bindir)/ssh-keygen
144 -rm -f $(sbindir)/sshd
145 -rm -f $(mandir)/man1/ssh.1
146 -rm -f $(mandir)/man1/scp.1
147 -rm -f $(mandir)/man1/ssh-add.1
148 -rm -f $(mandir)/man1/ssh-agent.1
149 -rm -f $(mandir)/man1/ssh-keygen.1
150 -rm -f $(mandir)/man8/sshd.8
151 -rm -f $(bindir)/slogin
152 -rm -f $(mandir)/man1/slogin.1
Damien Millerbf1c9b21999-12-09 10:16:54 +1100153 -rm -f ${ASKPASS_PROGRAM}
154 -rmdir $(libexecdir)/ssh ;
155
Damien Millerb13c73e2000-01-17 22:02:17 +1100156preformat:
157 -rm -f catman
158 -mkdir catman
159 for x in $(MANPAGES) ; do man ./$${x}.in > catman/$${x}.in ; done