ssldir.pl did not correctly set the directory in utils/mk1mk.pl when
[openssl.git] / Makefile.org
1 #
2 # Makefile for all the SSL related library routines and utilities
3 VERSION = 0.9.1c
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 pem err objects \
160         evp 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 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:
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 libclean:
202         /bin/rm *.a */lib */*/lib
203
204 clean:
205         /bin/rm -f shlib/*.o *.o core a.out fluff *.map
206         @for i in $(DIRS) ;\
207         do \
208         (cd $$i && echo "cleaning $$i..." && \
209         $(MAKE) SDIRS='${SDIRS}' clean ) || exit 1; \
210         /bin/rm -f $(LIBS); \
211         done;
212         /bin/rm -f *.a *.o speed.* *.map *.so .pure core
213         /bin/rm -f $(TARFILE)
214         @for i in $(ONEDIRS) ;\
215         do \
216         /bin/rm -fr $$i/*; \
217         done
218
219 makefile.one: files
220         perl util/mk1mf.pl >makefile.one; \
221         sh util/do_ms.sh
222
223 files:  MINFO
224         perl $(TOP)/util/files.pl Makefile.ssl > $(TOP)/MINFO
225         @for i in $(DIRS) ;\
226         do \
227         (cd $$i && echo "making 'files' in $$i..." && \
228         $(MAKE) SDIRS='${SDIRS}' files ) || exit 1; \
229         done;
230
231 links:
232         /bin/rm -f Makefile
233         ./util/point.sh Makefile.ssl Makefile
234         $(TOP)/util/mklink.sh include $(EXHEADER)
235         @for i in $(DIRS) ;\
236         do \
237         (cd $$i && echo "making links in $$i..." && \
238         $(MAKE) SDIRS='${SDIRS}' links ) || exit 1; \
239         done;
240         @(SSLEAY="`pwd`/apps/ssleay"; export SSLEAY; sh tools/c_rehash certs)
241
242 dclean:
243         /bin/rm -f *.bak
244         @for i in $(DIRS) ;\
245         do \
246         (cd $$i && echo "undoing makedepend in $$i..." && \
247         $(MAKE) SDIRS='${SDIRS}' dclean ) || exit 1; \
248         done;
249
250 rehash:
251         @(PATH="`pwd`/apps:${PATH}"; sh tools/c_rehash certs)
252
253 test:   tests
254
255 tests:
256         (cd test && echo "testing $$i..." && \
257         $(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 );
258         @apps/ssleay version -a
259
260 depend:
261         @for i in $(DIRS) ;\
262         do \
263         (cd $$i && echo "making dependancies $$i..." && \
264         $(MAKE) SDIRS='${SDIRS}' depend ) || exit 1; \
265         done;
266
267 lint:
268         @for i in $(DIRS) ;\
269         do \
270         (cd $$i && echo "making lint $$i..." && \
271         $(MAKE) SDIRS='${SDIRS}' lint ) || exit 1; \
272         done;
273
274 tags:
275         @for i in $(DIRS) ;\
276         do \
277         (cd $$i && echo "making tags $$i..." && \
278         $(MAKE) SDIRS='${SDIRS}' tags ) || exit 1; \
279         done;
280
281 errors:
282         @for i in $(DIRS) ;\
283         do \
284         (cd $$i && echo "making errors in $$i..." && \
285         $(MAKE) SDIRS='${SDIRS}' errors ) || exit 1; \
286         done;
287
288 tar:
289         @gtar --no-recursion -cvf - \
290                 `find * -depth -print | grep -v CVS | grep -v .cvsignore | sort` |\
291         tardy --user_number=0  --user_name=rse      \
292               --group_number=0 --group_name=openssl \
293               --prefix=openssl-$(VERSION) - |\
294         gzip --best >../$(TARFILE).gz; \
295         ls -l ../$(TARFILE).gz
296
297 dist:   
298         perl Configure dist
299         perl util/up_ver.pl ${VERSION}
300         @$(MAKE) dist_pem_h
301         @$(MAKE) SDIRS='${SDIRS}' clean
302         @$(MAKE) SDIRS='${SDIRS}' dclean
303         @(cd apps; sh ./rmlinks)
304         @$(MAKE) makefile.one
305         @$(MAKE) tar
306
307 dist_pem_h:
308         (cd crypto/pem; $(MAKE) SDIRS='${SDIRS}' CFLAG='${CFLAG}' pem.h; $(MAKE) clean)
309
310 install: all
311         @-mkdir -p $(INSTALLTOP)/bin 2>/dev/null
312         @-mkdir -p $(INSTALLTOP)/lib 2>/dev/null
313         @-mkdir -p $(INSTALLTOP)/include 2>/dev/null
314         @-mkdir -p $(INSTALLTOP)/certs 2>/dev/null
315         @-mkdir -p $(INSTALLTOP)/private 2>/dev/null
316         @for i in $(DIRS) ;\
317         do \
318         (cd $$i; echo "installing $$i..."; \
319         $(MAKE) CC='${CC}' CFLAG='${CFLAG}' INSTALLTOP='${INSTALLTOP}' EX_LIBS='${EX_LIBS}' SDIRS='${SDIRS}' install ); \
320         done
321         @for i in $(LIBS) ;\
322         do \
323         (       echo installing $$i; \
324                 cp $$i $(INSTALLTOP)/lib; \
325                 sh util/ranlib.sh $(INSTALLTOP)/lib/$$i; \
326                 chmod 644 $(INSTALLTOP)/lib/$$i ); \
327         done
328
329 # DO NOT DELETE THIS LINE -- make depend depends on it.