Fix more warnings.
[openssl.git] / Makefile.org
1 #
2 # Makefile for all the SSL related library routines and utilities
3 VERSION = 0.9.2
4 PLATFORM=FreeBSD
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= -DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O3 -m486 -Wall -DSHA1_ASM -DMD5_ASM -DRMD160_ASM
68 PEX_LIBS= -L. -L.. -L../.. -L../../..
69 EX_LIBS= 
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= 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
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= asm/bx86-out.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= asm/cx86-out.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= asm/rx86-out.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= asm/r586-out.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= 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
138
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
145
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
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 asn1 pem x509 x509v3 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 WDIRS=  windows
177 LIBS=   libcrypto.a libssl.a 
178
179 GENERAL=        Makefile
180 BASENAME=       openssl
181 NAME=           $(BASENAME)-$(VERSION)
182 TARFILE=        $(NAME).tar
183 WTARFILE=       $(NAME)-win.tar
184 EXHEADER=       e_os.h
185 HEADER=         e_os.h
186
187 all: Makefile.ssl
188         @for i in $(DIRS) ;\
189         do \
190         (cd $$i && echo "making $$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; \
192         done;
193
194 sub_all:
195         @for i in $(DIRS) ;\
196         do \
197         (cd $$i && echo "making $$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; \
199         done;
200
201 Makefile.ssl: Makefile.org
202         @echo "Makefile.ssl is older than Makefile.org. Rerun Configuration"
203         @echo "and do a make links and a make errors."
204         @false
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 ) || exit 1; \
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 ) || exit 1; \
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 ) || exit 1; \
244         done;
245         @(OPENSSL="`pwd`/apps/openssl"; export OPENSSL; sh tools/c_rehash certs)
246
247 dclean:
248         /bin/rm -f *.bak
249         @for i in $(DIRS) ;\
250         do \
251         (cd $$i && echo "undoing makedepend in $$i..." && \
252         $(MAKE) SDIRS='${SDIRS}' dclean ) || exit 1; \
253         done;
254
255 rehash:
256         @(OPENSSL="`pwd`/apps/openssl"; export OPENSSL; sh tools/c_rehash certs)
257
258 test:   tests
259
260 tests:
261         (cd test && echo "testing $$i..." && \
262         $(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 );
263         @apps/openssl version -a
264
265 depend:
266         @for i in $(DIRS) ;\
267         do \
268         (cd $$i && echo "making dependancies $$i..." && \
269         $(MAKE) SDIRS='${SDIRS}' depend ) || exit 1; \
270         done;
271
272 lint:
273         @for i in $(DIRS) ;\
274         do \
275         (cd $$i && echo "making lint $$i..." && \
276         $(MAKE) SDIRS='${SDIRS}' lint ) || exit 1; \
277         done;
278
279 tags:
280         @for i in $(DIRS) ;\
281         do \
282         (cd $$i && echo "making tags $$i..." && \
283         $(MAKE) SDIRS='${SDIRS}' tags ) || exit 1; \
284         done;
285
286 errors:
287         @for i in $(DIRS) ;\
288         do \
289         (cd $$i && echo "making errors in $$i..." && \
290         $(MAKE) SDIRS='${SDIRS}' errors ) || exit 1; \
291         done;
292
293 tar:
294         @gtar --no-recursion -cvf - \
295                 `find * -depth -print | grep -v CVS | grep -v .cvsignore | sort` |\
296         tardy --user_number=0  --user_name=rse      \
297               --group_number=0 --group_name=openssl \
298               --prefix=openssl-$(VERSION) - |\
299         gzip --best >../$(TARFILE).gz; \
300         ls -l ../$(TARFILE).gz
301
302 dist:   
303         perl Configure dist
304         perl util/up_ver.pl ${VERSION}
305         @$(MAKE) dist_pem_h
306         @$(MAKE) SDIRS='${SDIRS}' clean
307         @$(MAKE) SDIRS='${SDIRS}' dclean
308         @(cd apps; sh ./rmlinks)
309         @$(MAKE) makefile.one
310         @$(MAKE) tar
311
312 dist_pem_h:
313         (cd crypto/pem; $(MAKE) SDIRS='${SDIRS}' CFLAG='${CFLAG}' pem.h; $(MAKE) clean)
314
315 install: all
316         @-mkdir -p $(INSTALLTOP)/bin 2>/dev/null
317         @-mkdir -p $(INSTALLTOP)/lib 2>/dev/null
318         @-mkdir -p $(INSTALLTOP)/include 2>/dev/null
319         @-mkdir -p $(INSTALLTOP)/certs 2>/dev/null
320         @-mkdir -p $(INSTALLTOP)/private 2>/dev/null
321         @for i in $(DIRS) ;\
322         do \
323         (cd $$i; echo "installing $$i..."; \
324         $(MAKE) CC='${CC}' CFLAG='${CFLAG}' INSTALLTOP='${INSTALLTOP}' EX_LIBS='${EX_LIBS}' SDIRS='${SDIRS}' install ); \
325         done
326         @for i in $(LIBS) ;\
327         do \
328         (       echo installing $$i; \
329                 cp $$i $(INSTALLTOP)/lib; \
330                 sh util/ranlib.sh $(INSTALLTOP)/lib/$$i; \
331                 chmod 644 $(INSTALLTOP)/lib/$$i ); \
332         done
333
334 # DO NOT DELETE THIS LINE -- make depend depends on it.