comparison Makefile.in @ 118:5312ca05ed48 private-rez

propagate of 717950f4061f1123659ee87c7c168805af920ab7 and 839f98f136788cc1466e4641bf796f96040a085d from branch 'matt.dbclient.authpam' to 'matt.dbclient.rez'
author Matt Johnston <matt@ucc.asn.au>
date Sun, 12 Sep 2004 04:56:50 +0000
parents 3b2a5a1c4347 d3eb1fa8484e
children 3394a7cb30cd
comparison
equal deleted inserted replaced
57:3b2a5a1c4347 118:5312ca05ed48
1 # This Makefile is for Dropbear SSH Server and Client 1 # This Makefile is for Dropbear SSH Server and Client
2 2
3 # invocation: 3 # invocation:
4 # make PROGRAMS="dropbear dbclient scp" MULTI=1 STATIC=1 SCPPROGRESS=1 4 # make PROGRAMS="dropbear dbclient scp" MULTI=1 STATIC=1 SCPPROGRESS=1
5 # 5 #
6 # to make a single multiple statically linked binary "staticdropbearmulti", 6 # to make a multiple-program statically linked binary "staticdropbearmulti".
7 # which includes dropbear, scp and dbclient functionality, and includes the 7 # This example will include dropbear, scp, dropbearkey, dropbearconvert, and
8 # progress-bar functionality in scp. Hopefully that seems intuitive. 8 # dbclient functionality, and includes the progress-bar functionality in scp.
9 9 # Hopefully that seems intuitive.
10 # This makefile is quite evil.
11 10
12 ifndef PROGRAMS 11 ifndef PROGRAMS
13 PROGRAMS=dropbear dbclient dropbearkey dropbearkey 12 PROGRAMS=dropbear dbclient dropbearkey dropbearconvert
14 endif 13 endif
15 14
16 LTC=libtomcrypt/libtomcrypt.a 15 LTC=libtomcrypt/libtomcrypt.a
17 LTM=libtommath/libtommath.a 16 LTM=libtommath/libtommath.a
18 17
19 COMMONOBJS=dbutil.o buffer.o \ 18 COMMONOBJS=dbutil.o buffer.o \
20 dss.o bignum.o \ 19 dss.o bignum.o \
21 signkey.o rsa.o random.o \ 20 signkey.o rsa.o random.o \
22 queue.o \ 21 queue.o \
23 atomicio.o compat.o 22 atomicio.o compat.o fake-rfc2553.o
24 23
25 SVROBJS=svr-kex.o svr-algo.o svr-auth.o sshpty.o \ 24 SVROBJS=svr-kex.o svr-algo.o svr-auth.o sshpty.o \
26 svr-authpasswd.o svr-authpubkey.o svr-session.o svr-service.o \ 25 svr-authpasswd.o svr-authpubkey.o svr-session.o svr-service.o \
26 svr-authpam.o
27 svr-chansession.o svr-runopts.o svr-agentfwd.o svr-main.o svr-x11fwd.o\ 27 svr-chansession.o svr-runopts.o svr-agentfwd.o svr-main.o svr-x11fwd.o\
28 svr-authpam.o 28 svr-tcpfwd.o
29 29
30 CLIOBJS=cli-algo.o cli-main.o cli-auth.o cli-authpasswd.o cli-kex.o \ 30 CLIOBJS=cli-algo.o cli-main.o cli-auth.o cli-authpasswd.o cli-kex.o \
31 cli-session.o cli-service.o cli-runopts.o cli-chansession.o \ 31 cli-session.o cli-service.o cli-runopts.o cli-chansession.o \
32 cli-authpubkey.o 32 cli-authpubkey.o cli-tcpfwd.o cli-channel.o
33 33
34 CLISVROBJS=common-session.o packet.o common-algo.o common-kex.o \ 34 CLISVROBJS=common-session.o packet.o common-algo.o common-kex.o \
35 common-channel.o common-chansession.o termcodes.o loginrec.o \ 35 common-channel.o common-chansession.o termcodes.o loginrec.o \
36 tcpfwd-direct.o tcpfwd-remote.o listener.o process-packet.o \ 36 tcp-accept.o listener.o process-packet.o \
37 common-runopts.o 37 common-runopts.o circbuffer.o
38 38
39 KEYOBJS=dropbearkey.o gendss.o genrsa.o 39 KEYOBJS=dropbearkey.o gendss.o genrsa.o
40 40
41 CONVERTOBJS=dropbearconvert.o keyimport.o 41 CONVERTOBJS=dropbearconvert.o keyimport.o
42 42
43 SCPOBJS=scp.o progressmeter.o atomicio.o scpmisc.o 43 SCPOBJS=scp.o progressmeter.o atomicio.o scpmisc.o
44 44
45 HEADERS=options.h dbutil.h session.h packet.h algo.h ssh.h buffer.h kex.h \ 45 HEADERS=options.h dbutil.h session.h packet.h algo.h ssh.h buffer.h kex.h \
46 dss.h bignum.h signkey.h rsa.h random.h service.h auth.h authpasswd.h \ 46 dss.h bignum.h signkey.h rsa.h random.h service.h auth.h \
47 debug.h channel.h chansession.h config.h queue.h sshpty.h \ 47 debug.h channel.h chansession.h config.h queue.h sshpty.h \
48 termcodes.h gendss.h genrsa.h authpubkey.h runopts.h includes.h \ 48 termcodes.h gendss.h genrsa.h runopts.h includes.h \
49 loginrec.h atomicio.h x11fwd.h agentfwd.h tcpfwd-direct.h compat.h \ 49 loginrec.h atomicio.h x11fwd.h agentfwd.h tcpfwd.h compat.h \
50 tcpfwd-remote.h listener.h 50 listener.h fake-rfc2553.h
51 51
52 dropbearobjs=$(COMMONOBJS) $(CLISVROBJS) $(SVROBJS) 52 dropbearobjs=$(COMMONOBJS) $(CLISVROBJS) $(SVROBJS)
53 dbclientobjs=$(COMMONOBJS) $(CLISVROBJS) $(CLIOBJS) 53 dbclientobjs=$(COMMONOBJS) $(CLISVROBJS) $(CLIOBJS)
54 dropbearkeyobjs=$(COMMONOBJS) $(KEYOBJS) 54 dropbearkeyobjs=$(COMMONOBJS) $(KEYOBJS)
55 dropbearconvertobjs=$(COMMONOBJS) $(CONVERTOBJS) 55 dropbearconvertobjs=$(COMMONOBJS) $(CONVERTOBJS)
113 all: $(TARGETS) 113 all: $(TARGETS)
114 114
115 strip: $(TARGETS) 115 strip: $(TARGETS)
116 $(STRIP) $(addsuffix $(EXEEXT), $(addprefix $(SPREFIX), $(TARGETS))) 116 $(STRIP) $(addsuffix $(EXEEXT), $(addprefix $(SPREFIX), $(TARGETS)))
117 117
118 install: $(addprefix install, $(TARGETS)) 118 install: $(addprefix inst, $(TARGETS))
119
120 installdropbearmulti: insdbmulti $(addprefix insmulti, $(PROGRAMS))
121
122 insdbmulti: dropbearmulti
123 $(INSTALL) -d -m 755 $(DESTDIR)$(bindir)
124 $(INSTALL) -m 755 $(SPREFIX)dropbearmulti$(EXEEXT) $(DESTDIR)$(bindir)
125 -chown root $(DESTDIR)$(bindir)/$(SPREFIX)dropbearmulti$(EXEEXT)
126 -chgrp 0 $(DESTDIR)$(bindir)/$(SPREFIX)dropbearmulti$(EXEEXT)
127
128 insmultidropbear: dropbearmulti
129 -rm -f $(DESTDIR)$(sbindir)/$(SPREFIX)dropbear$(EXEEXT)
130 -ln -s $(DESTDIR)$(bindir)/$(SPREFIX)dropbearmulti$(EXEEXT) $(DESTDIR)$(sbindir)/$(SPREFIX)dropbear$(EXEEXT)
131
132 insmulti%: dropbearmulti
133 -rm -f $(DESTDIR)$(bindir)/$(SPREFIX)$*$(EXEEXT)
134 -ln -s $(DESTDIR)$(bindir)/$(SPREFIX)dropbearmulti$(EXEEXT) $(DESTDIR)$(bindir)/$(SPREFIX)$*$(EXEEXT)
119 135
120 # dropbear should go in sbin, so it needs a seperate rule 136 # dropbear should go in sbin, so it needs a seperate rule
121 installdropbear: dropbear 137 instdropbear: dropbear
122 $(INSTALL) -d -m 755 $(DESTDIR)$(sbindir) 138 $(INSTALL) -d -m 755 $(DESTDIR)$(sbindir)
123 $(INSTALL) -m 755 $(SPREFIX)dropbear$(EXEEXT) $(DESTDIR)$(sbindir) 139 $(INSTALL) -m 755 $(SPREFIX)dropbear$(EXEEXT) $(DESTDIR)$(sbindir)
124 -chown root $(DESTDIR)$(sbindir)/$(SPREFIX)dropbear$(EXEEXT) 140 -chown root $(DESTDIR)$(sbindir)/$(SPREFIX)dropbear$(EXEEXT)
125 -chgrp 0 $(DESTDIR)$(sbindir)/$(SPREFIX)dropbear$(EXEEXT) 141 -chgrp 0 $(DESTDIR)$(sbindir)/$(SPREFIX)dropbear$(EXEEXT)
126 142
127 install%: $* 143 inst%: $*
128 $(INSTALL) -d -m 755 $(DESTDIR)$(bindir) 144 $(INSTALL) -d -m 755 $(DESTDIR)$(bindir)
129 $(INSTALL) -m 755 $(SPREFIX)$*$(EXEEXT) $(DESTDIR)$(bindir) 145 $(INSTALL) -m 755 $(SPREFIX)$*$(EXEEXT) $(DESTDIR)$(bindir)
130 -chown root $(DESTDIR)$(sbindir)/$(SPREFIX)$*$(EXEEXT) 146 -chown root $(DESTDIR)$(bindir)/$(SPREFIX)$*$(EXEEXT)
131 -chgrp 0 $(DESTDIR)$(sbindir)/$(SPREFIX)$*$(EXEEXT) 147 -chgrp 0 $(DESTDIR)$(bindir)/$(SPREFIX)$*$(EXEEXT)
132 ifeq ($(MULTI), 1)
133 @echo
134 @echo "You must manually create links for $*"
135 endif
136
137 148
138 149
139 # for some reason the rule further down doesn't like $($@objs) as a prereq. 150 # for some reason the rule further down doesn't like $($@objs) as a prereq.
140 dropbear: $(dropbearobjs) 151 dropbear: $(dropbearobjs)
141 dbclient: $(dbclientobjs) 152 dbclient: $(dbclientobjs)
156 ifeq ($(MULTI),1) 167 ifeq ($(MULTI),1)
157 MULTIOBJS=dbmulti.o $(sort $(foreach prog, $(PROGRAMS), $($(prog)objs))) 168 MULTIOBJS=dbmulti.o $(sort $(foreach prog, $(PROGRAMS), $($(prog)objs)))
158 CFLAGS+=$(addprefix -DDBMULTI_, $(PROGRAMS)) -DDROPBEAR_MULTI 169 CFLAGS+=$(addprefix -DDBMULTI_, $(PROGRAMS)) -DDROPBEAR_MULTI
159 endif 170 endif
160 171
161 dropbearmulti: $(HEADERS) $(MULTIOBJS) $(LTC) $(LTM) Makefile 172 dropbearmulti: multilink
162 $(LD) $(LDFLAGS) -o $(SPREFIX)$@$(EXEEXT) $(MULTIOBJS) $(LIBS) 173
163 @echo 174 multibinary: $(HEADERS) $(MULTIOBJS) $(LTC) $(LTM) Makefile
164 @echo "You should now create symlinks to the programs you have included" 175 $(LD) $(LDFLAGS) -o $(SPREFIX)dropbearmulti$(EXEEXT) $(MULTIOBJS) $(LIBS)
165 @echo "ie 'ln -s dropbearmulti dropbear'" 176
177 multilink: multibinary $(addprefix link, $(PROGRAMS))
178
179 link%:
180 -rm -f $(SPREFIX)$*$(EXEEXT)
181 -ln -s $(SPREFIX)dropbearmulti$(EXEEXT) $(SPREFIX)$*$(EXEEXT)
166 182
167 $(LTC): options.h 183 $(LTC): options.h
168 cd libtomcrypt && $(MAKE) clean && $(MAKE) 184 cd libtomcrypt && $(MAKE) clean && $(MAKE)
169 185
170 $(LTM): options.h 186 $(LTM): options.h
177 cd libtommath && $(MAKE) clean 193 cd libtommath && $(MAKE) clean
178 194
179 sizes: dropbear 195 sizes: dropbear
180 objdump -t dropbear|grep ".text"|cut -d "." -f 2|sort -rn 196 objdump -t dropbear|grep ".text"|cut -d "." -f 2|sort -rn
181 197
182 clean: ltc-clean ltm-clean 198 clean: ltc-clean ltm-clean thisclean
199
200 thisclean:
183 -rm -f dropbear dbclient dropbearkey dropbearconvert scp scp-progress 201 -rm -f dropbear dbclient dropbearkey dropbearconvert scp scp-progress
184 -rm -f staticdropbear staticdropbearkey staticdropbearconvert staticscp 202 -rm -f staticdropbear staticdropbearkey staticdropbearconvert staticscp
185 -rm -f dropbearmulti staticdropbearmulti 203 -rm -f dropbearmulti staticdropbearmulti
186 -rm -f *.o *.da *.bb *.bbg *.prof 204 -rm -f *.o *.da *.bb *.bbg *.prof
187 205