Fix yet another bug for client hello handling.
[openssl.git] / Makefile.org
1 ##
2 ## Makefile for OpenSSL
3 ##
4
5 VERSION=
6 MAJOR=
7 MINOR=
8 PLATFORM=dist
9 OPTIONS=
10 # INSTALL_PREFIX is for package builders so that they can configure
11 # for, say, /usr/ and yet have everything installed to /tmp/somedir/usr/.
12 # Normally it is left empty.
13 INSTALL_PREFIX=
14 INSTALLTOP=/usr/local/ssl
15
16 # Do not edit this manually. Use Configure --openssldir=DIR do change this!
17 OPENSSLDIR=/usr/local/ssl
18
19 # RSAref  - Define if we are to link with RSAref.
20 # NO_IDEA - Define to build without the IDEA algorithm
21 # NO_RC4  - Define to build without the RC4 algorithm
22 # NO_RC2  - Define to build without the RC2 algorithm
23 # THREADS - Define when building with threads, you will probably also need any
24 #           system defines as well, i.e. _REENTERANT for Solaris 2.[34]
25 # TERMIO  - Define the termio terminal subsystem, needed if sgtty is missing.
26 # TERMIOS - Define the termios terminal subsystem, Silicon Graphics.
27 # LONGCRYPT - Define to use HPUX 10.x's long password modification to crypt(3).
28 # DEVRANDOM - Give this the value of the 'random device' if your OS supports
29 #           one.  32 bytes will be read from this when the random
30 #           number generator is initalised.
31 # SSL_ALLOW_ADH - define if you want the server to be able to use the
32 #           SSLv3 anon-DH ciphers.
33 # SSL_FORBID_ENULL - define if you want the server to be not able to use the
34 #           NULL encryption ciphers.
35 #
36 # LOCK_DEBUG - turns on lots of lock debug output :-)
37 # REF_CHECK - turn on some xyz_free() assertions.
38 # REF_PRINT - prints some stuff on structure free.
39 # CRYPTO_MDEBUG - turns on my 'memory leak' detecting stuff
40 # MFUNC - Make all Malloc/Free/Realloc calls call
41 #       CRYPTO_malloc/CRYPTO_free/CRYPTO_realloc which can be setup to
42 #       call application defined callbacks via CRYPTO_set_mem_functions()
43 # MD5_ASM needs to be defined to use the x86 assembler for MD5
44 # SHA1_ASM needs to be defined to use the x86 assembler for SHA1
45 # RMD160_ASM needs to be defined to use the x86 assembler for RIPEMD160
46 # Do not define B_ENDIAN or L_ENDIAN if 'unsigned long' == 8.  It must
47 # equal 4.
48 # PKCS1_CHECK - pkcs1 tests.
49
50 CC= gcc
51 #CFLAG= -DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -m486 -Wall -Wuninitialized -DSHA1_ASM -DMD5_ASM -DRMD160_ASM
52 CFLAG= -DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O3 -m486 -Wall -DSHA1_ASM -DMD5_ASM -DRMD160_ASM
53 DEPFLAG= 
54 PEX_LIBS= -L. -L.. -L../.. -L../../..
55 EX_LIBS= 
56 AR=ar r
57 RANLIB= ranlib
58 PERL= perl
59
60 # Set BN_ASM to bn_asm.o if you want to use the C version
61 BN_ASM= bn_asm.o
62 #BN_ASM= bn_asm.o
63 #BN_ASM= asm/bn86-elf.o # elf, linux-elf
64 #BN_ASM= asm/bn86-sol.o # solaris
65 #BN_ASM= asm/bn86-out.o # a.out, FreeBSD
66 #BN_ASM= asm/bn86bsdi.o # bsdi
67 #BN_ASM= asm/alpha.o    # DEC Alpha
68 #BN_ASM= asm/pa-risc2.o # HP-UX PA-RISC
69 #BN_ASM= asm/r3000.o    # SGI MIPS cpu
70 #BN_ASM= asm/sparc.o    # Sun solaris/SunOS
71 #BN_ASM= asm/bn-win32.o # Windows 95/NT
72 #BN_ASM= asm/x86w16.o   # 16 bit code for Windows 3.1/DOS
73 #BN_ASM= asm/x86w32.o   # 32 bit code for Windows 3.1
74
75 # For x86 assembler: Set PROCESSOR to 386 if you want to support
76 # the 80386.
77 PROCESSOR=
78
79 # Set DES_ENC to des_enc.o if you want to use the C version
80 #There are 4 x86 assember options.
81 DES_ENC= asm/dx86-out.o asm/yx86-out.o
82 #DES_ENC= des_enc.o fcrypt_b.o          # C
83 #DES_ENC= asm/dx86-elf.o asm/yx86-elf.o # elf
84 #DES_ENC= asm/dx86-sol.o asm/yx86-sol.o # solaris
85 #DES_ENC= asm/dx86-out.o asm/yx86-out.o # a.out, FreeBSD
86 #DES_ENC= asm/dx86bsdi.o asm/yx86bsdi.o # bsdi
87
88 # Set BF_ENC to bf_enc.o if you want to use the C version
89 #There are 4 x86 assember options.
90 BF_ENC= asm/bx86-out.o
91 #BF_ENC= bf_enc.o
92 #BF_ENC= asm/bx86-elf.o # elf
93 #BF_ENC= asm/bx86-sol.o # solaris
94 #BF_ENC= asm/bx86-out.o # a.out, FreeBSD
95 #BF_ENC= asm/bx86bsdi.o # bsdi
96
97 # Set CAST_ENC to c_enc.o if you want to use the C version
98 #There are 4 x86 assember options.
99 CAST_ENC= asm/cx86-out.o
100 #CAST_ENC= c_enc.o
101 #CAST_ENC= asm/cx86-elf.o # elf
102 #CAST_ENC= asm/cx86-sol.o # solaris
103 #CAST_ENC= asm/cx86-out.o # a.out, FreeBSD
104 #CAST_ENC= asm/cx86bsdi.o # bsdi
105
106 # Set RC4_ENC to rc4_enc.o if you want to use the C version
107 #There are 4 x86 assember options.
108 RC4_ENC= asm/rx86-out.o
109 #RC4_ENC= rc4_enc.o
110 #RC4_ENC= asm/rx86-elf.o # elf
111 #RC4_ENC= asm/rx86-sol.o # solaris
112 #RC4_ENC= asm/rx86-out.o # a.out, FreeBSD
113 #RC4_ENC= asm/rx86bsdi.o # bsdi
114
115 # Set RC5_ENC to rc5_enc.o if you want to use the C version
116 #There are 4 x86 assember options.
117 RC5_ENC= asm/r586-out.o
118 #RC5_ENC= rc5_enc.o
119 #RC5_ENC= asm/r586-elf.o # elf
120 #RC5_ENC= asm/r586-sol.o # solaris
121 #RC5_ENC= asm/r586-out.o # a.out, FreeBSD
122 #RC5_ENC= asm/r586bsdi.o # bsdi
123
124 # Also need MD5_ASM defined
125 MD5_ASM_OBJ= asm/mx86-out.o
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
131 # Also need SHA1_ASM defined
132 SHA1_ASM_OBJ= asm/sx86-out.o
133 #SHA1_ASM_OBJ= asm/sx86-elf.o       # elf
134 #SHA1_ASM_OBJ= asm/sx86-sol.o       # solaris
135 #SHA1_ASM_OBJ= asm/sx86-out.o       # a.out, FreeBSD
136 #SHA1_ASM_OBJ= asm/sx86bsdi.o       # bsdi
137
138 # Also need RMD160_ASM defined
139 RMD160_ASM_OBJ= asm/rm86-out.o
140 #RMD160_ASM_OBJ= asm/rm86-elf.o       # elf
141 #RMD160_ASM_OBJ= asm/rm86-sol.o       # solaris
142 #RMD160_ASM_OBJ= asm/rm86-out.o       # a.out, FreeBSD
143 #RMD160_ASM_OBJ= asm/rm86bsdi.o       # bsdi
144
145 DIRS=   crypto ssl rsaref apps test tools
146 SHLIBDIRS= crypto ssl
147
148 # dirs in crypto to build
149 SDIRS=  \
150         md2 md5 sha mdc2 hmac ripemd \
151         des rc2 rc4 rc5 idea bf cast \
152         bn rsa dsa dh \
153         buffer bio stack lhash rand err objects \
154         evp asn1 pem x509 x509v3 conf txt_db pkcs7 pkcs12 comp
155
156 MAKEFILE= Makefile.ssl
157 MAKE=     make -f Makefile.ssl
158
159 MAN1=1
160 MAN3=3
161 SHELL=/bin/sh
162
163 TOP=    .
164 ONEDIRS=out tmp
165 EDIRS=  times doc bugs util include certs ms shlib mt demos perl sf dep VMS
166 WDIRS=  windows
167 LIBS=   libcrypto.a libssl.a 
168
169 GENERAL=        Makefile
170 BASENAME=       openssl
171 NAME=           $(BASENAME)-$(VERSION)
172 TARFILE=        $(NAME).tar
173 WTARFILE=       $(NAME)-win.tar
174 EXHEADER=       e_os.h e_os2.h
175 HEADER=         e_os.h
176
177 all: Makefile.ssl
178         @for i in $(DIRS) ;\
179         do \
180         (cd $$i && echo "making all in $$i..." && \
181         $(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}' PROCESSOR='${PROCESSOR}' PERL='${PERL}' RANLIB='${RANLIB}' all ) || exit 1; \
182         done
183         cd crypto; $(MAKE) testapps
184         -@# cd perl; $(PERL) Makefile.PL; make
185
186 sub_all:
187         @for i in $(DIRS) ;\
188         do \
189         (cd $$i && echo "making all in $$i..." && \
190         $(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}' PROCESSOR='${PROCESSOR}' PERL='${PERL}' RANLIB='${RANLIB}' all ) || exit 1; \
191         done;
192
193 linux-shared:
194         for i in ${SHLIBDIRS}; do \
195         rm -f lib$$i.a lib$$i.so \
196                 lib$$i.so.${MAJOR} lib$$i.so.${MAJOR}.${MINOR}; \
197         ${MAKE} CC='${CC}' PLATFORM='${PLATFORM}' CFLAG='-fPIC ${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}' DIRS=$$i clean all || exit 1; \
198         ( set -x; ${CC}  -shared -o lib$$i.so.${MAJOR}.${MINOR} \
199                 -Wl,-S,-soname=lib$$i.so.${MAJOR} \
200                 -Wl,--whole-archive lib$$i.a \
201                 -Wl,--no-whole-archive -lc ) || exit 1; \
202         rm -f lib$$i.a; make -C $$i clean || exit 1 ;\
203         done;
204         @set -x; \
205         for i in ${SHLIBDIRS}; do \
206         ln -s lib$$i.so.${MAJOR}.${MINOR} lib$$i.so.${MAJOR}; \
207         ln -s lib$$i.so.${MAJOR} lib$$i.so; \
208         done;
209
210 Makefile.ssl: Makefile.org
211         @echo "Makefile.ssl is older than Makefile.org."
212         @echo "Reconfigure the source tree (via './config' or 'perl Configure'), please."
213         @false
214
215 libclean:
216         rm -f *.a */lib */*/lib
217
218 clean:
219         rm -f shlib/*.o *.o core a.out fluff *.map
220         @for i in $(DIRS) ;\
221         do \
222         (cd $$i && echo "making clean in $$i..." && \
223         $(MAKE) SDIRS='${SDIRS}' clean ) || exit 1; \
224         rm -f $(LIBS); \
225         done;
226         rm -f *.a *.o speed.* *.map *.so .pure core
227         rm -f $(TARFILE)
228         @for i in $(ONEDIRS) ;\
229         do \
230         rm -fr $$i/*; \
231         done
232
233 makefile.one: files
234         $(PERL) util/mk1mf.pl >makefile.one; \
235         sh util/do_ms.sh
236
237 files:
238         $(PERL) $(TOP)/util/files.pl Makefile.ssl > $(TOP)/MINFO
239         @for i in $(DIRS) ;\
240         do \
241         (cd $$i && echo "making 'files' in $$i..." && \
242         $(MAKE) SDIRS='${SDIRS}' PERL='${PERL}' files ) || exit 1; \
243         done;
244
245 links:
246         @$(TOP)/util/point.sh Makefile.ssl Makefile
247         @$(PERL) $(TOP)/util/mkdir-p.pl include/openssl
248         @$(PERL) $(TOP)/util/mklink.pl include/openssl $(EXHEADER)
249         @for i in $(DIRS); do \
250         (cd $$i && echo "making links in $$i..." && \
251         $(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}' PERL='${PERL}' links ) || exit 1; \
252         done;
253
254 dclean:
255         rm -f *.bak
256         @for i in $(DIRS) ;\
257         do \
258         (cd $$i && echo "making dclean in $$i..." && \
259         $(MAKE) SDIRS='${SDIRS}' PERL='${PERL}' dclean ) || exit 1; \
260         done;
261
262 rehash:
263         @(OPENSSL="`pwd`/apps/openssl"; export OPENSSL; sh tools/c_rehash certs)
264
265 test:   tests
266
267 tests: rehash
268         @(cd test && echo "testing..." && \
269         $(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 );
270         @apps/openssl version -a
271
272 depend:
273         @for i in $(DIRS) ;\
274         do \
275         (cd $$i && echo "making dependencies $$i..." && \
276         $(MAKE) SDIRS='${SDIRS}' DEPFLAG='${DEPFLAG}' depend ) || exit 1; \
277         done;
278
279 lint:
280         @for i in $(DIRS) ;\
281         do \
282         (cd $$i && echo "making lint $$i..." && \
283         $(MAKE) SDIRS='${SDIRS}' lint ) || exit 1; \
284         done;
285
286 tags:
287         @for i in $(DIRS) ;\
288         do \
289         (cd $$i && echo "making tags $$i..." && \
290         $(MAKE) SDIRS='${SDIRS}' tags ) || exit 1; \
291         done;
292
293 errors:
294         perl util/mkerr.pl -recurse -write
295
296 util/libeay.num::
297         perl util/mkdef.pl crypto update
298
299 util/ssleay.num::
300         perl util/mkdef.pl ssl update
301
302 TABLE: Configure
303         (echo 'Output of `Configure TABLE'"':"; \
304         perl Configure TABLE) > TABLE
305
306 update: depend errors util/libeay.num util/ssleay.num TABLE
307
308 tar:
309         @tar --norecurse -cvf - \
310                 `find * \! -path CVS/\* \! -path \*/CVS/\* \! -name CVS \! -name .cvsignore \! -name STATUS \! -name TABLE | sort` |\
311         tardy --user_number=0  --user_name=openssl \
312               --group_number=0 --group_name=openssl \
313               --prefix=openssl-$(VERSION) - |\
314         gzip --best >../$(TARFILE).gz; \
315         ls -l ../$(TARFILE).gz
316
317 dist:   
318         $(PERL) Configure dist
319         @$(MAKE) dist_pem_h
320         @$(MAKE) SDIRS='${SDIRS}' clean
321         @$(MAKE) tar
322
323 dist_pem_h:
324         (cd crypto/pem; $(MAKE) CC='${CC}' SDIRS='${SDIRS}' CFLAG='${CFLAG}' pem.h; $(MAKE) clean)
325
326 install: all
327         @$(PERL) $(TOP)/util/mkdir-p.pl $(INSTALL_PREFIX)$(INSTALLTOP)/bin \
328                 $(INSTALL_PREFIX)$(INSTALLTOP)/lib \
329                 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl \
330                 $(INSTALL_PREFIX)$(OPENSSLDIR)/misc \
331                 $(INSTALL_PREFIX)$(OPENSSLDIR)/certs \
332                 $(INSTALL_PREFIX)$(OPENSSLDIR)/private \
333                 $(INSTALL_PREFIX)$(OPENSSLDIR)/lib
334         @for i in $(EXHEADER) ;\
335         do \
336         (cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \
337         chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \
338         done;
339         @for i in $(DIRS) ;\
340         do \
341         (cd $$i; echo "installing $$i..."; \
342         $(MAKE) CC='${CC}' CFLAG='${CFLAG}' INSTALL_PREFIX='${INSTALL_PREFIX}' INSTALLTOP='${INSTALLTOP}' OPENSSLDIR='${OPENSSLDIR}' EX_LIBS='${EX_LIBS}' SDIRS='${SDIRS}' install ); \
343         done
344         @for i in $(LIBS) ;\
345         do \
346         (       echo installing $$i; \
347                 cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/lib; \
348                 $(RANLIB) $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i; \
349                 chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i ); \
350         done
351
352 # DO NOT DELETE THIS LINE -- make depend depends on it.