2 # Makefile for all the SSL related library routines and utilities
6 # make install will install:
7 # libraries into $INSTALLTOP/lib
8 # headers into $INSTALLTOP/include
9 # utilities into $INSTALLTOP/bin
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
15 # Interesting Mailing Lists:
16 # ssl-bugs@mincom.oz.au
17 # ssl-users@mincom.oz.au
19 # To join the Mailing Lists:
20 # ssl-bugs-request@mincom.oz.au
21 # ssl-users-request@mincom.oz.au
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>
29 # The primary distribution of SSLeay is from
30 # ftp://ftp.psy.uq.oz.au/pub/Crypto/SSL
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.
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
63 # PKCS1_CHECK - pkcs1 tests.
66 #CFLAG= -DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -m486 -Wall -Wuninitialized -DSHA1_ASM -DMD5_ASM -DRMD160_ASM
67 CFLAG= -DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O3 -m486 -Wall -DSHA1_ASM -DMD5_ASM -DRMD160_ASM
68 PEX_LIBS= -L. -L.. -L../.. -L../../..
72 # Set BN_ASM to bn_asm.o if you want to use the C version
75 #BN_ASM= asm/bn86-elf.o # elf, linux-elf
76 #BN_ASM= asm/bn86-sol.o # solaris
77 #BN_ASM= asm/bn86-out.o # a.out, FreeBSD
78 #BN_ASM= asm/bn86bsdi.o # bsdi
79 #BN_ASM= asm/alpha.o # DEC Alpha
80 #BN_ASM= asm/pa-risc2.o # HP-UX PA-RISC
81 #BN_ASM= asm/r3000.o # SGI MIPS cpu
82 #BN_ASM= asm/sparc.o # Sun solaris/SunOS
83 #BN_ASM= asm/bn-win32.o # Windows 95/NT
84 #BN_ASM= asm/x86w16.o # 16 bit code for Windows 3.1/DOS
85 #BN_ASM= asm/x86w32.o # 32 bit code for Windows 3.1
87 # Set DES_ENC to des_enc.o if you want to use the C version
88 #There are 4 x86 assember options.
89 DES_ENC= asm/dx86-out.o asm/yx86-out.o
90 #DES_ENC= des_enc.o fcrypt_b.o # C
91 #DES_ENC= asm/dx86-elf.o asm/yx86-elf.o # elf
92 #DES_ENC= asm/dx86-sol.o asm/yx86-sol.o # solaris
93 #DES_ENC= asm/dx86-out.o asm/yx86-out.o # a.out, FreeBSD
94 #DES_ENC= asm/dx86bsdi.o asm/yx86bsdi.o # bsdi
96 # Set BF_ENC to bf_enc.o if you want to use the C version
97 #There are 4 x86 assember options.
98 BF_ENC= asm/bx86-out.o
100 #BF_ENC= asm/bx86-elf.o # elf
101 #BF_ENC= asm/bx86-sol.o # solaris
102 #BF_ENC= asm/bx86-out.o # a.out, FreeBSD
103 #BF_ENC= asm/bx86bsdi.o # bsdi
105 # Set CAST_ENC to c_enc.o if you want to use the C version
106 #There are 4 x86 assember options.
107 CAST_ENC= asm/cx86-out.o
109 #CAST_ENC= asm/cx86-elf.o # elf
110 #CAST_ENC= asm/cx86-sol.o # solaris
111 #CAST_ENC= asm/cx86-out.o # a.out, FreeBSD
112 #CAST_ENC= asm/cx86bsdi.o # bsdi
114 # Set RC4_ENC to rc4_enc.o if you want to use the C version
115 #There are 4 x86 assember options.
116 RC4_ENC= asm/rx86-out.o
118 #RC4_ENC= asm/rx86-elf.o # elf
119 #RC4_ENC= asm/rx86-sol.o # solaris
120 #RC4_ENC= asm/rx86-out.o # a.out, FreeBSD
121 #RC4_ENC= asm/rx86bsdi.o # bsdi
123 # Set RC5_ENC to rc5_enc.o if you want to use the C version
124 #There are 4 x86 assember options.
125 RC5_ENC= asm/r586-out.o
127 #RC5_ENC= asm/r586-elf.o # elf
128 #RC5_ENC= asm/r586-sol.o # solaris
129 #RC5_ENC= asm/r586-out.o # a.out, FreeBSD
130 #RC5_ENC= asm/r586bsdi.o # bsdi
132 # Also need MD5_ASM defined
133 MD5_ASM_OBJ= asm/mx86-out.o
134 #MD5_ASM_OBJ= asm/mx86-elf.o # elf
135 #MD5_ASM_OBJ= asm/mx86-sol.o # solaris
136 #MD5_ASM_OBJ= asm/mx86-out.o # a.out, FreeBSD
137 #MD5_ASM_OBJ= asm/mx86bsdi.o # bsdi
139 # Also need SHA1_ASM defined
140 SHA1_ASM_OBJ= asm/sx86-out.o
141 #SHA1_ASM_OBJ= asm/sx86-elf.o # elf
142 #SHA1_ASM_OBJ= asm/sx86-sol.o # solaris
143 #SHA1_ASM_OBJ= asm/sx86-out.o # a.out, FreeBSD
144 #SHA1_ASM_OBJ= asm/sx86bsdi.o # bsdi
146 # Also need RMD160_ASM defined
147 RMD160_ASM_OBJ= asm/rm86-out.o
148 #RMD160_ASM_OBJ= asm/rm86-elf.o # elf
149 #RMD160_ASM_OBJ= asm/rm86-sol.o # solaris
150 #RMD160_ASM_OBJ= asm/rm86-out.o # a.out, FreeBSD
151 #RMD160_ASM_OBJ= asm/rm86bsdi.o # bsdi
153 DIRS= crypto ssl rsaref apps test tools
154 # dirs in crypto to build
156 md2 md5 sha mdc2 hmac ripemd \
157 des rc2 rc4 rc5 idea bf cast \
159 buffer bio stack lhash rand err objects \
160 evp asn1 pem x509 x509v3 conf txt_db pkcs7 comp
162 # If you change the INSTALLTOP, make sure to also change the values
163 # in crypto/location.h
164 INSTALLTOP=/usr/local/ssl
166 MAKEFILE= Makefile.ssl
167 MAKE= make -f Makefile.ssl
175 EDIRS= times doc bugs util include certs ms shlib mt demos perl sf dep
177 LIBS= libcrypto.a libssl.a
181 NAME= $(BASENAME)-$(VERSION)
183 WTARFILE= $(NAME)-win.tar
190 (cd $$i && echo "making all in $$i..." && \
191 $(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 ) || exit 1; \
197 (cd $$i && echo "making all in $$i..." && \
198 $(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 ) || exit 1; \
201 Makefile.ssl: Makefile.org
202 @echo "Makefile.ssl is older than Makefile.org. Rerun Configure"
203 @echo "and do a make links and a make errors."
207 rm -f *.a */lib */*/lib
210 rm -f shlib/*.o *.o core a.out fluff *.map
213 (cd $$i && echo "making clean in $$i..." && \
214 $(MAKE) SDIRS='${SDIRS}' clean ) || exit 1; \
217 rm -f *.a *.o speed.* *.map *.so .pure core
219 @for i in $(ONEDIRS) ;\
225 perl util/mk1mf.pl >makefile.one; \
229 perl $(TOP)/util/files.pl Makefile.ssl > $(TOP)/MINFO
232 (cd $$i && echo "making 'files' in $$i..." && \
233 $(MAKE) SDIRS='${SDIRS}' files ) || exit 1; \
237 @$(TOP)/util/point.sh Makefile.ssl Makefile
238 @$(TOP)/util/mklink.sh include $(EXHEADER)
239 @for i in $(DIRS); do \
240 (cd $$i && echo "making links in $$i..." && \
241 $(MAKE) SDIRS='${SDIRS}' links ) || exit 1; \
243 @(OPENSSL="`pwd`/apps/openssl"; export OPENSSL; sh tools/c_rehash certs)
249 (cd $$i && echo "making dclean in $$i..." && \
250 $(MAKE) SDIRS='${SDIRS}' dclean ) || exit 1; \
254 @(OPENSSL="`pwd`/apps/openssl"; export OPENSSL; sh tools/c_rehash certs)
259 @(cd test && echo "testing..." && \
260 $(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 );
261 @apps/openssl version -a
266 (cd $$i && echo "making dependancies $$i..." && \
267 $(MAKE) SDIRS='${SDIRS}' depend ) || exit 1; \
273 (cd $$i && echo "making lint $$i..." && \
274 $(MAKE) SDIRS='${SDIRS}' lint ) || exit 1; \
280 (cd $$i && echo "making tags $$i..." && \
281 $(MAKE) SDIRS='${SDIRS}' tags ) || exit 1; \
287 (cd $$i && echo "making errors in $$i..." && \
288 $(MAKE) SDIRS='${SDIRS}' errors ) || exit 1; \
292 @gtar --no-recursion -cvf - \
293 `find * -depth -print | grep -v CVS | grep -v .cvsignore | grep -v STATUS sort` |\
294 tardy --user_number=0 --user_name=openssl \
295 --group_number=0 --group_name=openssl \
296 --prefix=openssl-$(VERSION) - |\
297 gzip --best >../$(TARFILE).gz; \
298 ls -l ../$(TARFILE).gz
302 perl util/up_ver.pl ${VERSION}
304 @$(MAKE) SDIRS='${SDIRS}' clean
305 @$(MAKE) SDIRS='${SDIRS}' dclean
306 @$(MAKE) makefile.one
310 (cd crypto/pem; $(MAKE) SDIRS='${SDIRS}' CFLAG='${CFLAG}' pem.h; $(MAKE) clean)
313 @-mkdir -p $(INSTALLTOP)/bin 2>/dev/null
314 @-mkdir -p $(INSTALLTOP)/lib 2>/dev/null
315 @-mkdir -p $(INSTALLTOP)/include 2>/dev/null
316 @-mkdir -p $(INSTALLTOP)/certs 2>/dev/null
317 @-mkdir -p $(INSTALLTOP)/private 2>/dev/null
320 (cd $$i; echo "installing $$i..."; \
321 $(MAKE) CC='${CC}' CFLAG='${CFLAG}' INSTALLTOP='${INSTALLTOP}' EX_LIBS='${EX_LIBS}' SDIRS='${SDIRS}' install ); \
325 ( echo installing $$i; \
326 cp $$i $(INSTALLTOP)/lib; \
327 sh util/ranlib.sh $(INSTALLTOP)/lib/$$i; \
328 chmod 644 $(INSTALLTOP)/lib/$$i ); \
331 # DO NOT DELETE THIS LINE -- make depend depends on it.