comparison Makefile.in @ 82:8f26145a0997

do the symlinks for multi-binary compiles
author Matt Johnston <matt@ucc.asn.au>
date Tue, 17 Aug 2004 04:35:01 +0000
parents 2a798efbb40b
children ace512d2ad5d
comparison
equal deleted inserted replaced
81:2a798efbb40b 82:8f26145a0997
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 dropbearconvert 12 PROGRAMS=dropbear dbclient dropbearkey dropbearconvert
14 endif 13 endif
15 14
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 \
27 svr-chansession.o svr-runopts.o svr-agentfwd.o svr-main.o svr-x11fwd.o\ 26 svr-chansession.o svr-runopts.o svr-agentfwd.o svr-main.o svr-x11fwd.o\
28 svr-tcpfwd.o 27 svr-tcpfwd.o
32 cli-authpubkey.o cli-tcpfwd.o 31 cli-authpubkey.o cli-tcpfwd.o
33 32
34 CLISVROBJS=common-session.o packet.o common-algo.o common-kex.o \ 33 CLISVROBJS=common-session.o packet.o common-algo.o common-kex.o \
35 common-channel.o common-chansession.o termcodes.o loginrec.o \ 34 common-channel.o common-chansession.o termcodes.o loginrec.o \
36 tcp-accept.o listener.o process-packet.o \ 35 tcp-accept.o listener.o process-packet.o \
37 common-runopts.o fake-rfc2553.o 36 common-runopts.o
38 37
39 KEYOBJS=dropbearkey.o gendss.o genrsa.o 38 KEYOBJS=dropbearkey.o gendss.o genrsa.o
40 39
41 CONVERTOBJS=dropbearconvert.o keyimport.o 40 CONVERTOBJS=dropbearconvert.o keyimport.o
42 41
113 all: $(TARGETS) 112 all: $(TARGETS)
114 113
115 strip: $(TARGETS) 114 strip: $(TARGETS)
116 $(STRIP) $(addsuffix $(EXEEXT), $(addprefix $(SPREFIX), $(TARGETS))) 115 $(STRIP) $(addsuffix $(EXEEXT), $(addprefix $(SPREFIX), $(TARGETS)))
117 116
118 install: $(addprefix install, $(TARGETS)) 117 install: $(addprefix inst, $(TARGETS))
118
119 installdropbearmulti: insdbmulti $(addprefix insmulti, $(PROGRAMS))
120
121 insdbmulti: dropbearmulti
122 $(INSTALL) -d -m 755 $(DESTDIR)$(bindir)
123 $(INSTALL) -m 755 $(SPREFIX)dropbearmulti$(EXEEXT) $(DESTDIR)$(bindir)
124 -chown root $(DESTDIR)$(bindir)/$(SPREFIX)dropbearmulti$(EXEEXT)
125 -chgrp 0 $(DESTDIR)$(bindir)/$(SPREFIX)dropbearmulti$(EXEEXT)
126
127 insmultidropbear: dropbearmulti
128 -rm -f $(DESTDIR)$(sbindir)/$(SPREFIX)dropbear$(EXEEXT)
129 -ln -s $(DESTDIR)$(bindir)/$(SPREFIX)dropbearmulti$(EXEEXT) $(DESTDIR)$(sbindir)/$(SPREFIX)dropbear$(EXEEXT)
130
131 insmulti%: dropbearmulti
132 -rm -f $(DESTDIR)$(bindir)/$(SPREFIX)$*$(EXEEXT)
133 -ln -s $(DESTDIR)$(bindir)/$(SPREFIX)dropbearmulti$(EXEEXT) $(DESTDIR)$(bindir)/$(SPREFIX)$*$(EXEEXT)
119 134
120 # dropbear should go in sbin, so it needs a seperate rule 135 # dropbear should go in sbin, so it needs a seperate rule
121 installdropbear: dropbear 136 instdropbear: dropbear
122 $(INSTALL) -d -m 755 $(DESTDIR)$(sbindir) 137 $(INSTALL) -d -m 755 $(DESTDIR)$(sbindir)
123 $(INSTALL) -m 755 $(SPREFIX)dropbear$(EXEEXT) $(DESTDIR)$(sbindir) 138 $(INSTALL) -m 755 $(SPREFIX)dropbear$(EXEEXT) $(DESTDIR)$(sbindir)
124 -chown root $(DESTDIR)$(sbindir)/$(SPREFIX)dropbear$(EXEEXT) 139 -chown root $(DESTDIR)$(sbindir)/$(SPREFIX)dropbear$(EXEEXT)
125 -chgrp 0 $(DESTDIR)$(sbindir)/$(SPREFIX)dropbear$(EXEEXT) 140 -chgrp 0 $(DESTDIR)$(sbindir)/$(SPREFIX)dropbear$(EXEEXT)
126 141
127 install%: $* 142 inst%: $*
128 $(INSTALL) -d -m 755 $(DESTDIR)$(bindir) 143 $(INSTALL) -d -m 755 $(DESTDIR)$(bindir)
129 $(INSTALL) -m 755 $(SPREFIX)$*$(EXEEXT) $(DESTDIR)$(bindir) 144 $(INSTALL) -m 755 $(SPREFIX)$*$(EXEEXT) $(DESTDIR)$(bindir)
130 -chown root $(DESTDIR)$(bindir)/$(SPREFIX)$*$(EXEEXT) 145 -chown root $(DESTDIR)$(bindir)/$(SPREFIX)$*$(EXEEXT)
131 -chgrp 0 $(DESTDIR)$(bindir)/$(SPREFIX)$*$(EXEEXT) 146 -chgrp 0 $(DESTDIR)$(bindir)/$(SPREFIX)$*$(EXEEXT)
132 ifeq ($(MULTI), 1)
133 @echo
134 @echo "You must manually create links for $*"
135 endif
136
137 147
138 148
139 # for some reason the rule further down doesn't like $($@objs) as a prereq. 149 # for some reason the rule further down doesn't like $($@objs) as a prereq.
140 dropbear: $(dropbearobjs) 150 dropbear: $(dropbearobjs)
141 dbclient: $(dbclientobjs) 151 dbclient: $(dbclientobjs)
156 ifeq ($(MULTI),1) 166 ifeq ($(MULTI),1)
157 MULTIOBJS=dbmulti.o $(sort $(foreach prog, $(PROGRAMS), $($(prog)objs))) 167 MULTIOBJS=dbmulti.o $(sort $(foreach prog, $(PROGRAMS), $($(prog)objs)))
158 CFLAGS+=$(addprefix -DDBMULTI_, $(PROGRAMS)) -DDROPBEAR_MULTI 168 CFLAGS+=$(addprefix -DDBMULTI_, $(PROGRAMS)) -DDROPBEAR_MULTI
159 endif 169 endif
160 170
161 dropbearmulti: $(HEADERS) $(MULTIOBJS) $(LTC) $(LTM) Makefile 171 dropbearmulti: multilink
162 $(LD) $(LDFLAGS) -o $(SPREFIX)$@$(EXEEXT) $(MULTIOBJS) $(LIBS) 172
163 @echo 173 multibinary: $(HEADERS) $(MULTIOBJS) $(LTC) $(LTM) Makefile
164 @echo "You should now create symlinks to the programs you have included" 174 $(LD) $(LDFLAGS) -o $(SPREFIX)dropbearmulti$(EXEEXT) $(MULTIOBJS) $(LIBS)
165 @echo "ie 'ln -s dropbearmulti dropbear'" 175
176 multilink: multibinary $(addprefix link, $(PROGRAMS))
177
178 link%:
179 -rm -f $(SPREFIX)$*$(EXEEXT)
180 -ln -s $(SPREFIX)dropbearmulti$(EXEEXT) $(SPREFIX)$*$(EXEEXT)
166 181
167 $(LTC): options.h 182 $(LTC): options.h
168 cd libtomcrypt && $(MAKE) clean && $(MAKE) 183 cd libtomcrypt && $(MAKE) clean && $(MAKE)
169 184
170 $(LTM): options.h 185 $(LTM): options.h