blob: 365df018f502cb4f6d8d927ea48ffa1c5c0ffab8 [file] [log] [blame]
Damien Miller7f6ea021999-10-28 13:25:17 +10001prefix=@prefix@
2exec_prefix=@exec_prefix@
3bindir=@bindir@
4sbindir=@sbindir@
5libdir=@libdir@
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
10ASKPASS_PROGRAM=@libdir@/ssh/ssh-askpass
11
Damien Miller7f6ea021999-10-28 13:25:17 +100012CC=@CC@
Damien Miller296a5461999-11-13 10:48:51 +110013PATHS=-DETCDIR=\"$(sysconfdir)\" -DSSH_PROGRAM=\"$(SSH_PROGRAM)\" -DASKPASS_PROGRAM=\"$(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 Miller7f6ea021999-10-28 13:25:17 +100018AR=@AR@
19RANLIB=@RANLIB@
20
Damien Millerd3dcfaf1999-11-09 13:52:33 +110021GNOME_CFLAGS=`gnome-config --cflags gnome gnomeui`
22GNOME_LIBS=`gnome-config --libs gnome gnomeui`
23
Damien Miller7f6ea021999-10-28 13:25:17 +100024OBJS= authfd.o authfile.o auth-passwd.o auth-rhosts.o auth-rh-rsa.o \
25 auth-rsa.o bufaux.o buffer.o canohost.o channels.o cipher.o \
26 clientloop.o compress.o crc32.o deattack.o helper.o hostfile.o \
27 log-client.o login.o log-server.o match.o mpaux.o packet.o pty.o \
28 readconf.o readpass.o rsa.o servconf.o serverloop.o \
29 sshconnect.o tildexpand.o ttymodes.o uidswap.o xmalloc.o \
30 helper.o mktemp.o strlcpy.o rc4.o
31
32all: $(OBJS) $(TARGETS)
33
Damien Miller5ce662a1999-11-11 17:57:39 +110034libssh.a: authfd.o authfile.o bufaux.o buffer.o canohost.o channels.o cipher.o compat.o compress.o crc32.o deattack.o hostfile.o match.o mpaux.o nchan.o packet.o readpass.o rsa.o tildexpand.o ttymodes.o uidswap.o xmalloc.o helper.o rc4.o mktemp.o strlcpy.o log.o
Damien Miller7f6ea021999-10-28 13:25:17 +100035 $(AR) rv $@ $^
36 $(RANLIB) $@
37
Damien Millerd3dcfaf1999-11-09 13:52:33 +110038ssh: ssh.o sshconnect.o log-client.o readconf.o clientloop.o libssh.a
Damien Miller7f6ea021999-10-28 13:25:17 +100039 $(CC) -o $@ $^ $(LFLAGS) $(LIBS)
40
Damien Millerd3dcfaf1999-11-09 13:52:33 +110041sshd: sshd.o auth-rhosts.o auth-passwd.o auth-rsa.o auth-rh-rsa.o pty.o log-server.o login.o servconf.o serverloop.o libssh.a
Damien Miller7f6ea021999-10-28 13:25:17 +100042 $(CC) -o $@ $^ $(LFLAGS) $(LIBS)
43
Damien Millerd3dcfaf1999-11-09 13:52:33 +110044scp: scp.o libssh.a
Damien Miller7f6ea021999-10-28 13:25:17 +100045 $(CC) -o $@ $^ $(LFLAGS) $(LIBS)
46
Damien Millerd3dcfaf1999-11-09 13:52:33 +110047ssh-add: ssh-add.o log-client.o libssh.a
Damien Miller7f6ea021999-10-28 13:25:17 +100048 $(CC) -o $@ $^ $(LFLAGS) $(LIBS)
49
Damien Millerd3dcfaf1999-11-09 13:52:33 +110050ssh-agent: ssh-agent.o log-client.o libssh.a
Damien Miller7f6ea021999-10-28 13:25:17 +100051 $(CC) -o $@ $^ $(LFLAGS) $(LIBS)
52
Damien Millerd3dcfaf1999-11-09 13:52:33 +110053ssh-keygen: ssh-keygen.o log-client.o libssh.a
Damien Miller7f6ea021999-10-28 13:25:17 +100054 $(CC) -o $@ $^ $(LFLAGS) $(LIBS)
55
Damien Millerd3dcfaf1999-11-09 13:52:33 +110056gnome-ssh-askpass: gnome-ssh-askpass.c
57 $(CC) $(CFLAGS) $(GNOME_CFLAGS) -o $@ gnome-ssh-askpass.c $(GNOME_LIBS)
58
Damien Miller7f6ea021999-10-28 13:25:17 +100059clean:
Damien Miller3c5cb381999-10-29 12:06:53 +100060 rm -f *.o core $(TARGETS) config.status config.cache config.log
Damien Miller356a0b01999-11-08 15:30:59 +110061
Damien Millercdb8b1d1999-11-09 14:31:49 +110062install: all
Damien Miller7f6ea021999-10-28 13:25:17 +100063 install -d $(bindir)
64 install -d $(sbindir)
Damien Miller94388161999-10-29 09:57:31 +100065 install -d $(mandir)
66 install -d $(mandir)/man1
67 install -d $(mandir)/man8
Damien Miller3c5cb381999-10-29 12:06:53 +100068 install -s -c ssh $(bindir)/ssh
69 install -s -c scp $(bindir)/scp
70 install -s -c ssh-add $(bindir)/ssh-add
71 install -s -c ssh-agent $(bindir)/ssh-agent
72 install -s -c ssh-keygen $(bindir)/ssh-keygen
73 install -s -c sshd $(sbindir)/sshd
Damien Miller94388161999-10-29 09:57:31 +100074 install -m644 -c ssh.1 $(mandir)/man1/ssh.1
75 install -m644 -c scp.1 $(mandir)/man1/scp.1
76 install -m644 -c ssh-add.1 $(mandir)/man1/ssh-add.1
77 install -m644 -c ssh-agent.1 $(mandir)/man1/ssh-agent.1
78 install -m644 -c ssh-keygen.1 $(mandir)/man1/ssh-keygen.1
79 install -m644 -c sshd.8 $(mandir)/man8/sshd.8
Damien Miller3d1b22c1999-11-12 15:46:08 +110080 ln -sf ssh $(bindir)/slogin
81 ln -sf ssh.1 $(mandir)/man1/slogin.1
82
Damien Miller06e42931999-11-12 16:36:21 +110083 if [ ! -z "@INSTALL_ASKPASS@" ] ; then \
Damien Miller3ba1fe11999-11-12 16:32:17 +110084 install -d $(libdir) ; \
85 install -d $(libdir)/ssh ; \
Damien Miller3d1b22c1999-11-12 15:46:08 +110086 if [ -z "@GNOME_ASKPASS@" ] ; then \
87 install -m755 -c ssh-askpass $(libdir)/ssh/ssh-askpass; \
88 else \
89 install -m755 -c gnome-ssh-askpass $(libdir)/ssh/ssh-askpass; \
Damien Miller3ba1fe11999-11-12 16:32:17 +110090 fi ; \
Damien Miller3d1b22c1999-11-12 15:46:08 +110091 fi
Damien Miller7f6ea021999-10-28 13:25:17 +100092
Damien Miller296a5461999-11-13 10:48:51 +110093 if [ ! -f $(sysconfdir)/ssh_config -a ! -f $(sysconfdir)/sshd_config ]; then \
94 install -d $(sysconfdir); \
95 install -m644 ssh_config $(sysconfdir)/ssh_config; \
96 install -m644 sshd_config $(sysconfdir)/sshd_config; \
97 fi
98
Damien Miller7f6ea021999-10-28 13:25:17 +100099distclean: clean
Damien Miller356a0b01999-11-08 15:30:59 +1100100 rm -f Makefile config.h core *~
Damien Miller7f6ea021999-10-28 13:25:17 +1000101
102mrproper: distclean
Damien Miller356a0b01999-11-08 15:30:59 +1100103
104veryclean: distclean
Damien Millerc7b38ce1999-11-09 10:28:04 +1100105 rm -f configure config.h.in
106