Makefile 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  1. # This Makefile is for Dropbear SSH Server and Client
  2. # Makefile. Generated from Makefile.in by configure.
  3. # invocation:
  4. # make PROGRAMS="dropbear dbclient scp" MULTI=1 STATIC=1 SCPPROGRESS=1
  5. #
  6. # to make a multiple-program statically linked binary "staticdropbearmulti".
  7. # This example will include dropbear, scp, dropbearkey, dropbearconvert, and
  8. # dbclient functionality, and includes the progress-bar functionality in scp.
  9. # Hopefully that seems intuitive.
  10. ifndef PROGRAMS
  11. PROGRAMS=dropbear dbclient dropbearkey dropbearconvert
  12. endif
  13. STATIC_LTC=libtomcrypt/libtomcrypt.a
  14. STATIC_LTM=libtommath/libtommath.a
  15. LIBTOM_LIBS=
  16. ifeq (1, 1)
  17. LIBTOM_DEPS=$(STATIC_LTC) $(STATIC_LTM)
  18. CFLAGS+=-I$(srcdir)/libtomcrypt/src/headers/
  19. LIBTOM_LIBS=$(STATIC_LTC) $(STATIC_LTM)
  20. endif
  21. COMMONOBJS=dbutil.o buffer.o dbhelpers.o \
  22. dss.o bignum.o \
  23. signkey.o rsa.o dbrandom.o \
  24. queue.o \
  25. atomicio.o compat.o fake-rfc2553.o \
  26. ltc_prng.o ecc.o ecdsa.o crypto_desc.o \
  27. gensignkey.o gendss.o genrsa.o
  28. SVROBJS=svr-kex.o svr-auth.o sshpty.o \
  29. svr-authpasswd.o svr-authpubkey.o svr-authpubkeyoptions.o svr-session.o svr-service.o \
  30. svr-chansession.o svr-runopts.o svr-agentfwd.o svr-main.o svr-x11fwd.o\
  31. svr-tcpfwd.o svr-authpam.o
  32. CLIOBJS=cli-main.o cli-auth.o cli-authpasswd.o cli-kex.o \
  33. cli-session.o cli-runopts.o cli-chansession.o \
  34. cli-authpubkey.o cli-tcpfwd.o cli-channel.o cli-authinteract.o \
  35. cli-agentfwd.o
  36. CLISVROBJS=common-session.o packet.o common-algo.o common-kex.o \
  37. common-channel.o common-chansession.o termcodes.o loginrec.o \
  38. tcp-accept.o listener.o process-packet.o dh_groups.o \
  39. common-runopts.o circbuffer.o curve25519-donna.o list.o netio.o
  40. KEYOBJS=dropbearkey.o
  41. CONVERTOBJS=dropbearconvert.o keyimport.o
  42. SCPOBJS=scp.o progressmeter.o atomicio.o scpmisc.o compat.o
  43. HEADERS=options.h dbutil.h session.h packet.h algo.h ssh.h buffer.h kex.h \
  44. dss.h bignum.h signkey.h rsa.h dbrandom.h service.h auth.h \
  45. debug.h channel.h chansession.h config.h queue.h sshpty.h \
  46. termcodes.h gendss.h genrsa.h runopts.h includes.h \
  47. loginrec.h atomicio.h x11fwd.h agentfwd.h tcpfwd.h compat.h \
  48. listener.h fake-rfc2553.h ecc.h ecdsa.h
  49. dropbearobjs=$(COMMONOBJS) $(CLISVROBJS) $(SVROBJS)
  50. dbclientobjs=$(COMMONOBJS) $(CLISVROBJS) $(CLIOBJS)
  51. dropbearkeyobjs=$(COMMONOBJS) $(KEYOBJS)
  52. dropbearconvertobjs=$(COMMONOBJS) $(CONVERTOBJS)
  53. scpobjs=$(SCPOBJS)
  54. srcdir=.
  55. prefix=/opt/ti-processor-sdk-linux-am335x-evm-04.02.00.09/EVSE/GPL/dropbear-2017.75/release
  56. exec_prefix=${prefix}
  57. datarootdir = ${prefix}/share
  58. bindir=${exec_prefix}/bin
  59. sbindir=${exec_prefix}/sbin
  60. mandir=${datarootdir}/man
  61. CC=/opt/ti-processor-sdk-linux-am335x-evm-04.02.00.09/linux-devkit/sysroots/x86_64-arago-linux/usr/bin/arm-linux-gnueabihf-gcc
  62. AR=ar
  63. RANLIB=ranlib
  64. STRIP=strip
  65. INSTALL=install
  66. CPPFLAGS=
  67. CFLAGS+=-I. -I$(srcdir) $(CPPFLAGS) -Os -W -Wall -Wno-pointer-sign
  68. LIBS+=-lutil -lz
  69. LDFLAGS=
  70. EXEEXT=
  71. # whether we're building client, server, or both for the common objects.
  72. # evilness so we detect 'dropbear' by itself as a word
  73. space:= $(empty) $(empty)
  74. ifneq (,$(strip $(foreach prog, $(PROGRAMS), $(findstring ZdropbearZ, Z$(prog)Z))))
  75. CFLAGS+= -DDROPBEAR_SERVER
  76. endif
  77. ifneq (,$(strip $(foreach prog, $(PROGRAMS), $(findstring ZdbclientZ, Z$(prog)Z))))
  78. CFLAGS+= -DDROPBEAR_CLIENT
  79. endif
  80. # these are exported so that libtomcrypt's makefile will use them
  81. export CC
  82. export CFLAGS
  83. export RANLIB AR STRIP
  84. ifeq ($(STATIC), 1)
  85. LDFLAGS+=-static
  86. endif
  87. ifeq ($(MULTI), 1)
  88. TARGETS=dropbearmulti
  89. else
  90. TARGETS=$(PROGRAMS)
  91. endif
  92. # for the scp progress meter. The -D doesn't affect anything else.
  93. ifeq ($(SCPPROGRESS), 1)
  94. CFLAGS+=-DPROGRESS_METER
  95. endif
  96. all: $(TARGETS)
  97. strip: $(TARGETS)
  98. $(STRIP) $(addsuffix $(EXEEXT), $(TARGETS))
  99. install: $(addprefix inst_, $(TARGETS))
  100. insmultidropbear: dropbearmulti
  101. $(INSTALL) -d $(DESTDIR)$(sbindir)
  102. -rm -f $(DESTDIR)$(sbindir)/dropbear$(EXEEXT)
  103. -ln -s $(bindir)/dropbearmulti$(EXEEXT) $(DESTDIR)$(sbindir)/dropbear$(EXEEXT)
  104. $(INSTALL) -d $(DESTDIR)$(mandir)/man8
  105. $(INSTALL) -m 644 $(srcdir)/dropbear.8 $(DESTDIR)$(mandir)/man8/dropbear.8
  106. insmulti%: dropbearmulti
  107. $(INSTALL) -d $(DESTDIR)$(bindir)
  108. -rm -f $(DESTDIR)$(bindir)/$*$(EXEEXT)
  109. -ln -s $(bindir)/dropbearmulti$(EXEEXT) $(DESTDIR)$(bindir)/$*$(EXEEXT)
  110. $(INSTALL) -d $(DESTDIR)$(mandir)/man1
  111. if test -e $*.1; then $(INSTALL) -m 644 $*.1 $(DESTDIR)$(mandir)/man1/$*.1; fi
  112. # dropbear should go in sbin, so it needs a separate rule
  113. inst_dropbear: dropbear
  114. $(INSTALL) -d $(DESTDIR)$(sbindir)
  115. $(INSTALL) dropbear$(EXEEXT) $(DESTDIR)$(sbindir)
  116. $(INSTALL) -d $(DESTDIR)$(mandir)/man8
  117. $(INSTALL) -m 644 $(srcdir)/dropbear.8 $(DESTDIR)$(mandir)/man8/dropbear.8
  118. inst_%: %
  119. $(INSTALL) -d $(DESTDIR)$(bindir)
  120. $(INSTALL) $*$(EXEEXT) $(DESTDIR)$(bindir)
  121. $(INSTALL) -d $(DESTDIR)$(mandir)/man1
  122. if test -e $*.1; then $(INSTALL) -m 644 $*.1 $(DESTDIR)$(mandir)/man1/$*.1; fi
  123. inst_dropbearmulti: $(addprefix insmulti, $(PROGRAMS))
  124. # for some reason the rule further down doesn't like $($@objs) as a prereq.
  125. dropbear: $(dropbearobjs)
  126. dbclient: $(dbclientobjs)
  127. dropbearkey: $(dropbearkeyobjs)
  128. dropbearconvert: $(dropbearconvertobjs)
  129. dropbear: $(HEADERS) $(LIBTOM_DEPS) Makefile
  130. $(CC) $(LDFLAGS) -o $@$(EXEEXT) $($@objs) $(LIBTOM_LIBS) $(LIBS) -lcrypt
  131. dbclient: $(HEADERS) $(LIBTOM_DEPS) Makefile
  132. $(CC) $(LDFLAGS) -o $@$(EXEEXT) $($@objs) $(LIBTOM_LIBS) $(LIBS)
  133. dropbearkey dropbearconvert: $(HEADERS) $(LIBTOM_DEPS) Makefile
  134. $(CC) $(LDFLAGS) -o $@$(EXEEXT) $($@objs) $(LIBTOM_LIBS)
  135. # scp doesn't use the libs so is special.
  136. scp: $(SCPOBJS) $(HEADERS) Makefile
  137. $(CC) $(LDFLAGS) -o $@$(EXEEXT) $(SCPOBJS)
  138. # multi-binary compilation.
  139. MULTIOBJS=
  140. ifeq ($(MULTI),1)
  141. MULTIOBJS=dbmulti.o $(sort $(foreach prog, $(PROGRAMS), $($(prog)objs)))
  142. CFLAGS+=$(addprefix -DDBMULTI_, $(PROGRAMS)) -DDROPBEAR_MULTI
  143. endif
  144. dropbearmulti$(EXEEXT): $(HEADERS) $(MULTIOBJS) $(LIBTOM_DEPS) Makefile
  145. $(CC) $(LDFLAGS) -o $@ $(MULTIOBJS) $(LIBTOM_LIBS) $(LIBS) -lcrypt
  146. multibinary: dropbearmulti$(EXEEXT)
  147. multilink: multibinary $(addprefix link, $(PROGRAMS))
  148. link%:
  149. -rm -f $*$(EXEEXT)
  150. -ln -s dropbearmulti$(EXEEXT) $*$(EXEEXT)
  151. $(STATIC_LTC): options.h
  152. cd libtomcrypt && $(MAKE)
  153. $(STATIC_LTM): options.h
  154. cd libtommath && $(MAKE)
  155. .PHONY : clean sizes thisclean distclean tidy ltc-clean ltm-clean
  156. ltc-clean:
  157. cd libtomcrypt && $(MAKE) clean
  158. ltm-clean:
  159. cd libtommath && $(MAKE) clean
  160. sizes: dropbear
  161. objdump -t dropbear|grep ".text"|cut -d "." -f 2|sort -rn
  162. clean: ltc-clean ltm-clean thisclean
  163. thisclean:
  164. -rm -f dropbear dbclient dropbearkey dropbearconvert scp scp-progress \
  165. dropbearmulti *.o *.da *.bb *.bbg *.prof
  166. distclean: clean tidy
  167. -rm -f config.h
  168. -rm -f Makefile
  169. tidy:
  170. -rm -f *~ *.gcov */*~