blob: fa9a9d815c789e773449e1a96e127a9f7e53b1cc [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 Millerc7b38ce1999-11-09 10:28:04 +11009SSH_PROGRAM=@bindir@/ssh
Damien Miller18ac1711999-11-19 12:43:19 +110010ASKPASS_PROGRAM=@libexecdir@/ssh/ssh-askpass
Damien Millerc7b38ce1999-11-09 10:28:04 +110011
Damien Miller7f6ea021999-10-28 13:25:17 +100012CC=@CC@
Damien Miller3bc14dd1999-12-07 14:54:53 +110013PATHS=-DETCDIR=\"$(sysconfdir)\" -DSSH_PROGRAM=\"$(SSH_PROGRAM)\" -DSSH_ASKPASS_DEFAULT=\"$(ASKPASS_PROGRAM)\"
Damien Millerc7b38ce1999-11-09 10:28:04 +110014CFLAGS=@CFLAGS@ $(PATHS) @DEFS@
Damien Millere0d444c1999-11-09 14:23:45 +110015EXTRA_TARGETS=@GNOME_ASKPASS@
16TARGETS=libssh.a ssh sshd ssh-add ssh-keygen ssh-agent scp $(EXTRA_TARGETS)
Damien Millerd3dcfaf1999-11-09 13:52:33 +110017LIBS=@LIBS@
Damien Millerd7f66151999-12-09 10:48:58 +110018LIBWRAP=@LIBWRAP@
Damien Miller7f6ea021999-10-28 13:25:17 +100019AR=@AR@
20RANLIB=@RANLIB@
Damien Millerd8087f61999-11-25 12:31:26 +110021INSTALL=@INSTALL@
Damien Miller18ccf851999-12-16 13:06:18 +110022LDFLAGS=-L. @LDFLAGS@
Damien Miller7f6ea021999-10-28 13:25:17 +100023
Damien Millerd3dcfaf1999-11-09 13:52:33 +110024GNOME_CFLAGS=`gnome-config --cflags gnome gnomeui`
25GNOME_LIBS=`gnome-config --libs gnome gnomeui`
26
Damien Millerc6b3bbe1999-12-13 08:27:33 +110027OBJS= atomicio.o authfd.o authfile.o auth-krb4.o auth-passwd.o \
28 auth-rhosts.o auth-rh-rsa.o auth-rsa.o auth-skey.o bsd-daemon.o \
Damien Miller36b339a1999-12-14 10:54:47 +110029 bsd-login.o bsd-mktemp.o bsd-snprintf.o bsd-strlcat.o bsd-strlcpy.o \
Damien Millerc6b3bbe1999-12-13 08:27:33 +110030 bufaux.o buffer.o canohost.o channels.o cipher.o clientloop.o \
31 compress.o crc32.o deattack.o helper.o helper.o hostfile.o \
32 log-client.o login.o log-server.o match.o md5crypt.o mpaux.o \
33 packet.o pty.o radix.o readconf.o readpass.o rsa.o servconf.o \
34 serverloop.o sshconnect.o tildexpand.o ttymodes.o uidswap.o \
35 xmalloc.o
Damien Miller7f6ea021999-10-28 13:25:17 +100036
Damien Miller18ccf851999-12-16 13:06:18 +110037LIBOBJS= atomicio.o authfd.o authfile.o bsd-daemon.o bsd-mktemp.o \
Damien Miller037a0dc1999-12-07 15:38:31 +110038 bsd-snprintf.o bsd-strlcat.o bsd-strlcpy.o bufaux.o \
39 buffer.o canohost.o channels.o cipher.o compat.o \
40 compress.o crc32.o deattack.o fingerprint.o helper.o \
41 hostfile.o log.o match.o mpaux.o nchan.o packet.o \
Damien Millerc6b3bbe1999-12-13 08:27:33 +110042 radix.o readpass.o rsa.o tildexpand.o ttymodes.o uidswap.o \
43 xmalloc.o
Damien Miller18ccf851999-12-16 13:06:18 +110044
45all: $(OBJS) $(TARGETS)
46
Damien Miller32b3cf21999-12-26 10:21:48 +110047$(OBJS): config.h
48
49$(LIBOBJS): config.h
50
Damien Miller18ccf851999-12-16 13:06:18 +110051libssh.a: $(LIBOBJS)
52 $(AR) rv $@ $(LIBOBJS)
Damien Miller7f6ea021999-10-28 13:25:17 +100053 $(RANLIB) $@
54
Damien Millerd3dcfaf1999-11-09 13:52:33 +110055ssh: ssh.o sshconnect.o log-client.o readconf.o clientloop.o libssh.a
Damien Miller18ccf851999-12-16 13:06:18 +110056 $(CC) -o $@ ssh.o sshconnect.o log-client.o readconf.o \
57 clientloop.o $(LDFLAGS) -lssh $(LIBS)
Damien Miller7f6ea021999-10-28 13:25:17 +100058
Damien Millerc6b3bbe1999-12-13 08:27:33 +110059sshd: sshd.o auth-rhosts.o auth-krb4.o auth-passwd.o auth-rsa.o \
60 auth-rh-rsa.o pty.o log-server.o login.o servconf.o serverloop.o \
61 bsd-login.o md5crypt.o libssh.a
Damien Miller18ccf851999-12-16 13:06:18 +110062 $(CC) -o $@ sshd.o auth-rhosts.o auth-krb4.o auth-passwd.o \
63 auth-rsa.o auth-rh-rsa.o pty.o log-server.o login.o servconf.o \
64 serverloop.o bsd-login.o md5crypt.o $(LDFLAGS) -lssh $(LIBS) $(LIBWRAP)
Damien Miller7f6ea021999-10-28 13:25:17 +100065
Damien Millerd3dcfaf1999-11-09 13:52:33 +110066scp: scp.o libssh.a
Damien Miller18ccf851999-12-16 13:06:18 +110067 $(CC) -o $@ scp.o $(LDFLAGS) -lssh $(LIBS)
Damien Miller7f6ea021999-10-28 13:25:17 +100068
Damien Millerd3dcfaf1999-11-09 13:52:33 +110069ssh-add: ssh-add.o log-client.o libssh.a
Damien Miller18ccf851999-12-16 13:06:18 +110070 $(CC) -o $@ ssh-add.o log-client.o $(LDFLAGS) -lssh $(LIBS)
Damien Miller7f6ea021999-10-28 13:25:17 +100071
Damien Millerd3dcfaf1999-11-09 13:52:33 +110072ssh-agent: ssh-agent.o log-client.o libssh.a
Damien Miller18ccf851999-12-16 13:06:18 +110073 $(CC) -o $@ ssh-agent.o log-client.o $(LDFLAGS) -lssh $(LIBS)
Damien Miller7f6ea021999-10-28 13:25:17 +100074
Damien Millerd3dcfaf1999-11-09 13:52:33 +110075ssh-keygen: ssh-keygen.o log-client.o libssh.a
Damien Miller18ccf851999-12-16 13:06:18 +110076 $(CC) -o $@ ssh-keygen.o log-client.o $(LDFLAGS) -lssh $(LIBS)
Damien Miller7f6ea021999-10-28 13:25:17 +100077
Damien Millerd3dcfaf1999-11-09 13:52:33 +110078gnome-ssh-askpass: gnome-ssh-askpass.c
79 $(CC) $(CFLAGS) $(GNOME_CFLAGS) -o $@ gnome-ssh-askpass.c $(GNOME_LIBS)
80
Damien Miller7f6ea021999-10-28 13:25:17 +100081clean:
Damien Miller3c5cb381999-10-29 12:06:53 +100082 rm -f *.o core $(TARGETS) config.status config.cache config.log
Damien Miller356a0b01999-11-08 15:30:59 +110083
Damien Millercdb8b1d1999-11-09 14:31:49 +110084install: all
Damien Millerd8087f61999-11-25 12:31:26 +110085 $(INSTALL) -d $(bindir)
86 $(INSTALL) -d $(sbindir)
87 $(INSTALL) -d $(mandir)
88 $(INSTALL) -d $(mandir)/man1
89 $(INSTALL) -d $(mandir)/man8
Damien Millerf958fab1999-11-25 13:36:42 +110090 $(INSTALL) -s ssh $(bindir)/ssh
91 $(INSTALL) -s scp $(bindir)/scp
92 $(INSTALL) -s ssh-add $(bindir)/ssh-add
93 $(INSTALL) -s ssh-agent $(bindir)/ssh-agent
94 $(INSTALL) -s ssh-keygen $(bindir)/ssh-keygen
95 $(INSTALL) -s sshd $(sbindir)/sshd
Damien Millerc6b3bbe1999-12-13 08:27:33 +110096 $(INSTALL) -m 644 ssh.1 $(mandir)/man1/ssh.1
97 $(INSTALL) -m 644 scp.1 $(mandir)/man1/scp.1
98 $(INSTALL) -m 644 ssh-add.1 $(mandir)/man1/ssh-add.1
99 $(INSTALL) -m 644 ssh-agent.1 $(mandir)/man1/ssh-agent.1
100 $(INSTALL) -m 644 ssh-keygen.1 $(mandir)/man1/ssh-keygen.1
101 $(INSTALL) -m 644 sshd.8 $(mandir)/man8/sshd.8
Damien Miller1f7833d1999-11-30 09:47:52 +1100102 -rm -f $(bindir)/slogin
103 ln -s ssh $(bindir)/slogin
104 -rm -f $(mandir)/man1/slogin.1
105 ln -s ssh.1 $(mandir)/man1/slogin.1
Damien Miller3d1b22c1999-11-12 15:46:08 +1100106
Damien Millerf066d6e1999-11-25 13:40:22 +1100107 if [ ! -z "@GNOME_ASKPASS@" ] ; then \
Damien Miller11ba8d41999-12-15 16:42:45 +1100108 $(INSTALL) -d $(libexecdir) ; \
109 $(INSTALL) -d $(libexecdir)/ssh ; \
Damien Millerf958fab1999-11-25 13:36:42 +1100110 $(INSTALL) -s @GNOME_ASKPASS@ ${ASKPASS_PROGRAM} ; \
Damien Miller3d1b22c1999-11-12 15:46:08 +1100111 fi
Damien Miller7f6ea021999-10-28 13:25:17 +1000112
Damien Miller296a5461999-11-13 10:48:51 +1100113 if [ ! -f $(sysconfdir)/ssh_config -a ! -f $(sysconfdir)/sshd_config ]; then \
Damien Millerd8087f61999-11-25 12:31:26 +1100114 $(INSTALL) -d $(sysconfdir); \
Damien Millerc6b3bbe1999-12-13 08:27:33 +1100115 $(INSTALL) -m 644 ssh_config $(sysconfdir)/ssh_config; \
116 $(INSTALL) -m 644 sshd_config $(sysconfdir)/sshd_config; \
Damien Miller296a5461999-11-13 10:48:51 +1100117 fi
118
Damien Millerbf1c9b21999-12-09 10:16:54 +1100119uninstallall: uninstall
120 -rm -f $(sysconfdir)/ssh_config
121 -rm -f $(sysconfdir)/sshd_config
122 -rmdir $(sysconfdir)
123 -rmdir $(bindir)
124 -rmdir $(sbindir)
125 -rmdir $(mandir)/man1
126 -rmdir $(mandir)/man8
127 -rmdir $(mandir)
128 -rmdir $(libexecdir)
129
130uninstall:
131 -rm -f $(bindir)/ssh
132 -rm -f $(bindir)/scp
133 -rm -f $(bindir)/ssh-add
134 -rm -f $(bindir)/ssh-agent
135 -rm -f $(bindir)/ssh-keygen
136 -rm -f $(sbindir)/sshd
137 -rm -f $(mandir)/man1/ssh.1
138 -rm -f $(mandir)/man1/scp.1
139 -rm -f $(mandir)/man1/ssh-add.1
140 -rm -f $(mandir)/man1/ssh-agent.1
141 -rm -f $(mandir)/man1/ssh-keygen.1
142 -rm -f $(mandir)/man8/sshd.8
143 -rm -f $(bindir)/slogin
144 -rm -f $(mandir)/man1/slogin.1
Damien Millerbf1c9b21999-12-09 10:16:54 +1100145 -rm -f ${ASKPASS_PROGRAM}
146 -rmdir $(libexecdir)/ssh ;
147
Damien Miller7f6ea021999-10-28 13:25:17 +1000148distclean: clean
Damien Miller356a0b01999-11-08 15:30:59 +1100149 rm -f Makefile config.h core *~
Damien Miller7f6ea021999-10-28 13:25:17 +1000150
151mrproper: distclean
Damien Miller356a0b01999-11-08 15:30:59 +1100152
153veryclean: distclean
Damien Millerc7b38ce1999-11-09 10:28:04 +1100154 rm -f configure config.h.in
155