]> git.ipfire.org Git - thirdparty/openssl.git/blame - Makefile.org
e_os2.h is used for things that must be visible when external applications
[thirdparty/openssl.git] / Makefile.org
CommitLineData
d56128f0
RE
1##
2## Makefile for OpenSSL
3##
4
0973910f
UM
5VERSION=
6MAJOR=
7MINOR=
d56128f0 8PLATFORM=dist
31ff97b2 9OPTIONS=
e5f3045f
BM
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.
13INSTALL_PREFIX=
462ba4f6
UM
14INSTALLTOP=/usr/local/ssl
15
16# Do not edit this manually. Use Configure --openssldir=DIR do change this!
17OPENSSLDIR=/usr/local/ssl
d56128f0 18
d02b48c6
RE
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
58964a49 24# system defines as well, i.e. _REENTERANT for Solaris 2.[34]
d02b48c6
RE
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
58964a49
RE
29# one. 32 bytes will be read from this when the random
30# number generator is initalised.
d02b48c6 31# SSL_ALLOW_ADH - define if you want the server to be able to use the
58964a49 32# SSLv3 anon-DH ciphers.
baf748ba 33# SSL_FORBID_ENULL - define if you want the server to be not able to use the
58964a49 34# NULL encryption ciphers.
d02b48c6
RE
35#
36# LOCK_DEBUG - turns on lots of lock debug output :-)
37# REF_CHECK - turn on some xyz_free() assertions.
58964a49 38# REF_PRINT - prints some stuff on structure free.
d02b48c6
RE
39# CRYPTO_MDEBUG - turns on my 'memory leak' detecting stuff
40# MFUNC - Make all Malloc/Free/Realloc calls call
58964a49
RE
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
dfeab068
RE
46# Do not define B_ENDIAN or L_ENDIAN if 'unsigned long' == 8. It must
47# equal 4.
48# PKCS1_CHECK - pkcs1 tests.
d02b48c6 49
8d7ed6ff 50CC= gcc
dfeab068 51#CFLAG= -DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -m486 -Wall -Wuninitialized -DSHA1_ASM -DMD5_ASM -DRMD160_ASM
8d7ed6ff 52CFLAG= -DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O3 -m486 -Wall -DSHA1_ASM -DMD5_ASM -DRMD160_ASM
f5d7a031 53DEPFLAG=
d02b48c6 54PEX_LIBS= -L. -L.. -L../.. -L../../..
651d0aff 55EX_LIBS=
d02b48c6 56AR=ar r
99aab161
UM
57RANLIB= ranlib
58PERL= perl
d02b48c6 59
dfeab068
RE
60# Set BN_ASM to bn_asm.o if you want to use the C version
61BN_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
d02b48c6 74
2613c1fa
UM
75# For x86 assembler: Set PROCESSOR to 386 if you want to support
76# the 80386.
77PROCESSOR=
78
d02b48c6
RE
79# Set DES_ENC to des_enc.o if you want to use the C version
80#There are 4 x86 assember options.
8d7ed6ff 81DES_ENC= asm/dx86-out.o asm/yx86-out.o
58964a49
RE
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
d02b48c6
RE
87
88# Set BF_ENC to bf_enc.o if you want to use the C version
89#There are 4 x86 assember options.
8d7ed6ff 90BF_ENC= asm/bx86-out.o
58964a49 91#BF_ENC= bf_enc.o
d02b48c6 92#BF_ENC= asm/bx86-elf.o # elf
58964a49
RE
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
d02b48c6 96
58964a49
RE
97# Set CAST_ENC to c_enc.o if you want to use the C version
98#There are 4 x86 assember options.
8d7ed6ff 99CAST_ENC= asm/cx86-out.o
58964a49
RE
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.
8d7ed6ff 108RC4_ENC= asm/rx86-out.o
58964a49
RE
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.
8d7ed6ff 117RC5_ENC= asm/r586-out.o
58964a49
RE
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
8d7ed6ff 125MD5_ASM_OBJ= asm/mx86-out.o
58964a49
RE
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
8d7ed6ff 132SHA1_ASM_OBJ= asm/sx86-out.o
58964a49
RE
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
8d7ed6ff 139RMD160_ASM_OBJ= asm/rm86-out.o
58964a49
RE
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
145DIRS= crypto ssl rsaref apps test tools
0973910f
UM
146SHLIBDIRS= crypto ssl
147
d02b48c6
RE
148# dirs in crypto to build
149SDIRS= \
58964a49
RE
150 md2 md5 sha mdc2 hmac ripemd \
151 des rc2 rc4 rc5 idea bf cast \
152 bn rsa dsa dh \
f317aa4c 153 buffer bio stack lhash rand err objects \
8d8c7266 154 evp asn1 pem x509 x509v3 conf txt_db pkcs7 pkcs12 comp
d02b48c6 155
d02b48c6 156MAKEFILE= Makefile.ssl
58964a49 157MAKE= make -f Makefile.ssl
d02b48c6
RE
158
159MAN1=1
160MAN3=3
161SHELL=/bin/sh
162
58964a49 163TOP= .
d02b48c6 164ONEDIRS=out tmp
7d7d2cbc 165EDIRS= times doc bugs util include certs ms shlib mt demos perl sf dep VMS
58964a49
RE
166WDIRS= windows
167LIBS= libcrypto.a libssl.a
168
169GENERAL= Makefile
9ce5db45 170BASENAME= openssl
58964a49
RE
171NAME= $(BASENAME)-$(VERSION)
172TARFILE= $(NAME).tar
173WTARFILE= $(NAME)-win.tar
2a4a0a34 174EXHEADER= e_os.h e_os2.h
58964a49 175HEADER= e_os.h
d02b48c6 176
9535d202 177all: Makefile.ssl
d02b48c6
RE
178 @for i in $(DIRS) ;\
179 do \
bb8f3c58 180 (cd $$i && echo "making all in $$i..." && \
99aab161 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; \
d02b48c6
RE
182 done;
183
184sub_all:
185 @for i in $(DIRS) ;\
186 do \
bb8f3c58 187 (cd $$i && echo "making all in $$i..." && \
99aab161 188 $(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; \
d02b48c6
RE
189 done;
190
0973910f
UM
191linux-shared:
192 for i in ${SHLIBDIRS}; do \
193 rm -f lib$$i.a lib$$i.so \
194 lib$$i.so.${MAJOR} lib$$i.so.${MAJOR}.${MINOR}; \
195 ${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; \
196 ( set -x; ${CC} -shared -o lib$$i.so.${MAJOR}.${MINOR} \
197 -Wl,-S,-soname=lib$$i.so.${MAJOR} \
198 -Wl,--whole-archive lib$$i.a \
199 -Wl,--no-whole-archive -lc ) || exit 1; \
200 rm -f lib$$i.a; make -C $$i clean || exit 1 ;\
201 done;
202 @set -x; \
203 for i in ${SHLIBDIRS}; do \
204 ln -s lib$$i.so.${MAJOR}.${MINOR} lib$$i.so.${MAJOR}; \
205 ln -s lib$$i.so.${MAJOR} lib$$i.so; \
206 done;
207
9535d202 208Makefile.ssl: Makefile.org
5ea177cf
RE
209 @echo "Makefile.ssl is older than Makefile.org."
210 @echo "Reconfigure the source tree (via 'perl Configure' or 'sh config')"
211 @echo "and update the error lists (via 'make errors'), please."
9535d202
BL
212 @false
213
dfeab068 214libclean:
bb8f3c58 215 rm -f *.a */lib */*/lib
dfeab068 216
d02b48c6 217clean:
bb8f3c58 218 rm -f shlib/*.o *.o core a.out fluff *.map
d02b48c6
RE
219 @for i in $(DIRS) ;\
220 do \
bb8f3c58 221 (cd $$i && echo "making clean in $$i..." && \
56ee3117 222 $(MAKE) SDIRS='${SDIRS}' clean ) || exit 1; \
bb8f3c58 223 rm -f $(LIBS); \
d02b48c6 224 done;
bb8f3c58
RE
225 rm -f *.a *.o speed.* *.map *.so .pure core
226 rm -f $(TARFILE)
d02b48c6
RE
227 @for i in $(ONEDIRS) ;\
228 do \
bb8f3c58 229 rm -fr $$i/*; \
d02b48c6
RE
230 done
231
232makefile.one: files
99aab161 233 $(PERL) util/mk1mf.pl >makefile.one; \
d02b48c6
RE
234 sh util/do_ms.sh
235
bacad008 236files:
99aab161 237 $(PERL) $(TOP)/util/files.pl Makefile.ssl > $(TOP)/MINFO
d02b48c6
RE
238 @for i in $(DIRS) ;\
239 do \
56ee3117 240 (cd $$i && echo "making 'files' in $$i..." && \
5a9bab32 241 $(MAKE) SDIRS='${SDIRS}' PERL='${PERL}' files ) || exit 1; \
d02b48c6
RE
242 done;
243
244links:
bb8f3c58 245 @$(TOP)/util/point.sh Makefile.ssl Makefile
ec577822 246 @-mkdir -p include/openssl 2>/dev/null
1314c344 247 @$(PERL) $(TOP)/util/mklink.pl include/openssl $(EXHEADER)
bb8f3c58 248 @for i in $(DIRS); do \
56ee3117 249 (cd $$i && echo "making links in $$i..." && \
1314c344 250 $(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; \
d02b48c6 251 done;
d02b48c6
RE
252
253dclean:
bb8f3c58 254 rm -f *.bak
d02b48c6
RE
255 @for i in $(DIRS) ;\
256 do \
bb8f3c58 257 (cd $$i && echo "making dclean in $$i..." && \
d10c5c22 258 $(MAKE) SDIRS='${SDIRS}' PERL='${PERL}' dclean ) || exit 1; \
d02b48c6
RE
259 done;
260
261rehash:
b621d772 262 @(OPENSSL="`pwd`/apps/openssl"; export OPENSSL; sh tools/c_rehash certs)
d02b48c6 263
58964a49 264test: tests
d02b48c6 265
73bfb9ad 266tests: rehash
bb8f3c58 267 @(cd test && echo "testing..." && \
dfeab068 268 $(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 );
794b9c8f 269 @apps/openssl version -a
d02b48c6
RE
270
271depend:
272 @for i in $(DIRS) ;\
273 do \
56ee3117 274 (cd $$i && echo "making dependancies $$i..." && \
f5d7a031 275 $(MAKE) SDIRS='${SDIRS}' DEPFLAG='${DEPFLAG}' depend ) || exit 1; \
d02b48c6
RE
276 done;
277
278lint:
279 @for i in $(DIRS) ;\
280 do \
56ee3117
PS
281 (cd $$i && echo "making lint $$i..." && \
282 $(MAKE) SDIRS='${SDIRS}' lint ) || exit 1; \
d02b48c6
RE
283 done;
284
285tags:
286 @for i in $(DIRS) ;\
287 do \
56ee3117
PS
288 (cd $$i && echo "making tags $$i..." && \
289 $(MAKE) SDIRS='${SDIRS}' tags ) || exit 1; \
d02b48c6
RE
290 done;
291
292errors:
73934800 293 perl util/mkerr.pl -recurse -write
d02b48c6
RE
294
295tar:
651d0aff 296 @gtar --no-recursion -cvf - \
0f423567 297 `find * -depth -print | grep -v CVS | grep -v .cvsignore | grep -v STATUS | sort` |\
5a061129 298 tardy --user_number=0 --user_name=openssl \
9ce5db45
RE
299 --group_number=0 --group_name=openssl \
300 --prefix=openssl-$(VERSION) - |\
651d0aff
RE
301 gzip --best >../$(TARFILE).gz; \
302 ls -l ../$(TARFILE).gz
d02b48c6 303
58964a49 304dist:
99aab161 305 $(PERL) Configure dist
d02b48c6
RE
306 @$(MAKE) dist_pem_h
307 @$(MAKE) SDIRS='${SDIRS}' clean
d02b48c6
RE
308 @$(MAKE) tar
309
310dist_pem_h:
7d7d2cbc 311 (cd crypto/pem; $(MAKE) CC='${CC}' SDIRS='${SDIRS}' CFLAG='${CFLAG}' pem.h; $(MAKE) clean)
d02b48c6
RE
312
313install: all
e5f3045f
BM
314 @-mkdir -p $(INSTALL_PREFIX)$(INSTALLTOP)/bin 2>/dev/null
315 @-mkdir -p $(INSTALL_PREFIX)$(INSTALLTOP)/lib 2>/dev/null
316 @-mkdir -p $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl 2>/dev/null
317 @-mkdir -p $(INSTALL_PREFIX)$(OPENSSLDIR)/misc 2>/dev/null
318 @-mkdir -p $(INSTALL_PREFIX)$(OPENSSLDIR)/certs 2>/dev/null
319 @-mkdir -p $(INSTALL_PREFIX)$(OPENSSLDIR)/private 2>/dev/null
320 @-mkdir -p $(INSTALL_PREFIX)$(OPENSSLDIR)/lib 2>/dev/null
2a4a0a34
BM
321 @for i in $(EXHEADER) ;\
322 do \
323 (cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \
324 chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \
325 done;
d02b48c6
RE
326 @for i in $(DIRS) ;\
327 do \
328 (cd $$i; echo "installing $$i..."; \
e5f3045f 329 $(MAKE) CC='${CC}' CFLAG='${CFLAG}' INSTALL_PREFIX='${INSTALL_PREFIX}' INSTALLTOP='${INSTALLTOP}' OPENSSLDIR='${OPENSSLDIR}' EX_LIBS='${EX_LIBS}' SDIRS='${SDIRS}' install ); \
d02b48c6
RE
330 done
331 @for i in $(LIBS) ;\
332 do \
58964a49 333 ( echo installing $$i; \
e5f3045f
BM
334 cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/lib; \
335 $(RANLIB) $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i; \
336 chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i ); \
d02b48c6
RE
337 done
338
339# DO NOT DELETE THIS LINE -- make depend depends on it.