]>
Commit | Line | Data |
---|---|---|
d56128f0 RE |
1 | ## |
2 | ## Makefile for OpenSSL | |
3 | ## | |
4 | ||
0973910f UM |
5 | VERSION= |
6 | MAJOR= | |
7 | MINOR= | |
b436a982 RL |
8 | SHLIB_VERSION_NUMBER= |
9 | SHLIB_VERSION_HISTORY= | |
10 | SHLIB_MAJOR= | |
11 | SHLIB_MINOR= | |
a22fb399 | 12 | SHLIB_EXT= |
d56128f0 | 13 | PLATFORM=dist |
31ff97b2 | 14 | OPTIONS= |
c59cb511 | 15 | CONFIGURE_ARGS= |
b436a982 RL |
16 | SHLIB_TARGET= |
17 | ||
e5f3045f BM |
18 | # INSTALL_PREFIX is for package builders so that they can configure |
19 | # for, say, /usr/ and yet have everything installed to /tmp/somedir/usr/. | |
20 | # Normally it is left empty. | |
21 | INSTALL_PREFIX= | |
462ba4f6 UM |
22 | INSTALLTOP=/usr/local/ssl |
23 | ||
24 | # Do not edit this manually. Use Configure --openssldir=DIR do change this! | |
25 | OPENSSLDIR=/usr/local/ssl | |
d56128f0 | 26 | |
d02b48c6 RE |
27 | # NO_IDEA - Define to build without the IDEA algorithm |
28 | # NO_RC4 - Define to build without the RC4 algorithm | |
29 | # NO_RC2 - Define to build without the RC2 algorithm | |
30 | # THREADS - Define when building with threads, you will probably also need any | |
58964a49 | 31 | # system defines as well, i.e. _REENTERANT for Solaris 2.[34] |
d02b48c6 RE |
32 | # TERMIO - Define the termio terminal subsystem, needed if sgtty is missing. |
33 | # TERMIOS - Define the termios terminal subsystem, Silicon Graphics. | |
34 | # LONGCRYPT - Define to use HPUX 10.x's long password modification to crypt(3). | |
35 | # DEVRANDOM - Give this the value of the 'random device' if your OS supports | |
58964a49 RE |
36 | # one. 32 bytes will be read from this when the random |
37 | # number generator is initalised. | |
baf748ba | 38 | # SSL_FORBID_ENULL - define if you want the server to be not able to use the |
58964a49 | 39 | # NULL encryption ciphers. |
d02b48c6 RE |
40 | # |
41 | # LOCK_DEBUG - turns on lots of lock debug output :-) | |
42 | # REF_CHECK - turn on some xyz_free() assertions. | |
58964a49 | 43 | # REF_PRINT - prints some stuff on structure free. |
d02b48c6 RE |
44 | # CRYPTO_MDEBUG - turns on my 'memory leak' detecting stuff |
45 | # MFUNC - Make all Malloc/Free/Realloc calls call | |
58964a49 RE |
46 | # CRYPTO_malloc/CRYPTO_free/CRYPTO_realloc which can be setup to |
47 | # call application defined callbacks via CRYPTO_set_mem_functions() | |
48 | # MD5_ASM needs to be defined to use the x86 assembler for MD5 | |
49 | # SHA1_ASM needs to be defined to use the x86 assembler for SHA1 | |
50 | # RMD160_ASM needs to be defined to use the x86 assembler for RIPEMD160 | |
dfeab068 RE |
51 | # Do not define B_ENDIAN or L_ENDIAN if 'unsigned long' == 8. It must |
52 | # equal 4. | |
53 | # PKCS1_CHECK - pkcs1 tests. | |
d02b48c6 | 54 | |
8d7ed6ff | 55 | CC= gcc |
dfeab068 | 56 | #CFLAG= -DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -m486 -Wall -Wuninitialized -DSHA1_ASM -DMD5_ASM -DRMD160_ASM |
8d7ed6ff | 57 | CFLAG= -DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O3 -m486 -Wall -DSHA1_ASM -DMD5_ASM -DRMD160_ASM |
f5d7a031 | 58 | DEPFLAG= |
bc29d0e5 | 59 | PEX_LIBS= |
651d0aff | 60 | EX_LIBS= |
967d95f0 | 61 | EXE_EXT= |
d02b48c6 | 62 | AR=ar r |
99aab161 UM |
63 | RANLIB= ranlib |
64 | PERL= perl | |
2dbb3ccd | 65 | TAR= tar |
63977104 | 66 | TARFLAGS= --no-recursion |
cf1b7d96 | 67 | MAKEDEPPROG=makedepend |
d02b48c6 | 68 | |
dfeab068 RE |
69 | # Set BN_ASM to bn_asm.o if you want to use the C version |
70 | BN_ASM= bn_asm.o | |
71 | #BN_ASM= bn_asm.o | |
72 | #BN_ASM= asm/bn86-elf.o # elf, linux-elf | |
73 | #BN_ASM= asm/bn86-sol.o # solaris | |
74 | #BN_ASM= asm/bn86-out.o # a.out, FreeBSD | |
75 | #BN_ASM= asm/bn86bsdi.o # bsdi | |
76 | #BN_ASM= asm/alpha.o # DEC Alpha | |
77 | #BN_ASM= asm/pa-risc2.o # HP-UX PA-RISC | |
78 | #BN_ASM= asm/r3000.o # SGI MIPS cpu | |
79 | #BN_ASM= asm/sparc.o # Sun solaris/SunOS | |
80 | #BN_ASM= asm/bn-win32.o # Windows 95/NT | |
81 | #BN_ASM= asm/x86w16.o # 16 bit code for Windows 3.1/DOS | |
82 | #BN_ASM= asm/x86w32.o # 32 bit code for Windows 3.1 | |
d02b48c6 | 83 | |
2613c1fa UM |
84 | # For x86 assembler: Set PROCESSOR to 386 if you want to support |
85 | # the 80386. | |
86 | PROCESSOR= | |
87 | ||
d02b48c6 RE |
88 | # Set DES_ENC to des_enc.o if you want to use the C version |
89 | #There are 4 x86 assember options. | |
8d7ed6ff | 90 | DES_ENC= asm/dx86-out.o asm/yx86-out.o |
58964a49 RE |
91 | #DES_ENC= des_enc.o fcrypt_b.o # C |
92 | #DES_ENC= asm/dx86-elf.o asm/yx86-elf.o # elf | |
93 | #DES_ENC= asm/dx86-sol.o asm/yx86-sol.o # solaris | |
94 | #DES_ENC= asm/dx86-out.o asm/yx86-out.o # a.out, FreeBSD | |
95 | #DES_ENC= asm/dx86bsdi.o asm/yx86bsdi.o # bsdi | |
d02b48c6 RE |
96 | |
97 | # Set BF_ENC to bf_enc.o if you want to use the C version | |
98 | #There are 4 x86 assember options. | |
8d7ed6ff | 99 | BF_ENC= asm/bx86-out.o |
58964a49 | 100 | #BF_ENC= bf_enc.o |
d02b48c6 | 101 | #BF_ENC= asm/bx86-elf.o # elf |
58964a49 RE |
102 | #BF_ENC= asm/bx86-sol.o # solaris |
103 | #BF_ENC= asm/bx86-out.o # a.out, FreeBSD | |
104 | #BF_ENC= asm/bx86bsdi.o # bsdi | |
d02b48c6 | 105 | |
58964a49 RE |
106 | # Set CAST_ENC to c_enc.o if you want to use the C version |
107 | #There are 4 x86 assember options. | |
8d7ed6ff | 108 | CAST_ENC= asm/cx86-out.o |
58964a49 RE |
109 | #CAST_ENC= c_enc.o |
110 | #CAST_ENC= asm/cx86-elf.o # elf | |
111 | #CAST_ENC= asm/cx86-sol.o # solaris | |
112 | #CAST_ENC= asm/cx86-out.o # a.out, FreeBSD | |
113 | #CAST_ENC= asm/cx86bsdi.o # bsdi | |
114 | ||
115 | # Set RC4_ENC to rc4_enc.o if you want to use the C version | |
116 | #There are 4 x86 assember options. | |
8d7ed6ff | 117 | RC4_ENC= asm/rx86-out.o |
58964a49 RE |
118 | #RC4_ENC= rc4_enc.o |
119 | #RC4_ENC= asm/rx86-elf.o # elf | |
120 | #RC4_ENC= asm/rx86-sol.o # solaris | |
121 | #RC4_ENC= asm/rx86-out.o # a.out, FreeBSD | |
122 | #RC4_ENC= asm/rx86bsdi.o # bsdi | |
123 | ||
124 | # Set RC5_ENC to rc5_enc.o if you want to use the C version | |
125 | #There are 4 x86 assember options. | |
8d7ed6ff | 126 | RC5_ENC= asm/r586-out.o |
58964a49 RE |
127 | #RC5_ENC= rc5_enc.o |
128 | #RC5_ENC= asm/r586-elf.o # elf | |
129 | #RC5_ENC= asm/r586-sol.o # solaris | |
130 | #RC5_ENC= asm/r586-out.o # a.out, FreeBSD | |
131 | #RC5_ENC= asm/r586bsdi.o # bsdi | |
132 | ||
133 | # Also need MD5_ASM defined | |
8d7ed6ff | 134 | MD5_ASM_OBJ= asm/mx86-out.o |
58964a49 RE |
135 | #MD5_ASM_OBJ= asm/mx86-elf.o # elf |
136 | #MD5_ASM_OBJ= asm/mx86-sol.o # solaris | |
137 | #MD5_ASM_OBJ= asm/mx86-out.o # a.out, FreeBSD | |
138 | #MD5_ASM_OBJ= asm/mx86bsdi.o # bsdi | |
139 | ||
140 | # Also need SHA1_ASM defined | |
8d7ed6ff | 141 | SHA1_ASM_OBJ= asm/sx86-out.o |
58964a49 RE |
142 | #SHA1_ASM_OBJ= asm/sx86-elf.o # elf |
143 | #SHA1_ASM_OBJ= asm/sx86-sol.o # solaris | |
144 | #SHA1_ASM_OBJ= asm/sx86-out.o # a.out, FreeBSD | |
145 | #SHA1_ASM_OBJ= asm/sx86bsdi.o # bsdi | |
146 | ||
147 | # Also need RMD160_ASM defined | |
8d7ed6ff | 148 | RMD160_ASM_OBJ= asm/rm86-out.o |
58964a49 RE |
149 | #RMD160_ASM_OBJ= asm/rm86-elf.o # elf |
150 | #RMD160_ASM_OBJ= asm/rm86-sol.o # solaris | |
151 | #RMD160_ASM_OBJ= asm/rm86-out.o # a.out, FreeBSD | |
152 | #RMD160_ASM_OBJ= asm/rm86bsdi.o # bsdi | |
153 | ||
f9b3bff6 RL |
154 | # KRB5 stuff |
155 | KRB5_INCLUDES= | |
156 | LIBKRB5= | |
157 | ||
b436a982 | 158 | # When we're prepared to use shared libraries in the programs we link here |
a22fb399 RL |
159 | # we might set SHLIB_MARK to '$(SHARED_LIBS)'. |
160 | SHLIB_MARK= | |
b436a982 | 161 | |
ccb9643f | 162 | DIRS= crypto ssl $(SHLIB_MARK) apps test tools |
0973910f UM |
163 | SHLIBDIRS= crypto ssl |
164 | ||
d02b48c6 RE |
165 | # dirs in crypto to build |
166 | SDIRS= \ | |
3009458e | 167 | md2 md4 md5 sha mdc2 hmac ripemd \ |
58964a49 | 168 | des rc2 rc4 rc5 idea bf cast \ |
65e81670 | 169 | bn ec rsa dsa dh dso engine rijndael \ |
f317aa4c | 170 | buffer bio stack lhash rand err objects \ |
2a1ef754 | 171 | evp asn1 pem x509 x509v3 conf txt_db pkcs7 pkcs12 comp ocsp ui krb5 |
d02b48c6 | 172 | |
f777408f RL |
173 | # tests to perform. "alltests" is a special word indicating that all tests |
174 | # should be performed. | |
175 | TESTS = alltests | |
176 | ||
d02b48c6 | 177 | MAKEFILE= Makefile.ssl |
58964a49 | 178 | MAKE= make -f Makefile.ssl |
d02b48c6 | 179 | |
e1c55191 | 180 | MANDIR=$(OPENSSLDIR)/man |
d02b48c6 RE |
181 | MAN1=1 |
182 | MAN3=3 | |
183 | SHELL=/bin/sh | |
184 | ||
58964a49 | 185 | TOP= . |
d02b48c6 | 186 | ONEDIRS=out tmp |
7d7d2cbc | 187 | EDIRS= times doc bugs util include certs ms shlib mt demos perl sf dep VMS |
58964a49 | 188 | WDIRS= windows |
b436a982 | 189 | LIBS= libcrypto.a libssl.a |
a22fb399 RL |
190 | SHARED_CRYPTO=libcrypto$(SHLIB_EXT) |
191 | SHARED_SSL=libssl$(SHLIB_EXT) | |
192 | SHARED_LIBS= | |
193 | SHARED_LIBS_LINK_EXTS= | |
58964a49 RE |
194 | |
195 | GENERAL= Makefile | |
9ce5db45 | 196 | BASENAME= openssl |
58964a49 RE |
197 | NAME= $(BASENAME)-$(VERSION) |
198 | TARFILE= $(NAME).tar | |
199 | WTARFILE= $(NAME)-win.tar | |
cf1b7d96 | 200 | EXHEADER= e_os2.h |
58964a49 | 201 | HEADER= e_os.h |
d02b48c6 | 202 | |
a22fb399 RL |
203 | # When we're prepared to use shared libraries in the programs we link here |
204 | # we might remove 'clean-shared' from the targets to perform at this stage | |
205 | ||
a7b42009 | 206 | all: Makefile.ssl sub_all |
d02b48c6 RE |
207 | |
208 | sub_all: | |
a22fb399 | 209 | @for i in $(DIRS); \ |
d02b48c6 | 210 | do \ |
a22fb399 | 211 | if [ -d "$$i" ]; then \ |
b436a982 | 212 | (cd $$i && echo "making all in $$i..." && \ |
a7b42009 | 213 | $(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}' KRB5_INCLUDES='${KRB5_INCLUDES}' LIBKRB5='${LIBKRB5}' EXE_EXT='${EXE_EXT}' SHARED_LIBS='${SHARED_LIBS}' SHLIB_EXT='${SHLIB_EXT}' all ) || exit 1; \ |
a22fb399 RL |
214 | else \ |
215 | $(MAKE) $$i; \ | |
b436a982 RL |
216 | fi; \ |
217 | done; \ | |
b436a982 | 218 | |
a22fb399 | 219 | libcrypto$(SHLIB_EXT): libcrypto.a |
f4316c36 | 220 | @if [ "$(SHLIB_TARGET)" != "" ]; then \ |
a22fb399 | 221 | $(MAKE) SHLIBDIRS=crypto build-shared; \ |
f4316c36 RL |
222 | else \ |
223 | echo "There's no support for shared libraries on this platform" >&2; \ | |
224 | fi | |
a22fb399 | 225 | libssl$(SHLIB_EXT): libcrypto$(SHLIB_EXT) libssl.a |
f4316c36 | 226 | @if [ "$(SHLIB_TARGET)" != "" ]; then \ |
5ddcb866 | 227 | $(MAKE) SHLIBDIRS=ssl SHLIBDEPS='-lcrypto' build-shared; \ |
f4316c36 RL |
228 | else \ |
229 | echo "There's no support for shared libraries on this platform" >&2; \ | |
230 | fi | |
b436a982 RL |
231 | |
232 | clean-shared: | |
a22fb399 RL |
233 | @for i in $(SHLIBDIRS); do \ |
234 | if [ -n "$(SHARED_LIBS_LINK_EXTS)" ]; then \ | |
235 | tmp="$(SHARED_LIBS_LINK_EXTS)"; \ | |
236 | for j in $${tmp:-x}; do \ | |
237 | ( set -x; rm -f lib$$i$$j ); \ | |
238 | done; \ | |
239 | fi; \ | |
240 | ( set -x; rm -f lib$$i$(SHLIB_EXT) ); \ | |
b436a982 | 241 | done |
d02b48c6 | 242 | |
a22fb399 RL |
243 | link-shared: |
244 | @for i in $(SHLIBDIRS); do \ | |
245 | prev=lib$$i$(SHLIB_EXT); \ | |
246 | if [ -n "$(SHARED_LIBS_LINK_EXTS)" ]; then \ | |
247 | tmp="$(SHARED_LIBS_LINK_EXTS)"; \ | |
248 | for j in $${tmp:-x}; do \ | |
73aeb61c | 249 | ( set -x; ln -f -s $$prev lib$$i$$j ); \ |
a22fb399 RL |
250 | prev=lib$$i$$j; \ |
251 | done; \ | |
252 | fi; \ | |
253 | done | |
254 | ||
255 | build-shared: clean-shared do_$(SHLIB_TARGET) link-shared | |
256 | ||
3a465d5e | 257 | do_bsd-gcc-shared: do_gnu-shared |
73aeb61c RL |
258 | do_linux-shared: do_gnu-shared |
259 | do_gnu-shared: | |
5ddcb866 | 260 | libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \ |
b436a982 | 261 | ( set -x; ${CC} -shared -o lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \ |
6f8a82c7 | 262 | -Wl,-soname=lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \ |
0973910f | 263 | -Wl,--whole-archive lib$$i.a \ |
bb1c9dcc | 264 | -Wl,--no-whole-archive $$libs ${EX_LIBS} -lc ) || exit 1; \ |
5ddcb866 | 265 | libs="$$libs -l$$i"; \ |
96f3b56c | 266 | done |
b436a982 | 267 | |
6b86bad5 RL |
268 | DETECT_GNU_LD=${CC} -v 2>&1 | grep '^gcc' >/dev/null 2>&1 && \ |
269 | collect2=`gcc -print-prog-name=collect2 2>&1` && \ | |
270 | [ -n "$$collect2" ] && \ | |
271 | my_ld=`$$collect2 --help 2>&1 | grep Usage: | sed 's/^Usage: *\([^ ][^ ]*\).*/\1/'` && \ | |
272 | [ -n "$$my_ld" ] && \ | |
273 | $$my_ld -v 2>&1 | grep 'GNU ld' >/dev/null 2>&1 | |
274 | ||
b436a982 | 275 | # This assumes that GNU utilities are *not* used |
6bc847e4 | 276 | do_alpha-osf1-shared: |
6b86bad5 RL |
277 | if ${DETECT_GNU_LD}; then \ |
278 | $(MAKE) do_gnu-shared; \ | |
279 | else \ | |
280 | libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \ | |
281 | ( set -x; ${CC} -shared -o lib$$i.so \ | |
282 | -set_version "${SHLIB_VERSION_HISTORY}${SHLIB_VERSION_NUMBER}" \ | |
283 | -all lib$$i.a -none $$libs ${EX_LIBS} -lc ) || exit 1; \ | |
284 | libs="$$libs -l$$i"; \ | |
285 | done; \ | |
286 | fi | |
0973910f | 287 | |
6bc847e4 RL |
288 | # This assumes that GNU utilities are *not* used |
289 | # The difference between alpha-osf1-shared and tru64-shared is the `-msym' | |
290 | # option passed to the linker. | |
291 | do_tru64-shared: | |
6b86bad5 RL |
292 | if ${DETECT_GNU_LD}; then \ |
293 | $(MAKE) do_gnu-shared; \ | |
294 | else \ | |
295 | libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \ | |
296 | ( set -x; ${CC} -shared -msym -o lib$$i.so \ | |
297 | -set_version "${SHLIB_VERSION_HISTORY}${SHLIB_VERSION_NUMBER}" \ | |
298 | -all lib$$i.a -none $$libs ${EX_LIBS} -lc ) || exit 1; \ | |
299 | libs="$$libs -l$$i"; \ | |
300 | done; \ | |
301 | fi | |
6bc847e4 RL |
302 | |
303 | # This assumes that GNU utilities are *not* used | |
304 | # The difference between tru64-shared and tru64-shared-rpath is the | |
305 | # -rpath ${INSTALLTOP}/lib passed to the linker. | |
306 | do_tru64-shared-rpath: | |
6b86bad5 RL |
307 | if ${DETECT_GNU_LD}; then \ |
308 | $(MAKE) do_gnu-shared; \ | |
309 | else \ | |
310 | libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \ | |
311 | ( set -x; ${CC} -shared -msym -o lib$$i.so \ | |
312 | -rpath ${INSTALLTOP}/lib \ | |
313 | -set_version "${SHLIB_VERSION_HISTORY}${SHLIB_VERSION_NUMBER}" \ | |
314 | -all lib$$i.a -none $$libs ${EX_LIBS} -lc ) || exit 1; \ | |
315 | libs="$$libs -l$$i"; \ | |
316 | done; \ | |
317 | fi | |
6bc847e4 RL |
318 | |
319 | ||
ccb9aae9 | 320 | # This assumes that GNU utilities are *not* used |
a22fb399 | 321 | do_solaris-shared: |
6b86bad5 RL |
322 | if ${DETECT_GNU_LD}; then \ |
323 | $(MAKE) do_gnu-shared; \ | |
324 | else \ | |
325 | libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \ | |
326 | ( PATH=/usr/ccs/bin:$$PATH ; export PATH; \ | |
327 | set -x; ${CC} -G -o lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \ | |
328 | -h lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \ | |
329 | -z allextract lib$$i.a $$libs ${EX_LIBS} -lc ) || exit 1; \ | |
330 | libs="$$libs -l$$i"; \ | |
331 | done; \ | |
332 | fi | |
ccb9aae9 | 333 | |
6c36f7a9 LJ |
334 | # UnixWare 7 and OpenUNIX 8 native compilers used |
335 | do_svr5-shared: | |
6b86bad5 RL |
336 | if ${DETECT_GNU_LD}; then \ |
337 | $(MAKE) do_gnu-shared; \ | |
338 | else \ | |
339 | libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \ | |
340 | ( PATH=/usr/ccs/bin:$$PATH ; export PATH; \ | |
341 | find . -name "*.o" -print > allobjs ; \ | |
342 | OBJS= ; export OBJS ; \ | |
343 | for obj in `ar t lib$$i.a` ; do \ | |
344 | OBJS="$${OBJS} `grep $$obj allobjs`" ; \ | |
345 | done ; \ | |
346 | set -x; ${CC} -G -o lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \ | |
347 | -h lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \ | |
348 | $${OBJS} $$libs ${EX_LIBS} ) || exit 1; \ | |
349 | libs="$$libs -l$$i"; \ | |
350 | done; \ | |
351 | fi | |
6c36f7a9 | 352 | |
dcea8e12 RL |
353 | # This assumes that GNU utilities are *not* used |
354 | do_irix-shared: | |
6b86bad5 RL |
355 | if ${DETECT_GNU_LD}; then \ |
356 | $(MAKE) do_gnu-shared; \ | |
357 | else \ | |
358 | libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \ | |
359 | ( set -x; ${CC} -shared -o lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \ | |
360 | -Wl,-soname,lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \ | |
361 | -all lib$$i.a $$libs ${EX_LIBS} -lc) || exit 1; \ | |
362 | libs="$$libs -l$$i"; \ | |
363 | done; \ | |
364 | fi | |
dcea8e12 | 365 | |
0fd44e2d | 366 | # This assumes that GNU utilities are *not* used |
305db17b LJ |
367 | # HP-UX includes the full pathname of libs we depend on, so we would get |
368 | # ./libcrypto (with ./ as path information) compiled into libssl, hence | |
369 | # we omit the SHLIBDEPS. Applications must be linked with -lssl -lcrypto | |
370 | # anyway. | |
371 | # The object modules are loaded from lib$i.a using the undocumented -Fl | |
372 | # option. | |
373 | # | |
374 | # WARNING: Until DSO is fixed to support a search path, we support SHLIB_PATH | |
375 | # by temporarily specifying "+s"! | |
376 | # | |
0fd44e2d | 377 | do_hpux-shared: |
305db17b | 378 | for i in ${SHLIBDIRS}; do \ |
9dd04638 | 379 | ( set -x; /usr/ccs/bin/ld +vnocompatwarnings \ |
305db17b LJ |
380 | -b -z +s \ |
381 | -o lib$$i.sl.${SHLIB_MAJOR}.${SHLIB_MINOR} \ | |
0fd44e2d | 382 | +h lib$$i.sl.${SHLIB_MAJOR}.${SHLIB_MINOR} \ |
305db17b | 383 | -Fl lib$$i.a -ldld -lc ) || exit 1; \ |
0fd44e2d RL |
384 | done |
385 | ||
386 | # This assumes that GNU utilities are *not* used | |
305db17b LJ |
387 | # HP-UX includes the full pathname of libs we depend on, so we would get |
388 | # ./libcrypto (with ./ as path information) compiled into libssl, hence | |
389 | # we omit the SHLIBDEPS. Applications must be linked with -lssl -lcrypto | |
390 | # anyway. | |
391 | # | |
392 | # HP-UX in 64bit mode has "+s" enabled by default; it will search for | |
393 | # shared libraries along LD_LIBRARY_PATH _and_ SHLIB_PATH. | |
394 | # | |
0fd44e2d | 395 | do_hpux64-shared: |
305db17b LJ |
396 | for i in ${SHLIBDIRS}; do \ |
397 | ( set -x; /usr/ccs/bin/ld -b -z \ | |
398 | -o lib$$i.sl.${SHLIB_MAJOR}.${SHLIB_MINOR} \ | |
0fd44e2d | 399 | +h lib$$i.sl.${SHLIB_MAJOR}.${SHLIB_MINOR} \ |
305db17b | 400 | +forceload lib$$i.a -ldl -lc ) || exit 1; \ |
0fd44e2d RL |
401 | done |
402 | ||
f9a4ad4f RL |
403 | # The following method is said to work on all platforms. Tests will |
404 | # determine if that's how it's gong to be used. | |
405 | # This assumes that for all but GNU systems, GNU utilities are *not* used. | |
406 | # ALLSYMSFLAGS would be: | |
407 | # GNU systems: --whole-archive | |
408 | # Tru64 Unix: -all | |
409 | # Solaris: -z allextract | |
410 | # Irix: -all | |
411 | # HP/UX-32bit: -Fl | |
412 | # HP/UX-64bit: +forceload | |
413 | # AIX: -bnogc | |
414 | # SHAREDFLAGS would be: | |
415 | # GNU systems: -shared -Wl,-soname=lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} | |
416 | # Tru64 Unix: -shared \ | |
417 | # -set_version "${SHLIB_VERSION_HISTORY}${SHLIB_VERSION_NUMBER}" | |
418 | # Solaris: -G -h lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} | |
419 | # Irix: -shared -Wl,-soname,lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} | |
420 | # HP/UX-32bit: +vnocompatwarnings -b -z +s \ | |
421 | # +h lib$$i.sl.${SHLIB_MAJOR}.${SHLIB_MINOR} | |
422 | # HP/UX-64bit: -b -z +h lib$$i.sl.${SHLIB_MAJOR}.${SHLIB_MINOR} | |
5352823f | 423 | # AIX: -G -bE:lib$$i.exp -bM:SRE |
f9a4ad4f RL |
424 | # SHAREDCMD would be: |
425 | # GNU systems: $(CC) | |
426 | # Tru64 Unix: $(CC) | |
427 | # Solaris: $(CC) | |
428 | # Irix: $(CC) | |
429 | # HP/UX-32bit: /usr/ccs/bin/ld | |
430 | # HP/UX-64bit: /usr/ccs/bin/ld | |
431 | # AIX: $(CC) | |
432 | ALLSYMSFLAG=-bnogc | |
5352823f | 433 | SHAREDFLAGS=-G -bE:lib$$i.exp -bM:SRE |
f9a4ad4f RL |
434 | SHAREDCMD=$(CC) |
435 | do_aix-shared: | |
436 | libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \ | |
437 | ( set -x; \ | |
438 | ld -r -o $$i.o $(ALLSYMSFLAG) lib$$i.a && \ | |
439 | ( nm -Pg lib$$i.o | grep ' [BD] ' | cut -f1 -d' ' > lib$$i.exp; \ | |
440 | $(SHAREDCMD) $(SHAREDFLAG) -o lib$$i.so lib$$i.o \ | |
441 | $$libs ${EX_LIBS} ) ) \ | |
442 | || exit 1; \ | |
443 | libs="$$libs -l$$i"; \ | |
444 | done | |
445 | ||
9535d202 | 446 | Makefile.ssl: Makefile.org |
5ea177cf | 447 | @echo "Makefile.ssl is older than Makefile.org." |
49b81422 | 448 | @echo "Reconfigure the source tree (via './config' or 'perl Configure'), please." |
9535d202 BL |
449 | @false |
450 | ||
dfeab068 | 451 | libclean: |
bb8f3c58 | 452 | rm -f *.a */lib */*/lib |
dfeab068 | 453 | |
d02b48c6 | 454 | clean: |
5946ede5 | 455 | rm -f shlib/*.o *.o core a.out fluff *.map rehash.time testlog make.log cctest cctest.c |
d02b48c6 RE |
456 | @for i in $(DIRS) ;\ |
457 | do \ | |
a22fb399 | 458 | if [ -d "$$i" ]; then \ |
b436a982 RL |
459 | (cd $$i && echo "making clean in $$i..." && \ |
460 | $(MAKE) SDIRS='${SDIRS}' clean ) || exit 1; \ | |
461 | rm -f $(LIBS); \ | |
462 | fi; \ | |
d02b48c6 | 463 | done; |
bb8f3c58 RE |
464 | rm -f *.a *.o speed.* *.map *.so .pure core |
465 | rm -f $(TARFILE) | |
d02b48c6 RE |
466 | @for i in $(ONEDIRS) ;\ |
467 | do \ | |
bb8f3c58 | 468 | rm -fr $$i/*; \ |
d02b48c6 RE |
469 | done |
470 | ||
471 | makefile.one: files | |
99aab161 | 472 | $(PERL) util/mk1mf.pl >makefile.one; \ |
d02b48c6 RE |
473 | sh util/do_ms.sh |
474 | ||
bacad008 | 475 | files: |
99aab161 | 476 | $(PERL) $(TOP)/util/files.pl Makefile.ssl > $(TOP)/MINFO |
d02b48c6 RE |
477 | @for i in $(DIRS) ;\ |
478 | do \ | |
a22fb399 | 479 | if [ -d "$$i" ]; then \ |
b436a982 RL |
480 | (cd $$i && echo "making 'files' in $$i..." && \ |
481 | $(MAKE) SDIRS='${SDIRS}' PERL='${PERL}' files ) || exit 1; \ | |
482 | fi; \ | |
d02b48c6 RE |
483 | done; |
484 | ||
485 | links: | |
bb8f3c58 | 486 | @$(TOP)/util/point.sh Makefile.ssl Makefile |
6576774b | 487 | @$(PERL) $(TOP)/util/mkdir-p.pl include/openssl |
41d2a336 | 488 | @$(PERL) $(TOP)/util/mklink.pl include/openssl $(EXHEADER) |
bb8f3c58 | 489 | @for i in $(DIRS); do \ |
a22fb399 | 490 | if [ -d "$$i" ]; then \ |
b436a982 | 491 | (cd $$i && echo "making links in $$i..." && \ |
f9b3bff6 | 492 | $(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}' KRB5_INCLUDES='${KRB5_INCLUDES}' LIBKRB5='${LIBKRB5}' links ) || exit 1; \ |
b436a982 | 493 | fi; \ |
d02b48c6 | 494 | done; |
d02b48c6 RE |
495 | |
496 | dclean: | |
bb8f3c58 | 497 | rm -f *.bak |
d02b48c6 RE |
498 | @for i in $(DIRS) ;\ |
499 | do \ | |
a22fb399 | 500 | if [ -d "$$i" ]; then \ |
b436a982 RL |
501 | (cd $$i && echo "making dclean in $$i..." && \ |
502 | $(MAKE) SDIRS='${SDIRS}' PERL='${PERL}' dclean ) || exit 1; \ | |
503 | fi; \ | |
d02b48c6 RE |
504 | done; |
505 | ||
e6e7b5f3 BM |
506 | rehash: rehash.time |
507 | rehash.time: certs | |
a7b42009 RL |
508 | @(OPENSSL="`pwd`/apps/openssl"; OPENSSL_DEBUG_MEMORY=on; \ |
509 | export OPENSSL OPENSSL_DEBUG_MEMORY; \ | |
510 | LD_LIBRARY_PATH="`pwd`"; SHLIB_PATH="`pwd`"; LIBPATH="`pwd`"; \ | |
511 | export LD_LIBRARY_PATH SHLIB_PATH LIBPATH; \ | |
512 | $(PERL) tools/c_rehash certs) | |
3ebf0be1 | 513 | touch rehash.time |
d02b48c6 | 514 | |
58964a49 | 515 | test: tests |
d02b48c6 | 516 | |
73bfb9ad | 517 | tests: rehash |
bb8f3c58 | 518 | @(cd test && echo "testing..." && \ |
967d95f0 | 519 | $(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}' PERL='${PERL}' TESTS='${TESTS}' KRB5_INCLUDES='${KRB5_INCLUDES}' LIBKRB5='${LIBKRB5}' EXE_EXT='${EXE_EXT}' OPENSSL_DEBUG_MEMORY=on tests ); |
a7b42009 RL |
520 | @LD_LIBRARY_PATH="`pwd`"; SHLIB_PATH="`pwd`"; LIBPATH="`pwd`"; \ |
521 | export LD_LIBRARY_PATH SHLIB_PATH LIBPATH; \ | |
522 | apps/openssl version -a | |
d02b48c6 | 523 | |
d7f0ab5f UM |
524 | report: |
525 | @$(PERL) util/selftest.pl | |
526 | ||
d02b48c6 RE |
527 | depend: |
528 | @for i in $(DIRS) ;\ | |
529 | do \ | |
a22fb399 | 530 | if [ -d "$$i" ]; then \ |
b436a982 | 531 | (cd $$i && echo "making dependencies $$i..." && \ |
2a1ef754 | 532 | $(MAKE) SDIRS='${SDIRS}' DEPFLAG='${DEPFLAG}' MAKEDEPPROG='${MAKEDEPPROG}' KRB5_INCLUDES='${KRB5_INCLUDES}' depend ) || exit 1; \ |
b436a982 | 533 | fi; \ |
d02b48c6 RE |
534 | done; |
535 | ||
536 | lint: | |
537 | @for i in $(DIRS) ;\ | |
538 | do \ | |
a22fb399 | 539 | if [ -d "$$i" ]; then \ |
b436a982 RL |
540 | (cd $$i && echo "making lint $$i..." && \ |
541 | $(MAKE) SDIRS='${SDIRS}' lint ) || exit 1; \ | |
542 | fi; \ | |
d02b48c6 RE |
543 | done; |
544 | ||
545 | tags: | |
546 | @for i in $(DIRS) ;\ | |
547 | do \ | |
a22fb399 | 548 | if [ -d "$$i" ]; then \ |
b436a982 RL |
549 | (cd $$i && echo "making tags $$i..." && \ |
550 | $(MAKE) SDIRS='${SDIRS}' tags ) || exit 1; \ | |
551 | fi; \ | |
d02b48c6 RE |
552 | done; |
553 | ||
554 | errors: | |
f6485909 | 555 | $(PERL) util/mkerr.pl -recurse -write |
d02b48c6 | 556 | |
e41c8d6a | 557 | stacks: |
f6485909 | 558 | $(PERL) util/mkstack.pl -write |
e41c8d6a | 559 | |
7740a1c6 | 560 | util/libeay.num:: |
f6485909 | 561 | $(PERL) util/mkdef.pl crypto update |
7740a1c6 BM |
562 | |
563 | util/ssleay.num:: | |
f6485909 | 564 | $(PERL) util/mkdef.pl ssl update |
7740a1c6 | 565 | |
1d00800e | 566 | crypto/objects/obj_dat.h: crypto/objects/obj_dat.pl crypto/objects/obj_mac.h |
f6485909 | 567 | $(PERL) crypto/objects/obj_dat.pl crypto/objects/obj_mac.h crypto/objects/obj_dat.h |
0357422d | 568 | crypto/objects/obj_mac.h: crypto/objects/objects.pl crypto/objects/objects.txt crypto/objects/obj_mac.num |
f6485909 | 569 | $(PERL) crypto/objects/objects.pl crypto/objects/objects.txt crypto/objects/obj_mac.num crypto/objects/obj_mac.h |
49e747e6 | 570 | |
62c419d6 | 571 | TABLE: Configure |
2330e18b | 572 | (echo 'Output of `Configure TABLE'"':"; \ |
f6485909 | 573 | $(PERL) Configure TABLE) > TABLE |
7740a1c6 | 574 | |
e41c8d6a | 575 | update: depend errors stacks util/libeay.num util/ssleay.num crypto/objects/obj_dat.h TABLE |
7740a1c6 | 576 | |
d02b48c6 | 577 | tar: |
2dbb3ccd | 578 | @$(TAR) $(TARFLAGS) -cvf - \ |
7740a1c6 | 579 | `find * \! -path CVS/\* \! -path \*/CVS/\* \! -name CVS \! -name .cvsignore \! -name STATUS \! -name TABLE | sort` |\ |
5a061129 | 580 | tardy --user_number=0 --user_name=openssl \ |
9ce5db45 RE |
581 | --group_number=0 --group_name=openssl \ |
582 | --prefix=openssl-$(VERSION) - |\ | |
651d0aff RE |
583 | gzip --best >../$(TARFILE).gz; \ |
584 | ls -l ../$(TARFILE).gz | |
d02b48c6 | 585 | |
41d2a336 RL |
586 | tar-snap: |
587 | @$(TAR) $(TARFLAGS) -cvf - \ | |
588 | `find * \! -path CVS/\* \! -path \*/CVS/\* \! -name CVS \! -name .cvsignore \! -name STATUS \! -name TABLE \! -name '*.o' \! -name '*.a' \! -name '*.so' \! -name '*.so.*' \! -name 'openssl' \! -name '*test' \! -name '.#*' | sort` |\ | |
589 | tardy --user_number=0 --user_name=openssl \ | |
590 | --group_number=0 --group_name=openssl \ | |
591 | --prefix=openssl-$(VERSION) - > ../$(TARFILE);\ | |
592 | ls -l ../$(TARFILE) | |
593 | ||
58964a49 | 594 | dist: |
99aab161 | 595 | $(PERL) Configure dist |
d02b48c6 RE |
596 | @$(MAKE) dist_pem_h |
597 | @$(MAKE) SDIRS='${SDIRS}' clean | |
d02b48c6 RE |
598 | @$(MAKE) tar |
599 | ||
600 | dist_pem_h: | |
7d7d2cbc | 601 | (cd crypto/pem; $(MAKE) CC='${CC}' SDIRS='${SDIRS}' CFLAG='${CFLAG}' pem.h; $(MAKE) clean) |
d02b48c6 | 602 | |
e6e7b5f3 | 603 | install: all install_docs |
f0588887 BM |
604 | @$(PERL) $(TOP)/util/mkdir-p.pl $(INSTALL_PREFIX)$(INSTALLTOP)/bin \ |
605 | $(INSTALL_PREFIX)$(INSTALLTOP)/lib \ | |
606 | $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl \ | |
607 | $(INSTALL_PREFIX)$(OPENSSLDIR)/misc \ | |
608 | $(INSTALL_PREFIX)$(OPENSSLDIR)/certs \ | |
609 | $(INSTALL_PREFIX)$(OPENSSLDIR)/private \ | |
e6e7b5f3 | 610 | $(INSTALL_PREFIX)$(OPENSSLDIR)/lib |
2a4a0a34 BM |
611 | @for i in $(EXHEADER) ;\ |
612 | do \ | |
613 | (cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \ | |
614 | chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \ | |
615 | done; | |
d02b48c6 RE |
616 | @for i in $(DIRS) ;\ |
617 | do \ | |
a22fb399 | 618 | if [ -d "$$i" ]; then \ |
b436a982 | 619 | (cd $$i; echo "installing $$i..."; \ |
967d95f0 | 620 | $(MAKE) CC='${CC}' CFLAG='${CFLAG}' INSTALL_PREFIX='${INSTALL_PREFIX}' INSTALLTOP='${INSTALLTOP}' OPENSSLDIR='${OPENSSLDIR}' EX_LIBS='${EX_LIBS}' SDIRS='${SDIRS}' RANLIB='${RANLIB}' EXE_EXT='${EXE_EXT}' install ); \ |
b436a982 | 621 | fi; \ |
d02b48c6 RE |
622 | done |
623 | @for i in $(LIBS) ;\ | |
624 | do \ | |
b436a982 RL |
625 | if [ -f "$$i" ]; then \ |
626 | ( echo installing $$i; \ | |
627 | cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/lib; \ | |
a22fb399 | 628 | $(RANLIB) $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i; \ |
b436a982 RL |
629 | chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i ); \ |
630 | fi \ | |
d02b48c6 | 631 | done |
a22fb399 RL |
632 | @if [ -n "$(SHARED_LIBS)" ]; then \ |
633 | tmp="$(SHARED_LIBS)"; \ | |
634 | for i in $${tmp:-x}; \ | |
635 | do \ | |
636 | if [ -f "$$i" ]; then \ | |
637 | ( echo installing $$i; \ | |
89c16ab5 LJ |
638 | cp -f $$i $(INSTALL_PREFIX)$(INSTALLTOP)/lib; \ |
639 | chmod 555 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i ); \ | |
a22fb399 RL |
640 | fi \ |
641 | done; \ | |
642 | ( here="`pwd`"; \ | |
643 | cd $(INSTALL_PREFIX)$(INSTALLTOP)/lib; \ | |
644 | make -f $$here/Makefile link-shared ); \ | |
645 | fi | |
e6e7b5f3 BM |
646 | |
647 | install_docs: | |
648 | @$(PERL) $(TOP)/util/mkdir-p.pl \ | |
e1c55191 UM |
649 | $(INSTALL_PREFIX)$(MANDIR)/man1 \ |
650 | $(INSTALL_PREFIX)$(MANDIR)/man3 \ | |
651 | $(INSTALL_PREFIX)$(MANDIR)/man5 \ | |
652 | $(INSTALL_PREFIX)$(MANDIR)/man7 | |
c6ce792f | 653 | @for i in doc/apps/*.pod; do \ |
c6ce792f | 654 | fn=`basename $$i .pod`; \ |
5f1fddbb | 655 | if [ "$$fn" = "config" ]; then sec=5; else sec=1; fi; \ |
2eaad87f | 656 | echo "installing man$$sec/`basename $$i .pod`.$$sec"; \ |
97025c5f | 657 | (cd `dirname $$i`; \ |
c6ce792f | 658 | $(PERL) ../../util/pod2man.pl --section=$$sec --center=OpenSSL \ |
97025c5f BM |
659 | --release=$(VERSION) `basename $$i`) \ |
660 | > $(INSTALL_PREFIX)$(MANDIR)/man$$sec/`basename $$i .pod`.$$sec; \ | |
c6ce792f | 661 | done |
c6ce792f | 662 | @for i in doc/crypto/*.pod doc/ssl/*.pod; do \ |
c6ce792f | 663 | fn=`basename $$i .pod`; \ |
5f1fddbb | 664 | if [ "$$fn" = "des_modes" ]; then sec=7; else sec=3; fi; \ |
2eaad87f | 665 | echo "installing man$$sec/`basename $$i .pod`.$$sec"; \ |
97025c5f | 666 | (cd `dirname $$i`; \ |
c6ce792f | 667 | $(PERL) ../../util/pod2man.pl --section=$$sec --center=OpenSSL \ |
97025c5f BM |
668 | --release=$(VERSION) `basename $$i`) \ |
669 | > $(INSTALL_PREFIX)$(MANDIR)/man$$sec/`basename $$i .pod`.$$sec; \ | |
c6ce792f | 670 | done |
d02b48c6 RE |
671 | |
672 | # DO NOT DELETE THIS LINE -- make depend depends on it. |