Makefile.ssl 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338
  1. #
  2. # Makefile for all the SSL related library routines and utilities
  3. VERSION = 0.9.1b
  4. PLATFORM=debug
  5. #
  6. # make install will install:
  7. # libraries into $INSTALLTOP/lib
  8. # headers into $INSTALLTOP/include
  9. # utilities into $INSTALLTOP/bin
  10. #
  11. # By default INSTALLTOP is set to /usr/local/ssl
  12. # If you want things install elsewere, consider running
  13. # perl util/ssldir.pl /new/path
  14. #
  15. # Interesting Mailing Lists:
  16. # ssl-bugs@mincom.oz.au
  17. # ssl-users@mincom.oz.au
  18. #
  19. # To join the Mailing Lists:
  20. # ssl-bugs-request@mincom.oz.au
  21. # ssl-users-request@mincom.oz.au
  22. #
  23. # If you must get hold of people directly (we much prefer the above
  24. # lists to be used if the question is of general interest!):
  25. # Eric Young <eay@cryptsoft.com>
  26. # Tim Hudson <tjh@cryptsoft.com>
  27. # or both <ssleay@cryptsoft.com>
  28. #
  29. # The primary distribution of SSLeay is from
  30. # ftp://ftp.psy.uq.oz.au/pub/Crypto/SSL
  31. #
  32. # NOCONST - Define for C compilers that don't like the const key word.
  33. # NOPROTO - Define in if your compiler does not support prototypes.
  34. # RSAref - Define if we are to link with RSAref.
  35. # NO_IDEA - Define to build without the IDEA algorithm
  36. # NO_RC4 - Define to build without the RC4 algorithm
  37. # NO_RC2 - Define to build without the RC2 algorithm
  38. # THREADS - Define when building with threads, you will probably also need any
  39. # system defines as well, i.e. _REENTERANT for Solaris 2.[34]
  40. # TERMIO - Define the termio terminal subsystem, needed if sgtty is missing.
  41. # TERMIOS - Define the termios terminal subsystem, Silicon Graphics.
  42. # LONGCRYPT - Define to use HPUX 10.x's long password modification to crypt(3).
  43. # DEVRANDOM - Give this the value of the 'random device' if your OS supports
  44. # one. 32 bytes will be read from this when the random
  45. # number generator is initalised.
  46. # SSL_ALLOW_ADH - define if you want the server to be able to use the
  47. # SSLv3 anon-DH ciphers.
  48. # SSL_ALLOW_ENULL - define if you want the server to be able to use the
  49. # NULL encryption ciphers.
  50. #
  51. # LOCK_DEBUG - turns on lots of lock debug output :-)
  52. # REF_CHECK - turn on some xyz_free() assertions.
  53. # REF_PRINT - prints some stuff on structure free.
  54. # CRYPTO_MDEBUG - turns on my 'memory leak' detecting stuff
  55. # MFUNC - Make all Malloc/Free/Realloc calls call
  56. # CRYPTO_malloc/CRYPTO_free/CRYPTO_realloc which can be setup to
  57. # call application defined callbacks via CRYPTO_set_mem_functions()
  58. # MD5_ASM needs to be defined to use the x86 assembler for MD5
  59. # SHA1_ASM needs to be defined to use the x86 assembler for SHA1
  60. # RMD160_ASM needs to be defined to use the x86 assembler for RIPEMD160
  61. # Do not define B_ENDIAN or L_ENDIAN if 'unsigned long' == 8. It must
  62. # equal 4.
  63. # PKCS1_CHECK - pkcs1 tests.
  64. CC= gcc
  65. #CFLAG= -DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -m486 -Wall -Wuninitialized -DSHA1_ASM -DMD5_ASM -DRMD160_ASM
  66. CFLAG= -DBN_DEBUG -DREF_CHECK -DCRYPTO_MDEBUG -ggdb -g2 -Wformat -Wshadow -Wmissing-prototypes -Wmissing-declarations -Werror
  67. PEX_LIBS= -L. -L.. -L../.. -L../../..
  68. EX_LIBS= -lefence
  69. AR=ar r
  70. # Set BN_ASM to bn_asm.o if you want to use the C version
  71. BN_ASM= bn_asm.o
  72. #BN_ASM= bn_asm.o
  73. #BN_ASM= asm/bn86-elf.o # elf, linux-elf
  74. #BN_ASM= asm/bn86-sol.o # solaris
  75. #BN_ASM= asm/bn86-out.o # a.out, FreeBSD
  76. #BN_ASM= asm/bn86bsdi.o # bsdi
  77. #BN_ASM= asm/alpha.o # DEC Alpha
  78. #BN_ASM= asm/pa-risc2.o # HP-UX PA-RISC
  79. #BN_ASM= asm/r3000.o # SGI MIPS cpu
  80. #BN_ASM= asm/sparc.o # Sun solaris/SunOS
  81. #BN_ASM= asm/bn-win32.o # Windows 95/NT
  82. #BN_ASM= asm/x86w16.o # 16 bit code for Windows 3.1/DOS
  83. #BN_ASM= asm/x86w32.o # 32 bit code for Windows 3.1
  84. # Set DES_ENC to des_enc.o if you want to use the C version
  85. #There are 4 x86 assember options.
  86. DES_ENC= des_enc.o fcrypt_b.o
  87. #DES_ENC= des_enc.o fcrypt_b.o # C
  88. #DES_ENC= asm/dx86-elf.o asm/yx86-elf.o # elf
  89. #DES_ENC= asm/dx86-sol.o asm/yx86-sol.o # solaris
  90. #DES_ENC= asm/dx86-out.o asm/yx86-out.o # a.out, FreeBSD
  91. #DES_ENC= asm/dx86bsdi.o asm/yx86bsdi.o # bsdi
  92. # Set BF_ENC to bf_enc.o if you want to use the C version
  93. #There are 4 x86 assember options.
  94. BF_ENC= bf_enc.o
  95. #BF_ENC= bf_enc.o
  96. #BF_ENC= asm/bx86-elf.o # elf
  97. #BF_ENC= asm/bx86-sol.o # solaris
  98. #BF_ENC= asm/bx86-out.o # a.out, FreeBSD
  99. #BF_ENC= asm/bx86bsdi.o # bsdi
  100. # Set CAST_ENC to c_enc.o if you want to use the C version
  101. #There are 4 x86 assember options.
  102. CAST_ENC= c_enc.o
  103. #CAST_ENC= c_enc.o
  104. #CAST_ENC= asm/cx86-elf.o # elf
  105. #CAST_ENC= asm/cx86-sol.o # solaris
  106. #CAST_ENC= asm/cx86-out.o # a.out, FreeBSD
  107. #CAST_ENC= asm/cx86bsdi.o # bsdi
  108. # Set RC4_ENC to rc4_enc.o if you want to use the C version
  109. #There are 4 x86 assember options.
  110. RC4_ENC= rc4_enc.o
  111. #RC4_ENC= rc4_enc.o
  112. #RC4_ENC= asm/rx86-elf.o # elf
  113. #RC4_ENC= asm/rx86-sol.o # solaris
  114. #RC4_ENC= asm/rx86-out.o # a.out, FreeBSD
  115. #RC4_ENC= asm/rx86bsdi.o # bsdi
  116. # Set RC5_ENC to rc5_enc.o if you want to use the C version
  117. #There are 4 x86 assember options.
  118. RC5_ENC= rc5_enc.o
  119. #RC5_ENC= rc5_enc.o
  120. #RC5_ENC= asm/r586-elf.o # elf
  121. #RC5_ENC= asm/r586-sol.o # solaris
  122. #RC5_ENC= asm/r586-out.o # a.out, FreeBSD
  123. #RC5_ENC= asm/r586bsdi.o # bsdi
  124. # Also need MD5_ASM defined
  125. MD5_ASM_OBJ=
  126. #MD5_ASM_OBJ= asm/mx86-elf.o # elf
  127. #MD5_ASM_OBJ= asm/mx86-sol.o # solaris
  128. #MD5_ASM_OBJ= asm/mx86-out.o # a.out, FreeBSD
  129. #MD5_ASM_OBJ= asm/mx86bsdi.o # bsdi
  130. # Also need SHA1_ASM defined
  131. SHA1_ASM_OBJ=
  132. #SHA1_ASM_OBJ= asm/sx86-elf.o # elf
  133. #SHA1_ASM_OBJ= asm/sx86-sol.o # solaris
  134. #SHA1_ASM_OBJ= asm/sx86-out.o # a.out, FreeBSD
  135. #SHA1_ASM_OBJ= asm/sx86bsdi.o # bsdi
  136. # Also need RMD160_ASM defined
  137. RMD160_ASM_OBJ=
  138. #RMD160_ASM_OBJ= asm/rm86-elf.o # elf
  139. #RMD160_ASM_OBJ= asm/rm86-sol.o # solaris
  140. #RMD160_ASM_OBJ= asm/rm86-out.o # a.out, FreeBSD
  141. #RMD160_ASM_OBJ= asm/rm86bsdi.o # bsdi
  142. DIRS= crypto ssl rsaref apps test tools
  143. # dirs in crypto to build
  144. SDIRS= \
  145. md2 md5 sha mdc2 hmac ripemd \
  146. des rc2 rc4 rc5 idea bf cast \
  147. bn rsa dsa dh \
  148. buffer bio stack lhash rand err objects \
  149. evp pem asn1 x509 conf txt_db pkcs7 comp
  150. # If you change the INSTALLTOP, make sure to also change the values
  151. # in crypto/location.h
  152. INSTALLTOP=/usr/local/ssl
  153. MAKEFILE= Makefile.ssl
  154. MAKE= make -f Makefile.ssl
  155. MAN1=1
  156. MAN3=3
  157. SHELL=/bin/sh
  158. TOP= .
  159. ONEDIRS=out tmp
  160. EDIRS= times doc bugs util include certs ms shlib mt demos perl sf dep
  161. MISC= COPYRIGHT Configure HISTORY.090 HISTORY.066 INSTALL Makefile.ssl \
  162. Makefile \
  163. README TODO HISTORY README.066 README.080 README.090 \
  164. VERSION PROBLEMS MINFO makefile.one e_os.h \
  165. MICROSOFT makevms.com config PATENTS
  166. WDIRS= windows
  167. LIBS= libcrypto.a libssl.a
  168. GENERAL= Makefile
  169. BASENAME= SSLeay
  170. NAME= $(BASENAME)-$(VERSION)
  171. TARFILE= $(NAME).tar
  172. WTARFILE= $(NAME)-win.tar
  173. EXHEADER= e_os.h
  174. HEADER= e_os.h
  175. all:
  176. @for i in $(DIRS) ;\
  177. do \
  178. (cd $$i; echo "making $$i..."; \
  179. $(MAKE) CC='${CC}' PLATFORM='${PLATFORM}' CFLAG='${CFLAG}' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' BN_ASM='${BN_ASM}' DES_ENC='${DES_ENC}' BF_ENC='${BF_ENC}' CAST_ENC='${CAST_ENC}' RC4_ENC='${RC4_ENC}' RC5_ENC='${RC5_ENC}' SHA1_ASM_OBJ='${SHA1_ASM_OBJ}' MD5_ASM_OBJ='${MD5_ASM_OBJ}' RMD160_ASM_OBJ='${RMD160_ASM_OBJ}' SDIRS='${SDIRS}' AR='${AR}' all ); \
  180. done;
  181. sub_all:
  182. @for i in $(DIRS) ;\
  183. do \
  184. (cd $$i; echo "making $$i..."; \
  185. $(MAKE) CC='${CC}' PLATFORM='${PLATFORM}' CFLAG='${CFLAG}' SDIRS='$(SDIRS)' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' BN_ASM='${BN_ASM}' DES_ENC='${DES_ENC}' BF_ENC='${BF_ENC}' CAST_ENC='${CAST_ENC}' RC4_ENC='${RC4_ENC}' RC5_ENC='${RC5_ENC}' SHA1_ASM_OBJ='${SHA1_ASM_OBJ}' MD5_ASM_OBJ='${MD5_ASM_OBJ}' RMD160_ASM_OBJ='${RMD160_ASM_OBJ}' AR='${AR}' all ); \
  186. done;
  187. libclean:
  188. /bin/rm *.a */lib */*/lib
  189. clean:
  190. /bin/rm -f shlib/*.o *.o core a.out fluff *.map
  191. @for i in $(DIRS) ;\
  192. do \
  193. (cd $$i; echo "cleaning $$i..."; \
  194. $(MAKE) SDIRS='${SDIRS}' clean ); \
  195. /bin/rm -f $(LIBS); \
  196. done;
  197. /bin/rm -f *.a *.o speed.* *.map *.so .pure core
  198. /bin/rm -f $(TARFILE)
  199. @for i in $(ONEDIRS) ;\
  200. do \
  201. /bin/rm -fr $$i/*; \
  202. done
  203. makefile.one: files
  204. perl util/mk1mf.pl >makefile.one; \
  205. sh util/do_ms.sh
  206. files: MINFO
  207. perl $(TOP)/util/files.pl Makefile.ssl > $(TOP)/MINFO
  208. @for i in $(DIRS) ;\
  209. do \
  210. (cd $$i; echo "making 'files' in $$i..."; \
  211. $(MAKE) SDIRS='${SDIRS}' files ); \
  212. done;
  213. links:
  214. /bin/rm -f Makefile;
  215. ./util/point.sh Makefile.ssl Makefile;
  216. $(TOP)/util/mklink.sh include $(EXHEADER) ;
  217. @for i in $(DIRS) ;\
  218. do \
  219. (cd $$i; echo "making links in $$i..."; \
  220. $(MAKE) SDIRS='${SDIRS}' links ); \
  221. done;
  222. # @(cd apps; sh ./mklinks)
  223. @( SSLEAY="`pwd`/apps/ssleay"; export SSLEAY; sh tools/c_rehash certs )
  224. dclean:
  225. /bin/rm -f *.bak
  226. @for i in $(DIRS) ;\
  227. do \
  228. (cd $$i; echo "undoing makedepend in $$i..."; \
  229. $(MAKE) SDIRS='${SDIRS}' dclean ); \
  230. done;
  231. rehash:
  232. @(PATH="`pwd`/apps:${PATH}"; sh tools/c_rehash certs)
  233. test: tests
  234. tests:
  235. (cd test; echo "testing $$i..."; \
  236. $(MAKE) CC='${CC}' CFLAG='${CFLAG}' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' BN_ASM='${BN_ASM}' DES_ENC='${DES_ENC}' BF_ENC='${BF_ENC}' CAST_ENC='${CAST_ENC}' RC4_ENC='${RC4_ENC}' RC5_ENC='${RC5_ENC}' SDIRS='${SDIRS}' SHA1_ASM_OBJ='${SHA1_ASM_OBJ}' MD5_ASM_OBJ='${MD5_ASM_OBJ}' RMD160_ASM_OBJ='${RMD160_ASM_OBJ}' AR='${AR}' tests );
  237. @apps/ssleay version -a
  238. depend:
  239. @for i in $(DIRS) ;\
  240. do \
  241. (cd $$i; echo "making dependancies $$i..."; \
  242. $(MAKE) SDIRS='${SDIRS}' depend ); \
  243. done;
  244. lint:
  245. @for i in $(DIRS) ;\
  246. do \
  247. (cd $$i; echo "making lint $$i..."; \
  248. $(MAKE) SDIRS='${SDIRS}' lint ); \
  249. done;
  250. tags:
  251. @for i in $(DIRS) ;\
  252. do \
  253. (cd $$i; echo "making tags $$i..."; \
  254. $(MAKE) SDIRS='${SDIRS}' tags ); \
  255. done;
  256. errors:
  257. @for i in $(DIRS) ;\
  258. do \
  259. (cd $$i; echo "making errors in $$i..."; \
  260. $(MAKE) SDIRS='${SDIRS}' errors ); \
  261. done;
  262. tar:
  263. @(cd ..;\
  264. mv $(BASENAME) $(NAME); \
  265. export STUFF; \
  266. for i in $(MISC) $(DIRS) $(EDIRS) $(ONEDIRS) ;\
  267. do \
  268. STUFF="$$STUFF $(NAME)/$$i"; \
  269. done; \
  270. tar cf $(NAME)/$(TARFILE) $$STUFF; \
  271. mv $(NAME) $(BASENAME) )
  272. gzip -f $(TARFILE)
  273. dist:
  274. perl Configure dist
  275. perl util/up_ver.pl ${VERSION}
  276. @$(MAKE) dist_pem_h
  277. @$(MAKE) SDIRS='${SDIRS}' clean
  278. @$(MAKE) SDIRS='${SDIRS}' dclean
  279. @(cd apps; sh ./rmlinks)
  280. @$(MAKE) makefile.one
  281. @$(MAKE) tar
  282. dist_pem_h:
  283. (cd crypto/pem; $(MAKE) SDIRS='${SDIRS}' CFLAG='${CFLAG}' pem.h; $(MAKE) clean)
  284. install: all
  285. @-mkdir -p $(INSTALLTOP)/bin 2>/dev/null
  286. @-mkdir -p $(INSTALLTOP)/lib 2>/dev/null
  287. @-mkdir -p $(INSTALLTOP)/include 2>/dev/null
  288. @-mkdir -p $(INSTALLTOP)/certs 2>/dev/null
  289. @-mkdir -p $(INSTALLTOP)/private 2>/dev/null
  290. @for i in $(DIRS) ;\
  291. do \
  292. (cd $$i; echo "installing $$i..."; \
  293. $(MAKE) CC='${CC}' CFLAG='${CFLAG}' INSTALLTOP='${INSTALLTOP}' EX_LIBS='${EX_LIBS}' SDIRS='${SDIRS}' install ); \
  294. done
  295. @for i in $(LIBS) ;\
  296. do \
  297. ( echo installing $$i; \
  298. cp $$i $(INSTALLTOP)/lib; \
  299. sh util/ranlib.sh $(INSTALLTOP)/lib/$$i; \
  300. chmod 644 $(INSTALLTOP)/lib/$$i ); \
  301. done
  302. # DO NOT DELETE THIS LINE -- make depend depends on it.