Merge from vendor branch DHCP:
[dragonfly.git] / crypto / openssl-0.9.7e / Makefile.org
1 ##
2 ## Makefile for OpenSSL
3 ##
4
5 VERSION=
6 MAJOR=
7 MINOR=
8 SHLIB_VERSION_NUMBER=
9 SHLIB_VERSION_HISTORY=
10 SHLIB_MAJOR=
11 SHLIB_MINOR=
12 SHLIB_EXT=
13 PLATFORM=dist
14 OPTIONS=
15 CONFIGURE_ARGS=
16 SHLIB_TARGET=
17
18 # HERE indicates where this Makefile lives.  This can be used to indicate
19 # where sub-Makefiles are expected to be.  Currently has very limited usage,
20 # and should probably not be bothered with at all.
21 HERE=.
22
23 # INSTALL_PREFIX is for package builders so that they can configure
24 # for, say, /usr/ and yet have everything installed to /tmp/somedir/usr/.
25 # Normally it is left empty.
26 INSTALL_PREFIX=
27 INSTALLTOP=/usr/local/ssl
28
29 # Do not edit this manually. Use Configure --openssldir=DIR do change this!
30 OPENSSLDIR=/usr/local/ssl
31
32 # NO_IDEA - Define to build without the IDEA algorithm
33 # NO_RC4  - Define to build without the RC4 algorithm
34 # NO_RC2  - Define to build without the RC2 algorithm
35 # THREADS - Define when building with threads, you will probably also need any
36 #           system defines as well, i.e. _REENTERANT for Solaris 2.[34]
37 # TERMIO  - Define the termio terminal subsystem, needed if sgtty is missing.
38 # TERMIOS - Define the termios terminal subsystem, Silicon Graphics.
39 # LONGCRYPT - Define to use HPUX 10.x's long password modification to crypt(3).
40 # DEVRANDOM - Give this the value of the 'random device' if your OS supports
41 #           one.  32 bytes will be read from this when the random
42 #           number generator is initalised.
43 # SSL_FORBID_ENULL - define if you want the server to be not able to use the
44 #           NULL encryption ciphers.
45 #
46 # LOCK_DEBUG - turns on lots of lock debug output :-)
47 # REF_CHECK - turn on some xyz_free() assertions.
48 # REF_PRINT - prints some stuff on structure free.
49 # CRYPTO_MDEBUG - turns on my 'memory leak' detecting stuff
50 # MFUNC - Make all Malloc/Free/Realloc calls call
51 #       CRYPTO_malloc/CRYPTO_free/CRYPTO_realloc which can be setup to
52 #       call application defined callbacks via CRYPTO_set_mem_functions()
53 # MD5_ASM needs to be defined to use the x86 assembler for MD5
54 # SHA1_ASM needs to be defined to use the x86 assembler for SHA1
55 # RMD160_ASM needs to be defined to use the x86 assembler for RIPEMD160
56 # Do not define B_ENDIAN or L_ENDIAN if 'unsigned long' == 8.  It must
57 # equal 4.
58 # PKCS1_CHECK - pkcs1 tests.
59
60 CC= gcc
61 #CFLAG= -DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -m486 -Wall -Wuninitialized -DSHA1_ASM -DMD5_ASM -DRMD160_ASM
62 CFLAG= -DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O3 -m486 -Wall -DSHA1_ASM -DMD5_ASM -DRMD160_ASM
63 DEPFLAG= 
64 PEX_LIBS= 
65 EX_LIBS= 
66 EXE_EXT= 
67 ARFLAGS=
68 AR=ar $(ARFLAGS) r
69 RANLIB= ranlib
70 PERL= perl
71 TAR= tar
72 TARFLAGS= --no-recursion
73 MAKEDEPPROG=makedepend
74
75 # We let the C compiler driver to take care of .s files. This is done in
76 # order to be excused from maintaining a separate set of architecture
77 # dependent assembler flags. E.g. if you throw -mcpu=ultrasparc at SPARC
78 # gcc, then the driver will automatically translate it to -xarch=v8plus
79 # and pass it down to assembler.
80 AS=$(CC) -c
81 ASFLAG=$(CFLAG)
82
83 # Set BN_ASM to bn_asm.o if you want to use the C version
84 BN_ASM= bn_asm.o
85 #BN_ASM= bn_asm.o
86 #BN_ASM= asm/bn86-elf.o # elf, linux-elf
87 #BN_ASM= asm/bn86-sol.o # solaris
88 #BN_ASM= asm/bn86-out.o # a.out, FreeBSD
89 #BN_ASM= asm/bn86bsdi.o # bsdi
90 #BN_ASM= asm/alpha.o    # DEC Alpha
91 #BN_ASM= asm/pa-risc2.o # HP-UX PA-RISC
92 #BN_ASM= asm/r3000.o    # SGI MIPS cpu
93 #BN_ASM= asm/sparc.o    # Sun solaris/SunOS
94 #BN_ASM= asm/bn-win32.o # Windows 95/NT
95 #BN_ASM= asm/x86w16.o   # 16 bit code for Windows 3.1/DOS
96 #BN_ASM= asm/x86w32.o   # 32 bit code for Windows 3.1
97
98 # For x86 assembler: Set PROCESSOR to 386 if you want to support
99 # the 80386.
100 PROCESSOR=
101
102 # Set DES_ENC to des_enc.o if you want to use the C version
103 #There are 4 x86 assember options.
104 FIPS_DES_ENC= des_enc.o fcrypt_b.o
105 DES_ENC= asm/dx86-out.o asm/yx86-out.o
106 #DES_ENC= des_enc.o fcrypt_b.o          # C
107 #DES_ENC= asm/dx86-elf.o asm/yx86-elf.o # elf
108 #DES_ENC= asm/dx86-sol.o asm/yx86-sol.o # solaris
109 #DES_ENC= asm/dx86-out.o asm/yx86-out.o # a.out, FreeBSD
110 #DES_ENC= asm/dx86bsdi.o asm/yx86bsdi.o # bsdi
111
112 # Set BF_ENC to bf_enc.o if you want to use the C version
113 #There are 4 x86 assember options.
114 BF_ENC= asm/bx86-out.o
115 #BF_ENC= bf_enc.o
116 #BF_ENC= asm/bx86-elf.o # elf
117 #BF_ENC= asm/bx86-sol.o # solaris
118 #BF_ENC= asm/bx86-out.o # a.out, FreeBSD
119 #BF_ENC= asm/bx86bsdi.o # bsdi
120
121 # Set CAST_ENC to c_enc.o if you want to use the C version
122 #There are 4 x86 assember options.
123 CAST_ENC= asm/cx86-out.o
124 #CAST_ENC= c_enc.o
125 #CAST_ENC= asm/cx86-elf.o # elf
126 #CAST_ENC= asm/cx86-sol.o # solaris
127 #CAST_ENC= asm/cx86-out.o # a.out, FreeBSD
128 #CAST_ENC= asm/cx86bsdi.o # bsdi
129
130 # Set RC4_ENC to rc4_enc.o if you want to use the C version
131 #There are 4 x86 assember options.
132 RC4_ENC= asm/rx86-out.o
133 #RC4_ENC= rc4_enc.o
134 #RC4_ENC= asm/rx86-elf.o # elf
135 #RC4_ENC= asm/rx86-sol.o # solaris
136 #RC4_ENC= asm/rx86-out.o # a.out, FreeBSD
137 #RC4_ENC= asm/rx86bsdi.o # bsdi
138
139 # Set RC5_ENC to rc5_enc.o if you want to use the C version
140 #There are 4 x86 assember options.
141 RC5_ENC= asm/r586-out.o
142 #RC5_ENC= rc5_enc.o
143 #RC5_ENC= asm/r586-elf.o # elf
144 #RC5_ENC= asm/r586-sol.o # solaris
145 #RC5_ENC= asm/r586-out.o # a.out, FreeBSD
146 #RC5_ENC= asm/r586bsdi.o # bsdi
147
148 # Also need MD5_ASM defined
149 MD5_ASM_OBJ= asm/mx86-out.o
150 #MD5_ASM_OBJ= asm/mx86-elf.o        # elf
151 #MD5_ASM_OBJ= asm/mx86-sol.o        # solaris
152 #MD5_ASM_OBJ= asm/mx86-out.o        # a.out, FreeBSD
153 #MD5_ASM_OBJ= asm/mx86bsdi.o        # bsdi
154
155 # Also need SHA1_ASM defined
156 SHA1_ASM_OBJ= asm/sx86-out.o
157 FIPS_SHA1_ASM_OBJ= asm/sx86-out.o
158 #SHA1_ASM_OBJ= asm/sx86-elf.o       # elf
159 #SHA1_ASM_OBJ= asm/sx86-sol.o       # solaris
160 #SHA1_ASM_OBJ= asm/sx86-out.o       # a.out, FreeBSD
161 #SHA1_ASM_OBJ= asm/sx86bsdi.o       # bsdi
162
163 # Also need RMD160_ASM defined
164 RMD160_ASM_OBJ= asm/rm86-out.o
165 #RMD160_ASM_OBJ= asm/rm86-elf.o       # elf
166 #RMD160_ASM_OBJ= asm/rm86-sol.o       # solaris
167 #RMD160_ASM_OBJ= asm/rm86-out.o       # a.out, FreeBSD
168 #RMD160_ASM_OBJ= asm/rm86bsdi.o       # bsdi
169
170 # KRB5 stuff
171 KRB5_INCLUDES=
172 LIBKRB5=
173
174 # When we're prepared to use shared libraries in the programs we link here
175 # we might set SHLIB_MARK to '$(SHARED_LIBS)'.
176 SHLIB_MARK=
177
178 DIRS=   crypto fips ssl $(SHLIB_MARK) sigs apps test tools
179 SHLIBDIRS= fips crypto ssl
180
181 # dirs in crypto to build
182 SDIRS=  objects \
183         md2 md4 md5 sha mdc2 hmac ripemd \
184         des rc2 rc4 rc5 idea bf cast \
185         bn ec rsa dsa dh dso engine aes \
186         buffer bio stack lhash rand err \
187         evp asn1 pem x509 x509v3 conf txt_db pkcs7 pkcs12 comp ocsp ui krb5
188
189 FDIRS=  sha1 rand des aes dsa rsa dh
190
191 # tests to perform.  "alltests" is a special word indicating that all tests
192 # should be performed.
193 TESTS = alltests
194
195 MAKEFILE= Makefile
196
197 MANDIR=$(OPENSSLDIR)/man
198 MAN1=1
199 MAN3=3
200 MANSUFFIX=
201 SHELL=/bin/sh
202
203 TOP=    .
204 ONEDIRS=out tmp
205 EDIRS=  times doc bugs util include certs ms shlib mt demos perl sf dep VMS
206 WDIRS=  windows
207 LIBS=   libcrypto.a libssl.a
208 SIGS=   libcrypto.a.sha1
209 SHARED_CRYPTO=libcrypto$(SHLIB_EXT)
210 SHARED_SSL=libssl$(SHLIB_EXT)
211 SHARED_LIBS=
212 SHARED_LIBS_LINK_EXTS=
213 SHARED_LDFLAGS=
214
215 GENERAL=        Makefile
216 BASENAME=       openssl
217 NAME=           $(BASENAME)-$(VERSION)
218 TARFILE=        $(NAME).tar
219 WTARFILE=       $(NAME)-win.tar
220 EXHEADER=       e_os2.h
221 HEADER=         e_os.h
222
223 # When we're prepared to use shared libraries in the programs we link here
224 # we might remove 'clean-shared' from the targets to perform at this stage
225
226 all: Makefile sub_all openssl.pc
227
228 sigs:   $(SIGS)
229 libcrypto.a.sha1: libcrypto.a
230         if egrep 'define OPENSSL_FIPS' $(TOP)/include/openssl/opensslconf.h > /dev/null; then \
231                 $(RANLIB) libcrypto.a; \
232                 fips/sha1/fips_standalone_sha1 libcrypto.a > libcrypto.a.sha1; \
233         fi
234
235 sub_all:
236         @for i in $(DIRS); \
237         do \
238         if [ -d "$$i" ]; then \
239                 (cd $$i && echo "making all in $$i..." && \
240                 $(MAKE) CC='${CC}' PLATFORM='${PLATFORM}' CFLAG='${CFLAG}' AS='${AS}' ASFLAG='${ASFLAG}' SDIRS='$(SDIRS)' FDIRS='$(FDIRS)' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' BN_ASM='${BN_ASM}' DES_ENC='${DES_ENC}' FIPS_DES_ENC='${FIPS_DES_ENC}' BF_ENC='${BF_ENC}' CAST_ENC='${CAST_ENC}' RC4_ENC='${RC4_ENC}' RC5_ENC='${RC5_ENC}' SHA1_ASM_OBJ='${SHA1_ASM_OBJ}' FIPS_SHA1_ASM_OBJ='${FIPS_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}' SHLIB_TARGET='${SHLIB_TARGET}' all ) || exit 1; \
241         else \
242                 $(MAKE) $$i; \
243         fi; \
244         done;
245
246 sub_target:
247         @for i in $(DIRS); \
248         do \
249         if [ -d "$$i" ]; then \
250                 (cd $$i && echo "making $(TARGET) in $$i..." && \
251                 $(MAKE) CC='${CC}' PLATFORM='${PLATFORM}' CFLAG='${CFLAG}' AS='${AS}' ASFLAG='${ASFLAG}' SDIRS='$(SDIRS)' FDIRS='$(FDIRS)' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' BN_ASM='${BN_ASM}' DES_ENC='${DES_ENC}' FIPS_DES_ENC='${FIPS_DES_ENC}' BF_ENC='${BF_ENC}' CAST_ENC='${CAST_ENC}' RC4_ENC='${RC4_ENC}' RC5_ENC='${RC5_ENC}' SHA1_ASM_OBJ='${SHA1_ASM_OBJ}' FIPS_SHA1_ASM_OBJ='${FIPS_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}' SHLIB_TARGET='${SHLIB_TARGET}' TARGET='$(TARGET)' sub_target ) || exit 1; \
252         else \
253                 $(MAKE) $$i; \
254         fi; \
255         done;
256
257 libcrypto$(SHLIB_EXT): libcrypto.a
258         @if [ "$(SHLIB_TARGET)" != "" ]; then \
259                 $(MAKE) SHLIBDIRS=crypto build-shared; \
260         else \
261                 echo "There's no support for shared libraries on this platform" >&2; \
262         fi
263
264 libssl$(SHLIB_EXT): libcrypto$(SHLIB_EXT) libssl.a
265         @if [ "$(SHLIB_TARGET)" != "" ]; then \
266                 $(MAKE) SHLIBDIRS=ssl SHLIBDEPS='-lcrypto' build-shared; \
267         else \
268                 echo "There's no support for shared libraries on this platform" >&2; \
269         fi
270
271 clean-shared:
272         @for i in $(SHLIBDIRS); do \
273                 if [ -n "$(SHARED_LIBS_LINK_EXTS)" ]; then \
274                         tmp="$(SHARED_LIBS_LINK_EXTS)"; \
275                         for j in $${tmp:-x}; do \
276                                 ( set -x; rm -f lib$$i$$j ); \
277                         done; \
278                 fi; \
279                 ( set -x; rm -f lib$$i$(SHLIB_EXT) ); \
280                 if [ "$(PLATFORM)" = "Cygwin" ]; then \
281                         ( set -x; rm -f cyg$$i-$(SHLIB_VERSION_NUMBER)$(SHLIB_EXT) lib$$i$(SHLIB_EXT).a ); \
282                 fi; \
283         done
284
285 link-shared:
286         @if [ -n "$(SHARED_LIBS_LINK_EXTS)" ]; then \
287                 tmp="$(SHARED_LIBS_LINK_EXTS)"; \
288                 for i in $(SHLIBDIRS); do \
289                         prev=lib$$i$(SHLIB_EXT); \
290                         for j in $${tmp:-x}; do \
291                                 ( set -x; \
292                                 rm -f lib$$i$$j; ln -s $$prev lib$$i$$j ); \
293                                 prev=lib$$i$$j; \
294                         done; \
295                 done; \
296         fi
297
298 build-shared: clean-shared do_$(SHLIB_TARGET) link-shared
299
300 do_bsd-gcc-shared: do_gnu-shared
301 do_linux-shared: do_gnu-shared
302 do_gnu-shared:
303         libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
304         if [ "${SHLIBDIRS}" = "ssl" -a -n "$(LIBKRB5)" ]; then \
305                 libs="$(LIBKRB5) $$libs"; \
306         fi; \
307         ( set -x; ${CC} ${SHARED_LDFLAGS} \
308                 -shared -o lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
309                 -Wl,-soname=lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
310                 -Wl,-Bsymbolic \
311                 -Wl,--whole-archive lib$$i.a \
312                 -Wl,--no-whole-archive $$libs ${EX_LIBS} -lc ) || exit 1; \
313         libs="-l$$i $$libs"; \
314         done
315
316 DETECT_GNU_LD=(${CC} -Wl,-V /dev/null 2>&1 | grep '^GNU ld' )>/dev/null
317
318 # For Darwin AKA Mac OS/X (dyld)
319 do_darwin-shared: 
320         libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
321         if [ "${SHLIBDIRS}" = "ssl" -a -n "$(LIBKRB5)" ]; then \
322                 libs="$(LIBKRB5) $$libs"; \
323         fi; \
324         ( set -x; ${CC} --verbose -dynamiclib -o lib$$i${SHLIB_EXT} \
325                 lib$$i.a $$libs -all_load -current_version ${SHLIB_MAJOR}.${SHLIB_MINOR} \
326                 -compatibility_version ${SHLIB_MAJOR}.`echo ${SHLIB_MINOR} | cut -d. -f1` \
327                 -install_name ${INSTALLTOP}/lib/lib$$i${SHLIB_EXT} ) || exit 1; \
328         libs="-l`basename $$i${SHLIB_EXT} .dylib` $$libs"; \
329         echo "" ; \
330         done
331
332 do_cygwin-shared:
333         libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
334         if [ "${SHLIBDIRS}" = "ssl" -a -n "$(LIBKRB5)" ]; then \
335                 libs="$(LIBKRB5) $$libs"; \
336         fi; \
337         ( set -x; ${CC}  -shared -o cyg$$i-$(SHLIB_VERSION_NUMBER).dll \
338                 -Wl,-Bsymbolic \
339                 -Wl,--whole-archive lib$$i.a \
340                 -Wl,--out-implib,lib$$i.dll.a \
341                 -Wl,--no-whole-archive $$libs ) || exit 1; \
342         libs="-l$$i $$libs"; \
343         done
344
345 # This assumes that GNU utilities are *not* used
346 do_alpha-osf1-shared:
347         if ${DETECT_GNU_LD}; then \
348                 $(MAKE) do_gnu-shared; \
349         else \
350                 libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
351                 if [ "${SHLIBDIRS}" = "ssl" -a -n "$(LIBKRB5)" ]; then \
352                         libs="$(LIBKRB5) $$libs"; \
353                 fi; \
354                 ( set -x; ${CC} ${SHARED_LDFLAGS} \
355                         -shared -o lib$$i.so \
356                         -set_version "${SHLIB_VERSION_HISTORY}${SHLIB_VERSION_NUMBER}" \
357                         -all lib$$i.a -none $$libs ${EX_LIBS} -lc ) || exit 1; \
358                 libs="-l$$i $$libs"; \
359                 done; \
360         fi
361
362 # This assumes that GNU utilities are *not* used
363 # The difference between alpha-osf1-shared and tru64-shared is the `-msym'
364 # option passed to the linker.
365 do_tru64-shared:
366         if ${DETECT_GNU_LD}; then \
367                 $(MAKE) do_gnu-shared; \
368         else \
369                 libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
370                 if [ "${SHLIBDIRS}" = "ssl" -a -n "$(LIBKRB5)" ]; then \
371                         libs="$(LIBKRB5) $$libs"; \
372                 fi; \
373                 ( set -x; ${CC} ${SHARED_LDFLAGS} \
374                         -shared -msym -o lib$$i.so \
375                         -set_version "${SHLIB_VERSION_HISTORY}${SHLIB_VERSION_NUMBER}" \
376                         -all lib$$i.a -none $$libs ${EX_LIBS} -lc ) || exit 1; \
377                 libs="-l$$i $$libs"; \
378                 done; \
379         fi
380
381 # This assumes that GNU utilities are *not* used
382 # The difference between tru64-shared and tru64-shared-rpath is the
383 # -rpath ${INSTALLTOP}/lib passed to the linker.
384 do_tru64-shared-rpath:
385         if ${DETECT_GNU_LD}; then \
386                 $(MAKE) do_gnu-shared; \
387         else \
388                 libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
389                 if [ "${SHLIBDIRS}" = "ssl" -a -n "$(LIBKRB5)" ]; then \
390                         libs="$(LIBKRB5) $$libs"; \
391                 fi; \
392                 ( set -x; ${CC} ${SHARED_LDFLAGS} \
393                         -shared -msym -o lib$$i.so \
394                         -rpath  ${INSTALLTOP}/lib \
395                         -set_version "${SHLIB_VERSION_HISTORY}${SHLIB_VERSION_NUMBER}" \
396                         -all lib$$i.a -none $$libs ${EX_LIBS} -lc ) || exit 1; \
397                 libs="-l$$i $$libs"; \
398                 done; \
399         fi
400
401
402 # This assumes that GNU utilities are *not* used
403 do_solaris-shared:
404         if ${DETECT_GNU_LD}; then \
405                 $(MAKE) do_gnu-shared; \
406         else \
407                 libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
408                 if [ "${SHLIBDIRS}" = "ssl" -a -n "$(LIBKRB5)" ]; then \
409                         libs="$(LIBKRB5) $$libs"; \
410                 fi; \
411                 ( PATH=/usr/ccs/bin:$$PATH ; export PATH; \
412                   MINUSZ='-z '; \
413                   (${CC} -v 2>&1 | grep gcc) > /dev/null && MINUSZ='-Wl,-z,'; \
414                   set -x; ${CC} ${SHARED_LDFLAGS} -G -dy -z text \
415                         -o lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
416                         -h lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
417                         -Wl,-Bsymbolic \
418                         $${MINUSZ}allextract lib$$i.a $${MINUSZ}defaultextract \
419                         $$libs ${EX_LIBS} -lc ) || exit 1; \
420                 libs="-l$$i $$libs"; \
421                 done; \
422         fi
423
424 # OpenServer 5 native compilers used
425 do_svr3-shared:
426         if ${DETECT_GNU_LD}; then \
427                 $(MAKE) do_gnu-shared; \
428         else \
429                 libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
430                 if [ "${SHLIBDIRS}" = "ssl" -a -n "$(LIBKRB5)" ]; then \
431                         libs="$(LIBKRB5) $$libs"; \
432                 fi; \
433                 ( PATH=/usr/ccs/bin:$$PATH ; export PATH; \
434                   find . -name "*.o" -print > allobjs ; \
435                   OBJS= ; export OBJS ; \
436                   for obj in `ar t lib$$i.a` ; do \
437                     OBJS="$${OBJS} `grep /$$obj allobjs`" ; \
438                   done ; \
439                   set -x; ${CC} ${SHARED_LDFLAGS} \
440                         -G -o lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
441                         -h lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
442                         $${OBJS} $$libs ${EX_LIBS} ) || exit 1; \
443                 libs="-l$$i $$libs"; \
444                 done; \
445         fi
446
447 # UnixWare 7 and OpenUNIX 8 native compilers used
448 do_svr5-shared:
449         if ${DETECT_GNU_LD}; then \
450                 $(MAKE) do_gnu-shared; \
451         else \
452                 libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
453                 if [ "${SHLIBDIRS}" = "ssl" -a -n "$(LIBKRB5)" ]; then \
454                         libs="$(LIBKRB5) $$libs"; \
455                 fi; \
456                 ( PATH=/usr/ccs/bin:$$PATH ; export PATH; \
457                   SHARE_FLAG='-G'; \
458                   (${CC} -v 2>&1 | grep gcc) > /dev/null && SHARE_FLAG='-shared'; \
459                   find . -name "*.o" -print > allobjs ; \
460                   OBJS= ; export OBJS ; \
461                   for obj in `ar t lib$$i.a` ; do \
462                     OBJS="$${OBJS} `grep /$$obj allobjs`" ; \
463                   done ; \
464                   set -x; LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH \
465                         ${CC} ${SHARED_LDFLAGS} \
466                         $${SHARE_FLAG} -o lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
467                         -h lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
468                         $${OBJS} $$libs ${EX_LIBS} ) || exit 1; \
469                 libs="-l$$i $$libs"; \
470                 done; \
471         fi
472
473 # This assumes that GNU utilities are *not* used
474 do_irix-shared:
475         if ${DETECT_GNU_LD}; then \
476                 $(MAKE) do_gnu-shared; \
477         else \
478                 libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
479                 if [ "${SHLIBDIRS}" = "ssl" -a -n "$(LIBKRB5)" ]; then \
480                         libs="$(LIBKRB5) $$libs"; \
481                 fi; \
482                 ( WHOLELIB="-all lib$$i.a -notall"; \
483                   (${CC} -v 2>&1 | grep gcc) > /dev/null && WHOLELIB="-Wl,-all,lib$$i.a,-notall"; \
484                   set -x; ${CC} ${SHARED_LDFLAGS} \
485                         -shared -o lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
486                         -Wl,-soname,lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} \
487                         $${WHOLELIB} $$libs ${EX_LIBS} -lc) || exit 1; \
488                 libs="-l$$i $$libs"; \
489                 done; \
490         fi
491
492 # This assumes that GNU utilities are *not* used
493 # HP-UX includes the full pathname of libs we depend on, so we would get
494 # ./libcrypto (with ./ as path information) compiled into libssl, hence
495 # we omit the SHLIBDEPS. Applications must be linked with -lssl -lcrypto
496 # anyway.
497 # The object modules are loaded from lib$i.a using the undocumented -Fl
498 # option.
499 #
500 # WARNING: Until DSO is fixed to support a search path, we support SHLIB_PATH
501 #          by temporarily specifying "+s"!
502 #
503 do_hpux-shared:
504         for i in ${SHLIBDIRS}; do \
505         if [ "${SHLIBDIRS}" = "ssl" -a -n "$(LIBKRB5)" ]; then \
506                 libs="$(LIBKRB5) $$libs"; \
507         fi; \
508         ( set -x; /usr/ccs/bin/ld ${SHARED_LDFLAGS} \
509                 +vnocompatwarnings \
510                 -b -z +s \
511                 -o lib$$i.sl.${SHLIB_MAJOR}.${SHLIB_MINOR} \
512                 +h lib$$i.sl.${SHLIB_MAJOR}.${SHLIB_MINOR} \
513                 -Fl lib$$i.a -ldld -lc ) || exit 1; \
514         chmod a=rx lib$$i.sl.${SHLIB_MAJOR}.${SHLIB_MINOR}; \
515         done
516
517 # This assumes that GNU utilities are *not* used
518 # HP-UX includes the full pathname of libs we depend on, so we would get
519 # ./libcrypto (with ./ as path information) compiled into libssl, hence
520 # we omit the SHLIBDEPS. Applications must be linked with -lssl -lcrypto
521 # anyway.
522 #
523 # HP-UX in 64bit mode has "+s" enabled by default; it will search for
524 # shared libraries along LD_LIBRARY_PATH _and_ SHLIB_PATH.
525 #
526 do_hpux64-shared:
527         for i in ${SHLIBDIRS}; do \
528         if [ "${SHLIBDIRS}" = "ssl" -a -n "$(LIBKRB5)" ]; then \
529                 libs="$(LIBKRB5) $$libs"; \
530         fi; \
531         ( set -x; /usr/ccs/bin/ld ${SHARED_LDFLAGS} \
532                 -b -z \
533                 -o lib$$i.sl.${SHLIB_MAJOR}.${SHLIB_MINOR} \
534                 +h lib$$i.sl.${SHLIB_MAJOR}.${SHLIB_MINOR} \
535                 +forceload lib$$i.a -ldl -lc ) || exit 1; \
536         chmod a=rx lib$$i.sl.${SHLIB_MAJOR}.${SHLIB_MINOR}; \
537         done
538
539 # The following method is said to work on all platforms.  Tests will
540 # determine if that's how it's gong to be used.
541 # This assumes that for all but GNU systems, GNU utilities are *not* used.
542 # ALLSYMSFLAGS would be:
543 #  GNU systems: --whole-archive
544 #  Tru64 Unix:  -all
545 #  Solaris:     -z allextract
546 #  Irix:        -all
547 #  HP/UX-32bit: -Fl
548 #  HP/UX-64bit: +forceload
549 #  AIX:         -bnogc
550 # SHAREDFLAGS would be:
551 #  GNU systems: -shared -Wl,-soname=lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR}
552 #  Tru64 Unix:  -shared \
553 #               -set_version "${SHLIB_VERSION_HISTORY}${SHLIB_VERSION_NUMBER}"
554 #  Solaris:     -G -h lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR}
555 #  Irix:        -shared -Wl,-soname,lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR}
556 #  HP/UX-32bit: +vnocompatwarnings -b -z +s \
557 #               +h lib$$i.sl.${SHLIB_MAJOR}.${SHLIB_MINOR}
558 #  HP/UX-64bit: -b -z +h lib$$i.sl.${SHLIB_MAJOR}.${SHLIB_MINOR}
559 #  AIX:         -G -bE:lib$$i.exp -bM:SRE
560 # SHAREDCMD would be:
561 #  GNU systems: $(CC)
562 #  Tru64 Unix:  $(CC)
563 #  Solaris:     $(CC)
564 #  Irix:        $(CC)
565 #  HP/UX-32bit: /usr/ccs/bin/ld
566 #  HP/UX-64bit: /usr/ccs/bin/ld
567 #  AIX:         $(CC)
568 ALLSYMSFLAG=-bnogc
569 SHAREDFLAGS=${SHARED_LDFLAGS} -G -bE:lib$$i.exp -bM:SRE
570 SHAREDCMD=$(CC)
571 do_aix-shared:
572         libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
573         if [ "${SHLIBDIRS}" = "ssl" -a -n "$(LIBKRB5)" ]; then \
574                 libs="$(LIBKRB5) $$libs"; \
575         fi; \
576         ( set -x; \
577           ld -r -o lib$$i.o $(ALLSYMSFLAG) lib$$i.a && \
578           ( nm -Pg lib$$i.o | grep ' [BD] ' | cut -f1 -d' ' > lib$$i.exp; \
579             $(SHAREDCMD) $(SHAREDFLAGS) \
580                 -o lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} lib$$i.o \
581                 $$libs ${EX_LIBS} ) ) \
582         || exit 1; \
583         libs="-l$$i $$libs"; \
584         done
585
586 do_reliantunix-shared:
587         libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
588         if [ "${SHLIBDIRS}" = "ssl" -a -n "$(LIBKRB5)" ]; then \
589                 libs="$(LIBKRB5) $$libs"; \
590         fi; \
591         tmpdir=/tmp/openssl.$$$$ ; rm -rf $$tmpdir ; \
592         ( set -x; \
593           ( Opwd=`pwd` ; mkdir $$tmpdir || exit 1; \
594             cd $$tmpdir || exit 1 ; ar x $$Opwd/lib$$i.a ; \
595             ${CC} -G -o lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} *.o \
596           ) || exit 1; \
597           cp $$tmpdir/lib$$i.so.${SHLIB_MAJOR}.${SHLIB_MINOR} . ; \
598         ) || exit 1; \
599         rm -rf $$tmpdir ; \
600         libs="-l$$i $$libs"; \
601         done
602
603 openssl.pc: Makefile
604         @ ( echo 'prefix=$(INSTALLTOP)'; \
605             echo 'exec_prefix=$${prefix}'; \
606             echo 'libdir=$${exec_prefix}/lib'; \
607             echo 'includedir=$${prefix}/include'; \
608             echo ''; \
609             echo 'Name: OpenSSL'; \
610             echo 'Description: Secure Sockets Layer and cryptography libraries and tools'; \
611             echo 'Version: '$(VERSION); \
612             echo 'Requires: '; \
613             echo 'Libs: -L$${libdir} -lssl -lcrypto $(LIBKRB5) $(EX_LIBS)'; \
614             echo 'Cflags: -I$${includedir} $(KRB5_INCLUDES)' ) > openssl.pc
615
616 Makefile: Makefile.org
617         @echo "Makefile is older than Makefile.org."
618         @echo "Reconfigure the source tree (via './config' or 'perl Configure'), please."
619         @false
620
621 libclean:
622         rm -f *.map *.so *.so.* engines/*.so *.a */lib */*/lib
623
624 clean:  libclean
625         rm -f shlib/*.o *.o core a.out fluff rehash.time testlog make.log cctest cctest.c
626         @for i in $(DIRS) ;\
627         do \
628         if [ -d "$$i" ]; then \
629                 (cd $$i && echo "making clean in $$i..." && \
630                 $(MAKE) SDIRS='${SDIRS}' clean ) || exit 1; \
631                 rm -f $(LIBS); \
632         fi; \
633         done;
634         rm -f openssl.pc
635         rm -f speed.* .pure
636         rm -f $(TARFILE)
637         @for i in $(ONEDIRS) ;\
638         do \
639         rm -fr $$i/*; \
640         done
641
642 makefile.one: files
643         $(PERL) util/mk1mf.pl >makefile.one; \
644         sh util/do_ms.sh
645
646 files:
647         $(PERL) $(TOP)/util/files.pl Makefile > $(TOP)/MINFO
648         @for i in $(DIRS) ;\
649         do \
650         if [ -d "$$i" ]; then \
651                 (cd $$i && echo "making 'files' in $$i..." && \
652                 $(MAKE) SDIRS='${SDIRS}' PERL='${PERL}' files ) || exit 1; \
653         fi; \
654         done;
655
656 links:
657         @$(PERL) $(TOP)/util/mkdir-p.pl include/openssl
658         @$(PERL) $(TOP)/util/mklink.pl include/openssl $(EXHEADER)
659         @for i in $(DIRS); do \
660         if [ -d "$$i" ]; then \
661                 (cd $$i && echo "making links in $$i..." && \
662                 $(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}' FIPS_DES_ENC='${FIPS_DES_ENC}' BF_ENC='${BF_ENC}' CAST_ENC='${CAST_ENC}' RC4_ENC='${RC4_ENC}' RC5_ENC='${RC5_ENC}' SHA1_ASM_OBJ='${SHA1_ASM_OBJ}' FIPS_SHA1_ASM_OBJ='${FIPS_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; \
663         fi; \
664         done;
665
666 gentests:
667         @(cd test && echo "generating dummy tests (if needed)..." && \
668         $(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}' FIPS_DES_ENC='${FIPS_DES_ENC}' BF_ENC='${BF_ENC}' CAST_ENC='${CAST_ENC}' RC4_ENC='${RC4_ENC}' RC5_ENC='${RC5_ENC}' SHA1_ASM_OBJ='${SHA1_ASM_OBJ}' FIPS_SHA1_ASM_OBJ='${FIPS_SHA1_ASM_OBJ}' MD5_ASM_OBJ='${MD5_ASM_OBJ}' RMD160_ASM_OBJ='${RMD160_ASM_OBJ}' AR='${AR}' PROCESSOR='${PROCESSOR}' PERL='${PERL}' RANLIB='${RANLIB}' TESTS='${TESTS}' KRB5_INCLUDES='${KRB5_INCLUDES}' LIBKRB5='${LIBKRB5}' EXE_EXT='${EXE_EXT}' SHARED_LIBS='${SHARED_LIBS}' SHLIB_EXT='${SHLIB_EXT}' SHLIB_TARGET='${SHLIB_TARGET}' TESTS='${TESTS}' OPENSSL_DEBUG_MEMORY=on generate );
669
670 dclean:
671         rm -f *.bak
672         @for i in $(DIRS) ;\
673         do \
674         if [ -d "$$i" ]; then \
675                 (cd $$i && echo "making dclean in $$i..." && \
676                 $(MAKE) SDIRS='${SDIRS}' PERL='${PERL}' dclean ) || exit 1; \
677         fi; \
678         done;
679
680 rehash: rehash.time
681 rehash.time: certs
682         @(OPENSSL="`pwd`/apps/openssl$(EXE_EXT)"; OPENSSL_DEBUG_MEMORY=on; \
683                 export OPENSSL OPENSSL_DEBUG_MEMORY; \
684                 LD_LIBRARY_PATH="`pwd`:$$LD_LIBRARY_PATH"; \
685                 DYLD_LIBRARY_PATH="`pwd`:$$DYLD_LIBRARY_PATH"; \
686                 SHLIB_PATH="`pwd`:$$SHLIB_PATH"; \
687                 LIBPATH="`pwd`:$$LIBPATH"; \
688                 if [ "$(PLATFORM)" = "Cygwin" ]; then PATH="`pwd`:$$PATH"; fi; \
689                 export LD_LIBRARY_PATH DYLD_LIBRARY_PATH SHLIB_PATH LIBPATH PATH; \
690                 $(PERL) tools/c_rehash certs)
691         touch rehash.time
692
693 test:   tests
694
695 tests: rehash
696         @(cd test && echo "testing..." && \
697         $(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}' FIPS_DES_ENC='${FIPS_DES_ENC}' BF_ENC='${BF_ENC}' CAST_ENC='${CAST_ENC}' RC4_ENC='${RC4_ENC}' RC5_ENC='${RC5_ENC}' SHA1_ASM_OBJ='${SHA1_ASM_OBJ}' FIPS_SHA1_ASM_OBJ='${FIPS_SHA1_ASM_OBJ}' MD5_ASM_OBJ='${MD5_ASM_OBJ}' RMD160_ASM_OBJ='${RMD160_ASM_OBJ}' AR='${AR}' PROCESSOR='${PROCESSOR}' PERL='${PERL}' RANLIB='${RANLIB}' TESTS='${TESTS}' KRB5_INCLUDES='${KRB5_INCLUDES}' LIBKRB5='${LIBKRB5}' EXE_EXT='${EXE_EXT}' SHARED_LIBS='${SHARED_LIBS}' SHLIB_EXT='${SHLIB_EXT}' SHLIB_TARGET='${SHLIB_TARGET}' TESTS='${TESTS}' OPENSSL_DEBUG_MEMORY=on tests );
698         @LD_LIBRARY_PATH="`pwd`:$$LD_LIBRARY_PATH"; \
699         DYLD_LIBRARY_PATH="`pwd`:$$DYLD_LIBRARY_PATH"; \
700         SHLIB_PATH="`pwd`:$$SHLIB_PATH"; \
701         LIBPATH="`pwd`:$$LIBPATH"; \
702         if [ "$(PLATFORM)" = "Cygwin" ]; then PATH="`pwd`:$$PATH"; fi; \
703         export LD_LIBRARY_PATH DYLD_LIBRARY_PATH SHLIB_PATH LIBPATH PATH; \
704         apps/openssl version -a
705
706 report:
707         @$(PERL) util/selftest.pl
708
709 depend:
710         @for i in $(DIRS) ;\
711         do \
712         if [ -d "$$i" ]; then \
713                 (cd $$i && echo "making dependencies $$i..." && \
714                 $(MAKE) SDIRS='${SDIRS}' CFLAG='${CFLAG}' DEPFLAG='${DEPFLAG}' MAKEDEPPROG='${MAKEDEPPROG}' KRB5_INCLUDES='${KRB5_INCLUDES}' PERL='${PERL}' depend ) || exit 1; \
715         fi; \
716         done;
717
718 lint:
719         @for i in $(DIRS) ;\
720         do \
721         if [ -d "$$i" ]; then \
722                 (cd $$i && echo "making lint $$i..." && \
723                 $(MAKE) SDIRS='${SDIRS}' lint ) || exit 1; \
724         fi; \
725         done;
726
727 tags:
728         rm -f TAGS
729         find . -name '[^.]*.[ch]' | xargs etags -a
730
731 errors:
732         $(PERL) util/mkerr.pl -recurse -write
733         (cd crypto/engine; $(MAKE) PERL=$(PERL) errors)
734
735 stacks:
736         $(PERL) util/mkstack.pl -write
737
738 util/libeay.num::
739         $(PERL) util/mkdef.pl crypto update
740
741 util/ssleay.num::
742         $(PERL) util/mkdef.pl ssl update
743
744 crypto/objects/obj_dat.h: crypto/objects/obj_dat.pl crypto/objects/obj_mac.h
745         $(PERL) crypto/objects/obj_dat.pl crypto/objects/obj_mac.h crypto/objects/obj_dat.h
746 crypto/objects/obj_mac.h: crypto/objects/objects.pl crypto/objects/objects.txt crypto/objects/obj_mac.num
747         $(PERL) crypto/objects/objects.pl crypto/objects/objects.txt crypto/objects/obj_mac.num crypto/objects/obj_mac.h
748
749 apps/openssl-vms.cnf: apps/openssl.cnf
750         $(PERL) VMS/VMSify-conf.pl < apps/openssl.cnf > apps/openssl-vms.cnf
751
752 TABLE: Configure
753         (echo 'Output of `Configure TABLE'"':"; \
754         $(PERL) Configure TABLE) > TABLE
755
756 update: depend errors stacks util/libeay.num util/ssleay.num crypto/objects/obj_dat.h apps/openssl-vms.cnf TABLE
757
758 # Build distribution tar-file. As the list of files returned by "find" is
759 # pretty long, on several platforms a "too many arguments" error or similar
760 # would occur. Therefore the list of files is temporarily stored into a file
761 # and read directly, requiring GNU-Tar. Call "make TAR=gtar dist" if the normal
762 # tar does not support the --files-from option.
763 tar:
764         find . -type d -print | xargs chmod 755
765         find . -type f -print | xargs chmod a+r
766         find . -type f -perm -0100 -print | xargs chmod a+x
767         find * \! -path CVS/\* \! -path \*/CVS/\* \! -name CVS \! -name .cvsignore \! -name STATUS \! -name TABLE | sort > ../$(TARFILE).list; \
768         $(TAR) $(TARFLAGS) --files-from ../$(TARFILE).list -cvf - | \
769         tardy --user_number=0  --user_name=openssl \
770               --group_number=0 --group_name=openssl \
771               --prefix=openssl-$(VERSION) - |\
772         gzip --best >../$(TARFILE).gz; \
773         rm -f ../$(TARFILE).list; \
774         ls -l ../$(TARFILE).gz
775
776 tar-snap:
777         @$(TAR) $(TARFLAGS) -cvf - \
778                 `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 '.#*' \! -name '*~' | sort` |\
779         tardy --user_number=0  --user_name=openssl \
780               --group_number=0 --group_name=openssl \
781               --prefix=openssl-$(VERSION) - > ../$(TARFILE);\
782         ls -l ../$(TARFILE)
783
784 dist:   
785         $(PERL) Configure dist
786         @$(MAKE) dist_pem_h
787         @$(MAKE) SDIRS='${SDIRS}' clean
788         @$(MAKE) TAR='${TAR}' TARFLAGS='${TARFLAGS}' tar
789
790 dist_pem_h:
791         (cd crypto/pem; $(MAKE) CC='${CC}' SDIRS='${SDIRS}' CFLAG='${CFLAG}' pem.h; $(MAKE) clean)
792
793 install: all install_docs install_sw
794
795 install_sw:
796         @$(PERL) $(TOP)/util/mkdir-p.pl $(INSTALL_PREFIX)$(INSTALLTOP)/bin \
797                 $(INSTALL_PREFIX)$(INSTALLTOP)/lib \
798                 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/pkgconfig \
799                 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl \
800                 $(INSTALL_PREFIX)$(OPENSSLDIR)/misc \
801                 $(INSTALL_PREFIX)$(OPENSSLDIR)/certs \
802                 $(INSTALL_PREFIX)$(OPENSSLDIR)/private
803         @for i in $(EXHEADER) ;\
804         do \
805         (cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \
806         chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \
807         done;
808         @for i in $(DIRS) ;\
809         do \
810         if [ -d "$$i" ]; then \
811                 (cd $$i; echo "installing $$i..."; \
812                 $(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 ); \
813         fi; \
814         done
815         @for i in $(LIBS) ;\
816         do \
817                 if [ -f "$$i" ]; then \
818                 (       echo installing $$i; \
819                         cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \
820                         if egrep 'define OPENSSL_FIPS' $(TOP)/include/openssl/opensslconf.h > /dev/null; then \
821                                 : ; \
822                         else \
823                                 $(RANLIB) $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \
824                         fi; \
825                         chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \
826                         mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i ); \
827                 fi; \
828         done;
829         @if [ -n "$(SHARED_LIBS)" ]; then \
830                 tmp="$(SHARED_LIBS)"; \
831                 for i in $${tmp:-x}; \
832                 do \
833                         if [ -f "$$i" -o -f "$$i.a" ]; then \
834                         (       echo installing $$i; \
835                                 if [ "$(PLATFORM)" != "Cygwin" ]; then \
836                                         cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \
837                                         chmod 555 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \
838                                         mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i; \
839                                 else \
840                                         c=`echo $$i | sed 's/^lib\(.*\)\.dll/cyg\1-$(SHLIB_VERSION_NUMBER).dll/'`; \
841                                         cp $$c $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new; \
842                                         chmod 755 $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new; \
843                                         mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c; \
844                                         cp $$i.a $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.a.new; \
845                                         chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.a.new; \
846                                         mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.a.new $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.a; \
847                                 fi ); \
848                         fi; \
849                 done; \
850                 (       here="`pwd`"; \
851                         cd $(INSTALL_PREFIX)$(INSTALLTOP)/lib; \
852                         set $(MAKE); \
853                         $$1 -f $$here/Makefile link-shared ); \
854                 if [ "$(INSTALLTOP)" != "/usr" ]; then \
855                         echo 'OpenSSL shared libraries have been installed in:'; \
856                         echo '  $(INSTALLTOP)'; \
857                         echo ''; \
858                         sed -e '1,/^$$/d' doc/openssl-shared.txt; \
859                 fi; \
860         fi
861         @for i in $(SIGS) ;\
862         do \
863                 if [ -f "$$i" ]; then \
864                 (       echo installing $$i; \
865                         cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \
866                         chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \
867                         mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i ); \
868                 fi; \
869         done;
870         cp openssl.pc $(INSTALL_PREFIX)$(INSTALLTOP)/lib/pkgconfig
871         chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/pkgconfig/openssl.pc
872
873 install_docs:
874         @$(PERL) $(TOP)/util/mkdir-p.pl \
875                 $(INSTALL_PREFIX)$(MANDIR)/man1 \
876                 $(INSTALL_PREFIX)$(MANDIR)/man3 \
877                 $(INSTALL_PREFIX)$(MANDIR)/man5 \
878                 $(INSTALL_PREFIX)$(MANDIR)/man7
879         @pod2man="`cd util; ./pod2mantest $(PERL)`"; \
880         here="`pwd`"; \
881         filecase=; \
882         if [ "$(PLATFORM)" = "DJGPP" -o "$(PLATFORM)" = "Cygwin" ]; then \
883                 filecase=-i; \
884         fi; \
885         for i in doc/apps/*.pod; do \
886                 fn=`basename $$i .pod`; \
887                 if [ "$$fn" = "config" ]; then sec=5; else sec=1; fi; \
888                 echo "installing man$$sec/$$fn.$${sec}$(MANSUFFIX)"; \
889                 (cd `$(PERL) util/dirname.pl $$i`; \
890                 sh -c "$$pod2man \
891                         --section=$$sec --center=OpenSSL \
892                         --release=$(VERSION) `basename $$i`") \
893                         >  $(INSTALL_PREFIX)$(MANDIR)/man$$sec/$$fn.$${sec}$(MANSUFFIX); \
894                 $(PERL) util/extract-names.pl < $$i | \
895                         grep -v $$filecase "^$$fn\$$" | \
896                         grep -v "[      ]" | \
897                         (cd $(INSTALL_PREFIX)$(MANDIR)/man$$sec/; \
898                          while read n; do \
899                                 $$here/util/point.sh $$fn.$${sec}$(MANSUFFIX) "$$n".$${sec}$(MANSUFFIX); \
900                          done); \
901         done; \
902         for i in doc/crypto/*.pod doc/ssl/*.pod; do \
903                 fn=`basename $$i .pod`; \
904                 if [ "$$fn" = "des_modes" ]; then sec=7; else sec=3; fi; \
905                 echo "installing man$$sec/$$fn.$${sec}$(MANSUFFIX)"; \
906                 (cd `$(PERL) util/dirname.pl $$i`; \
907                 sh -c "$$pod2man \
908                         --section=$$sec --center=OpenSSL \
909                         --release=$(VERSION) `basename $$i`") \
910                         >  $(INSTALL_PREFIX)$(MANDIR)/man$$sec/$$fn.$${sec}$(MANSUFFIX); \
911                 $(PERL) util/extract-names.pl < $$i | \
912                         grep -v $$filecase "^$$fn\$$" | \
913                         grep -v "[      ]" | \
914                         (cd $(INSTALL_PREFIX)$(MANDIR)/man$$sec/; \
915                          while read n; do \
916                                 $$here/util/point.sh $$fn.$${sec}$(MANSUFFIX) "$$n".$${sec}$(MANSUFFIX); \
917                          done); \
918         done
919
920 # DO NOT DELETE THIS LINE -- make depend depends on it.