blob: d04d22de268e7a61616b284aebcee9665ffa508d [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 Miller7f6ea021999-10-28 13:25:17 +10008
Damien Millerc0d73901999-12-27 09:23:58 +11009srcdir = @srcdir@
10top_srcdir = @top_srcdir@
11VPATH=@srcdir@
12
Damien Millerc7b38ce1999-11-09 10:28:04 +110013SSH_PROGRAM=@bindir@/ssh
Damien Miller36884401999-12-26 12:26:21 +110014ASKPASS_LOCATION=@libexecdir@/ssh
15ASKPASS_PROGRAM=$(ASKPASS_LOCATION)/ssh-askpass
Damien Millerc0d73901999-12-27 09:23:58 +110016FIXPATHS=@top_srcdir@/fixpaths
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@
22TARGETS=libssh.a ssh sshd ssh-add ssh-keygen ssh-agent scp $(EXTRA_TARGETS)
Damien Millerd3dcfaf1999-11-09 13:52:33 +110023LIBS=@LIBS@
Damien Millerd7f66151999-12-09 10:48:58 +110024LIBWRAP=@LIBWRAP@
Damien Miller7f6ea021999-10-28 13:25:17 +100025AR=@AR@
26RANLIB=@RANLIB@
Damien Millerd8087f61999-11-25 12:31:26 +110027INSTALL=@INSTALL@
Damien Millere79334a1999-12-29 10:03:37 +110028PERL=@PERL@
Damien Miller18ccf851999-12-16 13:06:18 +110029LDFLAGS=-L. @LDFLAGS@
Damien Miller7f6ea021999-10-28 13:25:17 +100030
Damien Millerd3dcfaf1999-11-09 13:52:33 +110031GNOME_CFLAGS=`gnome-config --cflags gnome gnomeui`
32GNOME_LIBS=`gnome-config --libs gnome gnomeui`
33
Damien Millere72b7af1999-12-30 15:08:44 +110034OBJS= atomicio.o authfd.o authfile.o auth-krb4.o auth-passwd.o auth-pam.o \
Damien Millerc6b3bbe1999-12-13 08:27:33 +110035 auth-rhosts.o auth-rh-rsa.o auth-rsa.o auth-skey.o bsd-daemon.o \
Damien Miller58ca7d81999-12-29 19:56:30 +110036 bsd-login.o bsd-misc.o bsd-mktemp.o bsd-snprintf.o bsd-strlcat.o \
37 bsd-strlcpy.o bufaux.o buffer.o canohost.o channels.o cipher.o \
38 clientloop.o compress.o crc32.o deattack.o hostfile.o \
Damien Millerc6b3bbe1999-12-13 08:27:33 +110039 log-client.o login.o log-server.o match.o md5crypt.o mpaux.o \
40 packet.o pty.o radix.o readconf.o readpass.o rsa.o servconf.o \
41 serverloop.o sshconnect.o tildexpand.o ttymodes.o uidswap.o \
42 xmalloc.o
Damien Miller7f6ea021999-10-28 13:25:17 +100043
Damien Miller58ca7d81999-12-29 19:56:30 +110044LIBOBJS= atomicio.o authfd.o authfile.o bsd-daemon.o bsd-misc.o \
45 bsd-mktemp.o bsd-snprintf.o bsd-strlcat.o bsd-strlcpy.o bufaux.o \
46 buffer.o canohost.o channels.o cipher.o compat.o compress.o crc32.o \
47 deattack.o fingerprint.o hostfile.o log.o match.o mpaux.o nchan.o \
48 packet.o radix.o readpass.o rsa.o tildexpand.o ttymodes.o uidswap.o \
Damien Millerc6b3bbe1999-12-13 08:27:33 +110049 xmalloc.o
Damien Miller18ccf851999-12-16 13:06:18 +110050
Damien Millere72b7af1999-12-30 15:08:44 +110051SSHOBJS= ssh.o sshconnect.o log-client.o readconf.o clientloop.o
52
53SSHDOBJS= sshd.o auth-rhosts.o auth-krb4.o auth-pam.o auth-passwd.o \
54 auth-rsa.o auth-rh-rsa.o pty.o log-server.o login.o servconf.o \
55 serverloop.o bsd-login.o md5crypt.o
56
Damien Miller645c5982000-01-03 14:42:09 +110057MANPAGES=scp.1 ssh-add.1 ssh-agent.1 ssh-keygen.1 ssh.1 sshd.8
58
59CONFIGFILES=sshd_config ssh_config
60
61all: $(OBJS) $(TARGETS) $(MANPAGES) $(CONFIGFILES)
Damien Miller18ccf851999-12-16 13:06:18 +110062
Damien Miller32b3cf21999-12-26 10:21:48 +110063$(OBJS): config.h
64
65$(LIBOBJS): config.h
66
Damien Miller18ccf851999-12-16 13:06:18 +110067libssh.a: $(LIBOBJS)
68 $(AR) rv $@ $(LIBOBJS)
Damien Miller7f6ea021999-10-28 13:25:17 +100069 $(RANLIB) $@
70
Damien Millere72b7af1999-12-30 15:08:44 +110071ssh: $(SSHOBJS) libssh.a
72 $(CC) -o $@ $(SSHOBJS) $(LDFLAGS) -lssh $(LIBS)
Damien Miller7f6ea021999-10-28 13:25:17 +100073
Damien Millere72b7af1999-12-30 15:08:44 +110074sshd: $(SSHDOBJS) libssh.a
75 $(CC) -o $@ $(SSHDOBJS) $(LDFLAGS) -lssh $(LIBS) $(LIBWRAP)
Damien Miller7f6ea021999-10-28 13:25:17 +100076
Damien Millerd3dcfaf1999-11-09 13:52:33 +110077scp: scp.o libssh.a
Damien Miller18ccf851999-12-16 13:06:18 +110078 $(CC) -o $@ scp.o $(LDFLAGS) -lssh $(LIBS)
Damien Miller7f6ea021999-10-28 13:25:17 +100079
Damien Millerd3dcfaf1999-11-09 13:52:33 +110080ssh-add: ssh-add.o log-client.o libssh.a
Damien Miller18ccf851999-12-16 13:06:18 +110081 $(CC) -o $@ ssh-add.o log-client.o $(LDFLAGS) -lssh $(LIBS)
Damien Miller7f6ea021999-10-28 13:25:17 +100082
Damien Millerd3dcfaf1999-11-09 13:52:33 +110083ssh-agent: ssh-agent.o log-client.o libssh.a
Damien Miller18ccf851999-12-16 13:06:18 +110084 $(CC) -o $@ ssh-agent.o log-client.o $(LDFLAGS) -lssh $(LIBS)
Damien Miller7f6ea021999-10-28 13:25:17 +100085
Damien Millerd3dcfaf1999-11-09 13:52:33 +110086ssh-keygen: ssh-keygen.o log-client.o libssh.a
Damien Miller18ccf851999-12-16 13:06:18 +110087 $(CC) -o $@ ssh-keygen.o log-client.o $(LDFLAGS) -lssh $(LIBS)
Damien Miller7f6ea021999-10-28 13:25:17 +100088
Damien Millerd3dcfaf1999-11-09 13:52:33 +110089gnome-ssh-askpass: gnome-ssh-askpass.c
90 $(CC) $(CFLAGS) $(GNOME_CFLAGS) -o $@ gnome-ssh-askpass.c $(GNOME_LIBS)
91
Damien Miller7f6ea021999-10-28 13:25:17 +100092clean:
Damien Millerbeb4ba51999-12-28 15:09:35 +110093 rm -f *.o $(TARGETS) config.status config.cache config.log core \
Damien Millerc0d73901999-12-27 09:23:58 +110094 *.1 *.8 sshd_config ssh_config
95
Damien Miller645c5982000-01-03 14:42:09 +110096scp.1: scp.1.in
97 $(PERL) $(FIXPATHS) -Dsysconfdir=${sysconfdir} $(srcdir)/scp.1.in
Damien Miller356a0b01999-11-08 15:30:59 +110098
Damien Miller645c5982000-01-03 14:42:09 +110099ssh-add.1: ssh-add.1.in
100 $(PERL) $(FIXPATHS) -Dsysconfdir=${sysconfdir} ssh-add.1.in
101
102ssh-agent.1: ssh-agent.1.in
103 $(PERL) $(FIXPATHS) -Dsysconfdir=${sysconfdir} ssh-agent.1.in
104
105ssh-keygen.1: ssh-keygen.1.in
106 $(PERL) $(FIXPATHS) -Dsysconfdir=${sysconfdir} ssh-keygen.1.in
107
108ssh.1: ssh.1.in
109 $(PERL) $(FIXPATHS) -Dsysconfdir=${sysconfdir} ssh.1.in
110
111sshd.8: sshd.8.in
112 $(PERL) $(FIXPATHS) -Dsysconfdir=${sysconfdir} sshd.8.in
113
114sshd_config: sshd_config.in
115 $(PERL) $(FIXPATHS) -Dsysconfdir=${sysconfdir} sshd_config.in
116
117ssh_config: ssh_config.in
118 $(PERL) $(FIXPATHS) -Dsysconfdir=${sysconfdir} ssh_config.in
119
120install: $(TARGETS)
Damien Millerd8087f61999-11-25 12:31:26 +1100121 $(INSTALL) -d $(bindir)
122 $(INSTALL) -d $(sbindir)
123 $(INSTALL) -d $(mandir)
124 $(INSTALL) -d $(mandir)/man1
125 $(INSTALL) -d $(mandir)/man8
Damien Millerf958fab1999-11-25 13:36:42 +1100126 $(INSTALL) -s ssh $(bindir)/ssh
127 $(INSTALL) -s scp $(bindir)/scp
128 $(INSTALL) -s ssh-add $(bindir)/ssh-add
129 $(INSTALL) -s ssh-agent $(bindir)/ssh-agent
130 $(INSTALL) -s ssh-keygen $(bindir)/ssh-keygen
131 $(INSTALL) -s sshd $(sbindir)/sshd
Damien Millerc6b3bbe1999-12-13 08:27:33 +1100132 $(INSTALL) -m 644 ssh.1 $(mandir)/man1/ssh.1
133 $(INSTALL) -m 644 scp.1 $(mandir)/man1/scp.1
134 $(INSTALL) -m 644 ssh-add.1 $(mandir)/man1/ssh-add.1
135 $(INSTALL) -m 644 ssh-agent.1 $(mandir)/man1/ssh-agent.1
136 $(INSTALL) -m 644 ssh-keygen.1 $(mandir)/man1/ssh-keygen.1
137 $(INSTALL) -m 644 sshd.8 $(mandir)/man8/sshd.8
Damien Miller1f7833d1999-11-30 09:47:52 +1100138 -rm -f $(bindir)/slogin
139 ln -s ssh $(bindir)/slogin
140 -rm -f $(mandir)/man1/slogin.1
141 ln -s ssh.1 $(mandir)/man1/slogin.1
Damien Miller3d1b22c1999-11-12 15:46:08 +1100142
Damien Millerf066d6e1999-11-25 13:40:22 +1100143 if [ ! -z "@GNOME_ASKPASS@" ] ; then \
Damien Miller11ba8d41999-12-15 16:42:45 +1100144 $(INSTALL) -d $(libexecdir) ; \
145 $(INSTALL) -d $(libexecdir)/ssh ; \
Damien Miller36884401999-12-26 12:26:21 +1100146 $(INSTALL) -s @GNOME_ASKPASS@ ${ASKPASS_LOCATION} ; \
Damien Miller3d1b22c1999-11-12 15:46:08 +1100147 fi
Damien Miller7f6ea021999-10-28 13:25:17 +1000148
Damien Miller296a5461999-11-13 10:48:51 +1100149 if [ ! -f $(sysconfdir)/ssh_config -a ! -f $(sysconfdir)/sshd_config ]; then \
Damien Millerd8087f61999-11-25 12:31:26 +1100150 $(INSTALL) -d $(sysconfdir); \
Damien Millerc6b3bbe1999-12-13 08:27:33 +1100151 $(INSTALL) -m 644 ssh_config $(sysconfdir)/ssh_config; \
152 $(INSTALL) -m 644 sshd_config $(sysconfdir)/sshd_config; \
Damien Miller296a5461999-11-13 10:48:51 +1100153 fi
154
Damien Millerbf1c9b21999-12-09 10:16:54 +1100155uninstallall: uninstall
156 -rm -f $(sysconfdir)/ssh_config
157 -rm -f $(sysconfdir)/sshd_config
158 -rmdir $(sysconfdir)
159 -rmdir $(bindir)
160 -rmdir $(sbindir)
161 -rmdir $(mandir)/man1
162 -rmdir $(mandir)/man8
163 -rmdir $(mandir)
164 -rmdir $(libexecdir)
165
166uninstall:
167 -rm -f $(bindir)/ssh
168 -rm -f $(bindir)/scp
169 -rm -f $(bindir)/ssh-add
170 -rm -f $(bindir)/ssh-agent
171 -rm -f $(bindir)/ssh-keygen
172 -rm -f $(sbindir)/sshd
173 -rm -f $(mandir)/man1/ssh.1
174 -rm -f $(mandir)/man1/scp.1
175 -rm -f $(mandir)/man1/ssh-add.1
176 -rm -f $(mandir)/man1/ssh-agent.1
177 -rm -f $(mandir)/man1/ssh-keygen.1
178 -rm -f $(mandir)/man8/sshd.8
179 -rm -f $(bindir)/slogin
180 -rm -f $(mandir)/man1/slogin.1
Damien Millerbf1c9b21999-12-09 10:16:54 +1100181 -rm -f ${ASKPASS_PROGRAM}
182 -rmdir $(libexecdir)/ssh ;
183
Damien Miller7f6ea021999-10-28 13:25:17 +1000184distclean: clean
Damien Miller356a0b01999-11-08 15:30:59 +1100185 rm -f Makefile config.h core *~
Damien Miller7f6ea021999-10-28 13:25:17 +1000186
187mrproper: distclean
Damien Miller356a0b01999-11-08 15:30:59 +1100188
189veryclean: distclean
Damien Millerc7b38ce1999-11-09 10:28:04 +1100190 rm -f configure config.h.in
191