09c2ff25e3bc4fd9320986750465db64a592634d
[openssl.git] / Makefile.ssl
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
65 CC= gcc
66 #CFLAG= -DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -m486 -Wall -Wuninitialized -DSHA1_ASM -DMD5_ASM -DRMD160_ASM
67 CFLAG= -DBN_DEBUG -DREF_CHECK -DCRYPTO_MDEBUG -ggdb -g2 -Wformat -Wshadow -Wmissing-prototypes -Wmissing-declarations -Werror
68 PEX_LIBS= -L. -L.. -L../.. -L../../..
69 EX_LIBS= -lefence
70 AR=ar r
71
72 # Set BN_ASM to bn_asm.o if you want to use the C version
73 BN_ASM= bn_asm.o
74 #BN_ASM= bn_asm.o
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
86
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= des_enc.o fcrypt_b.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
95
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= bf_enc.o
99 #BF_ENC= bf_enc.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
104
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= c_enc.o
108 #CAST_ENC= c_enc.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
113
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= rc4_enc.o
117 #RC4_ENC= rc4_enc.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
122
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= rc5_enc.o
126 #RC5_ENC= rc5_enc.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
131
132 # Also need MD5_ASM defined
133 MD5_ASM_OBJ= 
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
138
139 # Also need SHA1_ASM defined
140 SHA1_ASM_OBJ= 
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
145
146 # Also need RMD160_ASM defined
147 RMD160_ASM_OBJ= 
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
152
153 DIRS=   crypto ssl rsaref apps test tools
154 # dirs in crypto to build
155 SDIRS=  \
156         md2 md5 sha mdc2 hmac ripemd \
157         des rc2 rc4 rc5 idea bf cast \
158         bn rsa dsa dh \
159         buffer bio stack lhash rand err objects \
160         evp pem asn1 x509 conf txt_db pkcs7 comp
161
162 # If you change the INSTALLTOP, make sure to also change the values
163 # in crypto/location.h
164 INSTALLTOP=/usr/local/ssl
165
166 MAKEFILE= Makefile.ssl
167 MAKE=     make -f Makefile.ssl
168
169 MAN1=1
170 MAN3=3
171 SHELL=/bin/sh
172
173 TOP=    .
174 ONEDIRS=out tmp
175 EDIRS=  times doc bugs util include certs ms shlib mt demos perl sf dep
176 MISC=   COPYRIGHT Configure HISTORY.090 HISTORY.066 INSTALL Makefile.ssl \
177         Makefile \
178         README TODO HISTORY README.066 README.080 README.090 \
179         VERSION PROBLEMS MINFO makefile.one e_os.h \
180         MICROSOFT makevms.com config PATENTS
181 WDIRS=  windows
182 LIBS=   libcrypto.a libssl.a 
183
184 GENERAL=        Makefile
185 BASENAME=       SSLeay
186 NAME=           $(BASENAME)-$(VERSION)
187 TARFILE=        $(NAME).tar
188 WTARFILE=       $(NAME)-win.tar
189 EXHEADER=       e_os.h
190 HEADER=         e_os.h
191
192 all:
193         @for i in $(DIRS) ;\
194         do \
195         (cd $$i; echo "making $$i..."; \
196         $(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 ); \
197         done;
198
199 sub_all:
200         @for i in $(DIRS) ;\
201         do \
202         (cd $$i; echo "making $$i..."; \
203         $(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 ); \
204         done;
205
206 libclean:
207         /bin/rm *.a */lib */*/lib
208
209 clean:
210         /bin/rm -f shlib/*.o *.o core a.out fluff *.map
211         @for i in $(DIRS) ;\
212         do \
213         (cd $$i; echo "cleaning $$i..."; \
214         $(MAKE) SDIRS='${SDIRS}' clean ); \
215         /bin/rm -f $(LIBS); \
216         done;
217         /bin/rm -f *.a *.o speed.* *.map *.so .pure core
218         /bin/rm -f $(TARFILE)
219         @for i in $(ONEDIRS) ;\
220         do \
221         /bin/rm -fr $$i/*; \
222         done
223
224 makefile.one: files
225         perl util/mk1mf.pl >makefile.one; \
226         sh util/do_ms.sh
227
228 files:  MINFO
229         perl $(TOP)/util/files.pl Makefile.ssl > $(TOP)/MINFO
230         @for i in $(DIRS) ;\
231         do \
232         (cd $$i; echo "making 'files' in $$i..."; \
233         $(MAKE) SDIRS='${SDIRS}' files ); \
234         done;
235
236 links:
237         /bin/rm -f Makefile;
238         ./util/point.sh Makefile.ssl Makefile;
239         $(TOP)/util/mklink.sh include $(EXHEADER) ;
240         @for i in $(DIRS) ;\
241         do \
242         (cd $$i; echo "making links in $$i..."; \
243         $(MAKE) SDIRS='${SDIRS}' links ); \
244         done;
245         # @(cd apps; sh ./mklinks)
246         @( SSLEAY="`pwd`/apps/ssleay"; export SSLEAY; sh tools/c_rehash certs )
247
248 dclean:
249         /bin/rm -f *.bak
250         @for i in $(DIRS) ;\
251         do \
252         (cd $$i; echo "undoing makedepend in $$i..."; \
253         $(MAKE) SDIRS='${SDIRS}' dclean ); \
254         done;
255
256 rehash:
257         @(PATH="`pwd`/apps:${PATH}"; sh tools/c_rehash certs)
258
259 test:   tests
260
261 tests:
262         (cd test; echo "testing $$i..."; \
263         $(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 );
264         @apps/ssleay version -a
265
266 depend:
267         @for i in $(DIRS) ;\
268         do \
269         (cd $$i; echo "making dependancies $$i..."; \
270         $(MAKE) SDIRS='${SDIRS}' depend ); \
271         done;
272
273 lint:
274         @for i in $(DIRS) ;\
275         do \
276         (cd $$i; echo "making lint $$i..."; \
277         $(MAKE) SDIRS='${SDIRS}' lint ); \
278         done;
279
280 tags:
281         @for i in $(DIRS) ;\
282         do \
283         (cd $$i; echo "making tags $$i..."; \
284         $(MAKE) SDIRS='${SDIRS}' tags ); \
285         done;
286
287 errors:
288         @for i in $(DIRS) ;\
289         do \
290         (cd $$i; echo "making errors in $$i..."; \
291         $(MAKE) SDIRS='${SDIRS}' errors ); \
292         done;
293
294 tar:
295         @(cd ..;\
296         mv $(BASENAME) $(NAME); \
297         export STUFF; \
298         for i in $(MISC) $(DIRS) $(EDIRS) $(ONEDIRS) ;\
299         do \
300                 STUFF="$$STUFF $(NAME)/$$i"; \
301         done; \
302         tar cf $(NAME)/$(TARFILE) $$STUFF; \
303         mv $(NAME) $(BASENAME) ) 
304         gzip -f $(TARFILE)
305
306 dist:   
307         perl Configure dist
308         perl util/up_ver.pl ${VERSION}
309         @$(MAKE) dist_pem_h
310         @$(MAKE) SDIRS='${SDIRS}' clean
311         @$(MAKE) SDIRS='${SDIRS}' dclean
312         @(cd apps; sh ./rmlinks)
313         @$(MAKE) makefile.one
314         @$(MAKE) tar
315
316 dist_pem_h:
317         (cd crypto/pem; $(MAKE) SDIRS='${SDIRS}' CFLAG='${CFLAG}' pem.h; $(MAKE) clean)
318
319 install: all
320         @-mkdir -p $(INSTALLTOP)/bin 2>/dev/null
321         @-mkdir -p $(INSTALLTOP)/lib 2>/dev/null
322         @-mkdir -p $(INSTALLTOP)/include 2>/dev/null
323         @-mkdir -p $(INSTALLTOP)/certs 2>/dev/null
324         @-mkdir -p $(INSTALLTOP)/private 2>/dev/null
325         @for i in $(DIRS) ;\
326         do \
327         (cd $$i; echo "installing $$i..."; \
328         $(MAKE) CC='${CC}' CFLAG='${CFLAG}' INSTALLTOP='${INSTALLTOP}' EX_LIBS='${EX_LIBS}' SDIRS='${SDIRS}' install ); \
329         done
330         @for i in $(LIBS) ;\
331         do \
332         (       echo installing $$i; \
333                 cp $$i $(INSTALLTOP)/lib; \
334                 sh util/ranlib.sh $(INSTALLTOP)/lib/$$i; \
335                 chmod 644 $(INSTALLTOP)/lib/$$i ); \
336         done
337
338 # DO NOT DELETE THIS LINE -- make depend depends on it.