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