]> CyberLeo.Net >> Repos - FreeBSD/releng/8.0.git/blob - crypto/openssl/Makefile
Adjust to reflect 8.0-RELEASE.
[FreeBSD/releng/8.0.git] / crypto / openssl / Makefile
1 ### Generated automatically from Makefile.org by Configure.
2
3 ##
4 ## Makefile for OpenSSL
5 ##
6
7 VERSION=0.9.8k
8 MAJOR=0
9 MINOR=9.8
10 SHLIB_VERSION_NUMBER=0.9.8
11 SHLIB_VERSION_HISTORY=
12 SHLIB_MAJOR=0
13 SHLIB_MINOR=9.8
14 SHLIB_EXT=
15 PLATFORM=dist
16 OPTIONS= no-camellia no-capieng no-cms no-gmp no-jpake no-krb5 no-mdc2 no-montasm no-rc5 no-rfc3779 no-seed no-shared no-zlib no-zlib-dynamic
17 CONFIGURE_ARGS=dist
18 SHLIB_TARGET=
19
20 # HERE indicates where this Makefile lives.  This can be used to indicate
21 # where sub-Makefiles are expected to be.  Currently has very limited usage,
22 # and should probably not be bothered with at all.
23 HERE=.
24
25 # INSTALL_PREFIX is for package builders so that they can configure
26 # for, say, /usr/ and yet have everything installed to /tmp/somedir/usr/.
27 # Normally it is left empty.
28 INSTALL_PREFIX=
29 INSTALLTOP=/usr/local/ssl
30
31 # Do not edit this manually. Use Configure --openssldir=DIR do change this!
32 OPENSSLDIR=/usr/local/ssl
33
34 # NO_IDEA - Define to build without the IDEA algorithm
35 # NO_RC4  - Define to build without the RC4 algorithm
36 # NO_RC2  - Define to build without the RC2 algorithm
37 # THREADS - Define when building with threads, you will probably also need any
38 #           system defines as well, i.e. _REENTERANT for Solaris 2.[34]
39 # TERMIO  - Define the termio terminal subsystem, needed if sgtty is missing.
40 # TERMIOS - Define the termios terminal subsystem, Silicon Graphics.
41 # LONGCRYPT - Define to use HPUX 10.x's long password modification to crypt(3).
42 # DEVRANDOM - Give this the value of the 'random device' if your OS supports
43 #           one.  32 bytes will be read from this when the random
44 #           number generator is initalised.
45 # SSL_FORBID_ENULL - define if you want the server to be not able to use the
46 #           NULL encryption ciphers.
47 #
48 # LOCK_DEBUG - turns on lots of lock debug output :-)
49 # REF_CHECK - turn on some xyz_free() assertions.
50 # REF_PRINT - prints some stuff on structure free.
51 # CRYPTO_MDEBUG - turns on my 'memory leak' detecting stuff
52 # MFUNC - Make all Malloc/Free/Realloc calls call
53 #       CRYPTO_malloc/CRYPTO_free/CRYPTO_realloc which can be setup to
54 #       call application defined callbacks via CRYPTO_set_mem_functions()
55 # MD5_ASM needs to be defined to use the x86 assembler for MD5
56 # SHA1_ASM needs to be defined to use the x86 assembler for SHA1
57 # RMD160_ASM needs to be defined to use the x86 assembler for RIPEMD160
58 # Do not define B_ENDIAN or L_ENDIAN if 'unsigned long' == 8.  It must
59 # equal 4.
60 # PKCS1_CHECK - pkcs1 tests.
61
62 CC= cc
63 CFLAG= -O
64 DEPFLAG= -DOPENSSL_NO_CAMELLIA -DOPENSSL_NO_CAPIENG -DOPENSSL_NO_CMS -DOPENSSL_NO_GMP -DOPENSSL_NO_JPAKE -DOPENSSL_NO_MDC2 -DOPENSSL_NO_RC5 -DOPENSSL_NO_RFC3779 -DOPENSSL_NO_SEED
65 PEX_LIBS= 
66 EX_LIBS= 
67 EXE_EXT= 
68 ARFLAGS= 
69 AR=ar $(ARFLAGS) r
70 ARD=ar $(ARFLAGS) d
71 RANLIB= /usr/bin/ranlib
72 PERL= /usr/bin/perl
73 TAR= tar
74 TARFLAGS= --no-recursion
75 MAKEDEPPROG=makedepend
76
77 # We let the C compiler driver to take care of .s files. This is done in
78 # order to be excused from maintaining a separate set of architecture
79 # dependent assembler flags. E.g. if you throw -mcpu=ultrasparc at SPARC
80 # gcc, then the driver will automatically translate it to -xarch=v8plus
81 # and pass it down to assembler.
82 AS=$(CC) -c
83 ASFLAG=$(CFLAG)
84
85 # For x86 assembler: Set PROCESSOR to 386 if you want to support
86 # the 80386.
87 PROCESSOR= 
88
89 # CPUID module collects small commonly used assembler snippets
90 CPUID_OBJ= 
91 BN_ASM= bn_asm.o
92 DES_ENC= des_enc.o fcrypt_b.o
93 AES_ASM_OBJ= aes_core.o aes_cbc.o
94 BF_ENC= bf_enc.o
95 CAST_ENC= c_enc.o
96 RC4_ENC= rc4_enc.o rc4_skey.o
97 RC5_ENC= rc5_enc.o
98 MD5_ASM_OBJ= 
99 SHA1_ASM_OBJ= 
100 RMD160_ASM_OBJ= 
101
102 # KRB5 stuff
103 KRB5_INCLUDES=
104 LIBKRB5=
105
106 # Zlib stuff
107 ZLIB_INCLUDE=
108 LIBZLIB=
109
110 # This is the location of fipscanister.o and friends.
111 # The FIPS module build will place it $(INSTALLTOP)/lib
112 # but since $(INSTALLTOP) can only take the default value
113 # when the module is built it will be in /usr/local/ssl/lib
114 # $(INSTALLTOP) for this build make be different so hard
115 # code the path.
116
117 FIPSLIBDIR=/usr/local/ssl/fips-1.0/lib/
118
119 # This is set to "y" if fipscanister.o is compiled internally as
120 # opposed to coming from an external validated location.
121
122 FIPSCANISTERINTERNAL=n
123
124 # The location of the library which contains fipscanister.o
125 # normally it will be libcrypto unless fipsdso is set in which
126 # case it will be libfips. If not compiling in FIPS mode at all
127 # this is empty making it a useful test for a FIPS compile.
128
129 FIPSCANLIB=
130
131 # Shared library base address. Currently only used on Windows.
132 #
133
134 BASEADDR=0xFB00000
135
136 DIRS=   crypto ssl engines apps test tools
137 SHLIBDIRS= crypto ssl
138
139 # dirs in crypto to build
140 SDIRS=  \
141         objects \
142         md2 md4 md5 sha hmac ripemd \
143         des aes rc2 rc4 idea bf cast \
144         bn ec rsa dsa ecdsa dh ecdh dso engine \
145         buffer bio stack lhash rand err \
146         evp asn1 pem x509 x509v3 conf txt_db pkcs7 pkcs12 comp ocsp ui krb5 \
147         store pqueue
148 # keep in mind that the above list is adjusted by ./Configure
149 # according to no-xxx arguments...
150
151 # tests to perform.  "alltests" is a special word indicating that all tests
152 # should be performed.
153 TESTS = alltests
154
155 MAKEFILE= Makefile
156
157 MANDIR=$(OPENSSLDIR)/man
158 MAN1=1
159 MAN3=3
160 MANSUFFIX=
161 SHELL=/bin/sh
162
163 TOP=    .
164 ONEDIRS=out tmp
165 EDIRS=  times doc bugs util include certs ms shlib mt demos perl sf dep VMS
166 WDIRS=  windows
167 LIBS=   libcrypto.a libssl.a
168 SHARED_CRYPTO=libcrypto$(SHLIB_EXT)
169 SHARED_SSL=libssl$(SHLIB_EXT)
170 SHARED_FIPS=
171 SHARED_LIBS=
172 SHARED_LIBS_LINK_EXTS=
173 SHARED_LDFLAGS=
174
175 GENERAL=        Makefile
176 BASENAME=       openssl
177 NAME=           $(BASENAME)-$(VERSION)
178 TARFILE=        $(NAME).tar
179 WTARFILE=       $(NAME)-win.tar
180 EXHEADER=       e_os2.h
181 HEADER=         e_os.h
182
183 all: Makefile build_all openssl.pc libssl.pc libcrypto.pc
184
185 # as we stick to -e, CLEARENV ensures that local variables in lower
186 # Makefiles remain local and variable. $${VAR+VAR} is tribute to Korn
187 # shell, which [annoyingly enough] terminates unset with error if VAR
188 # is not present:-( TOP= && unset TOP is tribute to HP-UX /bin/sh,
189 # which terminates unset with error if no variable was present:-(
190 CLEARENV=       TOP= && unset TOP $${LIB+LIB} $${LIBS+LIBS}     \
191                 $${INCLUDE+INCLUDE} $${INCLUDES+INCLUDES}       \
192                 $${DIR+DIR} $${DIRS+DIRS} $${SRC+SRC}           \
193                 $${LIBSRC+LIBSRC} $${LIBOBJ+LIBOBJ} $${ALL+ALL} \
194                 $${EXHEADER+EXHEADER} $${HEADER+HEADER}         \
195                 $${GENERAL+GENERAL} $${CFLAGS+CFLAGS}           \
196                 $${ASFLAGS+ASFLAGS} $${AFLAGS+AFLAGS}           \
197                 $${LDCMD+LDCMD} $${LDFLAGS+LDFLAGS}             \
198                 $${SHAREDCMD+SHAREDCMD} $${SHAREDFLAGS+SHAREDFLAGS}     \
199                 $${SHARED_LIB+SHARED_LIB} $${LIBEXTRAS+LIBEXTRAS}
200
201 BUILDENV=       PLATFORM='${PLATFORM}' PROCESSOR='${PROCESSOR}' \
202                 CC='${CC}' CFLAG='${CFLAG}'                     \
203                 AS='${CC}' ASFLAG='${CFLAG} -c'                 \
204                 AR='${AR}' PERL='${PERL}' RANLIB='${RANLIB}'    \
205                 SDIRS='${SDIRS}' LIBRPATH='${INSTALLTOP}/lib'   \
206                 INSTALL_PREFIX='${INSTALL_PREFIX}'              \
207                 INSTALLTOP='${INSTALLTOP}' OPENSSLDIR='${OPENSSLDIR}'   \
208                 MAKEDEPEND='$$$${TOP}/util/domd $$$${TOP} -MD ${MAKEDEPPROG}' \
209                 DEPFLAG='-DOPENSSL_NO_DEPRECATED ${DEPFLAG}'    \
210                 MAKEDEPPROG='${MAKEDEPPROG}'                    \
211                 SHARED_LDFLAGS='${SHARED_LDFLAGS}'              \
212                 KRB5_INCLUDES='${KRB5_INCLUDES}' LIBKRB5='${LIBKRB5}'   \
213                 EXE_EXT='${EXE_EXT}' SHARED_LIBS='${SHARED_LIBS}'       \
214                 SHLIB_EXT='${SHLIB_EXT}' SHLIB_TARGET='${SHLIB_TARGET}' \
215                 PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}'     \
216                 CPUID_OBJ='${CPUID_OBJ}'                        \
217                 BN_ASM='${BN_ASM}' DES_ENC='${DES_ENC}'         \
218                 AES_ASM_OBJ='${AES_ASM_OBJ}'                    \
219                 BF_ENC='${BF_ENC}' CAST_ENC='${CAST_ENC}'       \
220                 RC4_ENC='${RC4_ENC}' RC5_ENC='${RC5_ENC}'       \
221                 SHA1_ASM_OBJ='${SHA1_ASM_OBJ}'                  \
222                 MD5_ASM_OBJ='${MD5_ASM_OBJ}'                    \
223                 RMD160_ASM_OBJ='${RMD160_ASM_OBJ}'              \
224                 FIPSLIBDIR='${FIPSLIBDIR}'                      \
225                 FIPSCANLIB="$${FIPSCANLIB:-$(FIPSCANLIB)}"      \
226                 FIPSCANISTERINTERNAL='${FIPSCANISTERINTERNAL}'  \
227                 FIPS_EX_OBJ='${FIPS_EX_OBJ}'    \
228                 THIS=$${THIS:-$@} MAKEFILE=Makefile MAKEOVERRIDES=
229 # MAKEOVERRIDES= effectively "equalizes" GNU-ish and SysV-ish make flavors,
230 # which in turn eliminates ambiguities in variable treatment with -e.
231
232 # BUILD_CMD is a generic macro to build a given target in a given
233 # subdirectory.  The target must be given through the shell variable
234 # `target' and the subdirectory to build in must be given through `dir'.
235 # This macro shouldn't be used directly, use RECURSIVE_BUILD_CMD or
236 # BUILD_ONE_CMD instead.
237 #
238 # BUILD_ONE_CMD is a macro to build a given target in a given
239 # subdirectory if that subdirectory is part of $(DIRS).  It requires
240 # exactly the same shell variables as BUILD_CMD.
241 #
242 # RECURSIVE_BUILD_CMD is a macro to build a given target in all
243 # subdirectories defined in $(DIRS).  It requires that the target
244 # is given through the shell variable `target'.
245 BUILD_CMD=  if [ -d "$$dir" ]; then \
246             (   [ $$target != all -a -z "$(FIPSCANLIB)" ] && FIPSCANLIB=/dev/null; \
247                 cd $$dir && echo "making $$target in $$dir..." && \
248                 $(CLEARENV) && $(MAKE) -e $(BUILDENV) TOP=.. DIR=$$dir $$target \
249             ) || exit 1; \
250             fi
251 RECURSIVE_BUILD_CMD=for dir in $(DIRS); do $(BUILD_CMD); done
252 BUILD_ONE_CMD=\
253         if echo " $(DIRS) " | grep " $$dir " >/dev/null 2>/dev/null; then \
254                 $(BUILD_CMD); \
255         fi
256
257 reflect:
258         @[ -n "$(THIS)" ] && $(CLEARENV) && $(MAKE) $(THIS) -e $(BUILDENV)
259
260 FIPS_EX_OBJ= ../crypto/aes/aes_cfb.o \
261         ../crypto/aes/aes_ecb.o \
262         ../crypto/aes/aes_ofb.o \
263         ../crypto/bn/bn_add.o \
264         ../crypto/bn/bn_blind.o \
265         ../crypto/bn/bn_ctx.o \
266         ../crypto/bn/bn_div.o \
267         ../crypto/bn/bn_exp2.o \
268         ../crypto/bn/bn_exp.o \
269         ../crypto/bn/bn_gcd.o \
270         ../crypto/bn/bn_lib.o \
271         ../crypto/bn/bn_mod.o \
272         ../crypto/bn/bn_mont.o \
273         ../crypto/bn/bn_mul.o \
274         ../crypto/bn/bn_prime.o \
275         ../crypto/bn/bn_rand.o \
276         ../crypto/bn/bn_recp.o \
277         ../crypto/bn/bn_shift.o \
278         ../crypto/bn/bn_sqr.o \
279         ../crypto/bn/bn_word.o \
280         ../crypto/bn/bn_x931p.o \
281         ../crypto/buffer/buf_str.o \
282         ../crypto/cryptlib.o \
283         ../crypto/des/cfb64ede.o \
284         ../crypto/des/cfb64enc.o \
285         ../crypto/des/cfb_enc.o \
286         ../crypto/des/ecb3_enc.o \
287         ../crypto/des/ecb_enc.o \
288         ../crypto/des/ofb64ede.o \
289         ../crypto/des/ofb64enc.o \
290         ../crypto/des/fcrypt.o \
291         ../crypto/des/set_key.o \
292         ../crypto/dsa/dsa_utl.o \
293         ../crypto/dsa/dsa_sign.o \
294         ../crypto/dsa/dsa_vrf.o \
295         ../crypto/err/err.o \
296         ../crypto/evp/digest.o \
297         ../crypto/evp/enc_min.o \
298         ../crypto/evp/e_aes.o \
299         ../crypto/evp/e_des3.o \
300         ../crypto/evp/p_sign.o \
301         ../crypto/evp/p_verify.o \
302         ../crypto/mem_clr.o \
303         ../crypto/mem.o \
304         ../crypto/rand/md_rand.o \
305         ../crypto/rand/rand_egd.o \
306         ../crypto/rand/randfile.o \
307         ../crypto/rand/rand_lib.o \
308         ../crypto/rand/rand_os2.o \
309         ../crypto/rand/rand_unix.o \
310         ../crypto/rand/rand_win.o \
311         ../crypto/rsa/rsa_lib.o \
312         ../crypto/rsa/rsa_none.o \
313         ../crypto/rsa/rsa_oaep.o \
314         ../crypto/rsa/rsa_pk1.o \
315         ../crypto/rsa/rsa_pss.o \
316         ../crypto/rsa/rsa_ssl.o \
317         ../crypto/rsa/rsa_x931.o \
318         ../crypto/sha/sha1dgst.o \
319         ../crypto/sha/sha256.o \
320         ../crypto/sha/sha512.o \
321         ../crypto/uid.o
322
323 sub_all: build_all
324 build_all: build_libs build_apps build_tests build_tools
325
326 build_libs: build_crypto build_fips build_ssl build_shared build_engines
327
328 build_crypto:
329         if [ -n "$(FIPSCANLIB)" ]; then \
330                 EXCL_OBJ='$(AES_ASM_OBJ) $(BN_ASM) $(DES_ENC) $(CPUID_OBJ) $(SHA1_ASM_OBJ) $(FIPS_EX_OBJ)' ; export EXCL_OBJ ; \
331                 ARX='$(PERL) $${TOP}/util/arx.pl $(AR)' ; \
332         else \
333                 ARX='${AR}' ; \
334         fi ; export ARX ; \
335                 dir=crypto; target=all; $(BUILD_ONE_CMD)
336 build_fips:
337         @dir=fips; target=all; [ -z "$(FIPSCANLIB)" ] || $(BUILD_ONE_CMD)
338 build_ssl:
339         @dir=ssl; target=all; $(BUILD_ONE_CMD)
340 build_engines:
341         @dir=engines; target=all; $(BUILD_ONE_CMD)
342 build_apps:
343         @dir=apps; target=all; $(BUILD_ONE_CMD)
344 build_tests:
345         @dir=test; target=all; $(BUILD_ONE_CMD)
346 build_tools:
347         @dir=tools; target=all; $(BUILD_ONE_CMD)
348
349 all_testapps: build_libs build_testapps
350 build_testapps:
351         @dir=crypto; target=testapps; $(BUILD_ONE_CMD)
352
353 build_shared:   $(SHARED_LIBS)
354 libcrypto$(SHLIB_EXT): libcrypto.a $(SHARED_FIPS)
355         @if [ "$(SHLIB_TARGET)" != "" ]; then \
356                 if [ "$(FIPSCANLIB)" = "libfips" ]; then \
357                         $(ARD) libcrypto.a fipscanister.o ; \
358                         $(MAKE) SHLIBDIRS='crypto' SHLIBDEPS='-lfips' build-shared; \
359                         $(AR) libcrypto.a fips/fipscanister.o ; \
360                 else \
361                         if [ "$(FIPSCANLIB)" = "libcrypto" ]; then \
362                                 FIPSLD_CC=$(CC); CC=fips/fipsld; \
363                                 export CC FIPSLD_CC; \
364                         fi; \
365                         $(MAKE) -e SHLIBDIRS='crypto' build-shared; \
366                 fi \
367         else \
368                 echo "There's no support for shared libraries on this platform" >&2; \
369                 exit 1; \
370         fi
371
372 libssl$(SHLIB_EXT): libcrypto$(SHLIB_EXT) libssl.a
373         @if [ "$(SHLIB_TARGET)" != "" ]; then \
374                 shlibdeps=-lcrypto; \
375                 [ "$(FIPSCANLIB)" = "libfips" ] && shlibdeps="$$shlibdeps -lfips"; \
376                 $(MAKE) SHLIBDIRS=ssl SHLIBDEPS="$$shlibdeps" build-shared; \
377         else \
378                 echo "There's no support for shared libraries on this platform" >&2 ; \
379                 exit 1; \
380         fi
381
382 fips/fipscanister.o:    build_fips
383 libfips$(SHLIB_EXT):            fips/fipscanister.o
384         @if [ "$(SHLIB_TARGET)" != "" ]; then \
385                 FIPSLD_CC=$(CC); CC=fips/fipsld; export CC FIPSLD_CC; \
386                 $(MAKE) -f Makefile.shared -e $(BUILDENV) \
387                         CC=$${CC} LIBNAME=fips THIS=$@ \
388                         LIBEXTRAS=fips/fipscanister.o \
389                         LIBDEPS="$(EX_LIBS)" \
390                         LIBVERSION=${SHLIB_MAJOR}.${SHLIB_MINOR} \
391                         link_o.$(SHLIB_TARGET) || { rm -f $@; exit 1; } \
392         else \
393                 echo "There's no support for shared libraries on this platform" >&2; \
394                 exit 1; \
395         fi
396
397 libfips.a:
398         dir=fips; target=all; $(BUILD_ONE_CMD)
399
400 clean-shared:
401         @set -e; for i in $(SHLIBDIRS); do \
402                 if [ -n "$(SHARED_LIBS_LINK_EXTS)" ]; then \
403                         tmp="$(SHARED_LIBS_LINK_EXTS)"; \
404                         for j in $${tmp:-x}; do \
405                                 ( set -x; rm -f lib$$i$$j ); \
406                         done; \
407                 fi; \
408                 ( set -x; rm -f lib$$i$(SHLIB_EXT) ); \
409                 if [ "$(PLATFORM)" = "Cygwin" ]; then \
410                         ( set -x; rm -f cyg$$i$(SHLIB_EXT) lib$$i$(SHLIB_EXT).a ); \
411                 fi; \
412         done
413
414 link-shared:
415         @ set -e; for i in ${SHLIBDIRS}; do \
416                 $(MAKE) -f $(HERE)/Makefile.shared -e $(BUILDENV) \
417                         LIBNAME=$$i LIBVERSION=${SHLIB_MAJOR}.${SHLIB_MINOR} \
418                         LIBCOMPATVERSIONS=";${SHLIB_VERSION_HISTORY}" \
419                         symlink.$(SHLIB_TARGET); \
420                 libs="$$libs -l$$i"; \
421         done
422
423 build-shared: do_$(SHLIB_TARGET) link-shared
424
425 do_$(SHLIB_TARGET):
426         @ set -e; libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
427                 if [ "${SHLIBDIRS}" = "ssl" -a -n "$(LIBKRB5)" ]; then \
428                         libs="$(LIBKRB5) $$libs"; \
429                 fi; \
430                 $(CLEARENV) && $(MAKE) -f Makefile.shared -e $(BUILDENV) \
431                         LIBNAME=$$i LIBVERSION=${SHLIB_MAJOR}.${SHLIB_MINOR} \
432                         LIBCOMPATVERSIONS=";${SHLIB_VERSION_HISTORY}" \
433                         LIBDEPS="$$libs $(EX_LIBS)" \
434                         link_a.$(SHLIB_TARGET); \
435                 libs="-l$$i $$libs"; \
436         done
437
438 libcrypto.pc: Makefile
439         @ ( echo 'prefix=$(INSTALLTOP)'; \
440             echo 'exec_prefix=$${prefix}'; \
441             echo 'libdir=$${exec_prefix}/lib'; \
442             echo 'includedir=$${prefix}/include'; \
443             echo ''; \
444             echo 'Name: OpenSSL-libcrypto'; \
445             echo 'Description: OpenSSL cryptography library'; \
446             echo 'Version: '$(VERSION); \
447             echo 'Requires: '; \
448             echo 'Libs: -L$${libdir} -lcrypto $(EX_LIBS)'; \
449             echo 'Cflags: -I$${includedir} $(KRB5_INCLUDES)' ) > libcrypto.pc
450
451 libssl.pc: Makefile
452         @ ( echo 'prefix=$(INSTALLTOP)'; \
453             echo 'exec_prefix=$${prefix}'; \
454             echo 'libdir=$${exec_prefix}/lib'; \
455             echo 'includedir=$${prefix}/include'; \
456             echo ''; \
457             echo 'Name: OpenSSL'; \
458             echo 'Description: Secure Sockets Layer and cryptography libraries'; \
459             echo 'Version: '$(VERSION); \
460             echo 'Requires: '; \
461             echo 'Libs: -L$${libdir} -lssl -lcrypto $(EX_LIBS)'; \
462             echo 'Cflags: -I$${includedir} $(KRB5_INCLUDES)' ) > libssl.pc
463
464 openssl.pc: Makefile
465         @ ( echo 'prefix=$(INSTALLTOP)'; \
466             echo 'exec_prefix=$${prefix}'; \
467             echo 'libdir=$${exec_prefix}/lib'; \
468             echo 'includedir=$${prefix}/include'; \
469             echo ''; \
470             echo 'Name: OpenSSL'; \
471             echo 'Description: Secure Sockets Layer and cryptography libraries and tools'; \
472             echo 'Version: '$(VERSION); \
473             echo 'Requires: '; \
474             echo 'Libs: -L$${libdir} -lssl -lcrypto $(EX_LIBS)'; \
475             echo 'Cflags: -I$${includedir} $(KRB5_INCLUDES)' ) > openssl.pc
476
477 Makefile: Makefile.org Configure config
478         @echo "Makefile is older than Makefile.org, Configure or config."
479         @echo "Reconfigure the source tree (via './config' or 'perl Configure'), please."
480         @false
481
482 libclean:
483         rm -f *.map *.so *.so.* *.dll engines/*.so engines/*.dll *.a engines/*.a */lib */*/lib
484
485 clean:  libclean
486         rm -f shlib/*.o *.o core a.out fluff rehash.time testlog make.log cctest cctest.c
487         @set -e; target=clean; $(RECURSIVE_BUILD_CMD)
488         rm -f $(LIBS)
489         rm -f openssl.pc libssl.pc libcrypto.pc
490         rm -f speed.* .pure
491         rm -f $(TARFILE)
492         @set -e; for i in $(ONEDIRS) ;\
493         do \
494         rm -fr $$i/*; \
495         done
496
497 makefile.one: files
498         $(PERL) util/mk1mf.pl >makefile.one; \
499         sh util/do_ms.sh
500
501 files:
502         $(PERL) $(TOP)/util/files.pl Makefile > $(TOP)/MINFO
503         @set -e; target=files; $(RECURSIVE_BUILD_CMD)
504
505 links:
506         @$(PERL) $(TOP)/util/mkdir-p.pl include/openssl
507         @$(PERL) $(TOP)/util/mklink.pl include/openssl $(EXHEADER)
508         @set -e; target=links; $(RECURSIVE_BUILD_CMD)
509         @if [ -z "$(FIPSCANLIB)" ]; then \
510                 set -e; target=links; dir=fips ; $(BUILD_CMD) ; \
511         fi
512
513 gentests:
514         @(cd test && echo "generating dummy tests (if needed)..." && \
515         $(CLEARENV) && $(MAKE) -e $(BUILDENV) TESTS='${TESTS}' OPENSSL_DEBUG_MEMORY=on generate );
516
517 dclean:
518         rm -f *.bak
519         @set -e; target=dclean; $(RECURSIVE_BUILD_CMD)
520
521 rehash: rehash.time
522 rehash.time: certs
523         @(OPENSSL="`pwd`/util/opensslwrap.sh"; \
524           OPENSSL_DEBUG_MEMORY=on; \
525           export OPENSSL OPENSSL_DEBUG_MEMORY; \
526           $(PERL) tools/c_rehash certs)
527         touch rehash.time
528
529 test:   tests
530
531 tests: rehash
532         @(cd test && echo "testing..." && \
533         $(CLEARENV) && $(MAKE) -e $(BUILDENV) TOP=.. TESTS='${TESTS}' OPENSSL_DEBUG_MEMORY=on tests );
534         util/opensslwrap.sh version -a
535
536 report:
537         @$(PERL) util/selftest.pl
538
539 depend:
540         @set -e; target=depend; $(RECURSIVE_BUILD_CMD)
541
542 lint:
543         @set -e; target=lint; $(RECURSIVE_BUILD_CMD)
544
545 tags:
546         rm -f TAGS
547         find . -name '[^.]*.[ch]' | xargs etags -a
548
549 errors:
550         $(PERL) util/mkerr.pl -recurse -write
551         (cd engines; $(MAKE) PERL=$(PERL) errors)
552         $(PERL) util/ck_errf.pl */*.c */*/*.c
553
554 stacks:
555         $(PERL) util/mkstack.pl -write
556
557 util/libeay.num::
558         $(PERL) util/mkdef.pl crypto update
559
560 util/ssleay.num::
561         $(PERL) util/mkdef.pl ssl update
562
563 crypto/objects/obj_dat.h: crypto/objects/obj_dat.pl crypto/objects/obj_mac.h
564         $(PERL) crypto/objects/obj_dat.pl crypto/objects/obj_mac.h crypto/objects/obj_dat.h
565 crypto/objects/obj_mac.h: crypto/objects/objects.pl crypto/objects/objects.txt crypto/objects/obj_mac.num
566         $(PERL) crypto/objects/objects.pl crypto/objects/objects.txt crypto/objects/obj_mac.num crypto/objects/obj_mac.h
567
568 apps/openssl-vms.cnf: apps/openssl.cnf
569         $(PERL) VMS/VMSify-conf.pl < apps/openssl.cnf > apps/openssl-vms.cnf
570
571 crypto/bn/bn_prime.h: crypto/bn/bn_prime.pl
572         $(PERL) crypto/bn/bn_prime.pl >crypto/bn/bn_prime.h
573
574
575 TABLE: Configure
576         (echo 'Output of `Configure TABLE'"':"; \
577         $(PERL) Configure TABLE) > TABLE
578
579 update: errors stacks util/libeay.num util/ssleay.num crypto/objects/obj_dat.h apps/openssl-vms.cnf crypto/bn/bn_prime.h TABLE depend
580
581 # Build distribution tar-file. As the list of files returned by "find" is
582 # pretty long, on several platforms a "too many arguments" error or similar
583 # would occur. Therefore the list of files is temporarily stored into a file
584 # and read directly, requiring GNU-Tar. Call "make TAR=gtar dist" if the normal
585 # tar does not support the --files-from option.
586 tar:
587         find . -type d -print | xargs chmod 755
588         find . -type f -print | xargs chmod a+r
589         find . -type f -perm -0100 -print | xargs chmod a+x
590         find * \! -path CVS/\* \! -path \*/CVS/\* \! -name CVS \! -name .cvsignore \! -name STATUS \! -name TABLE | sort > ../$(TARFILE).list; \
591         $(TAR) $(TARFLAGS) --files-from ../$(TARFILE).list -cvf - | \
592         tardy --user_number=0  --user_name=openssl \
593               --group_number=0 --group_name=openssl \
594               --prefix=openssl-$(VERSION) - |\
595         gzip --best >../$(TARFILE).gz; \
596         rm -f ../$(TARFILE).list; \
597         ls -l ../$(TARFILE).gz
598
599 tar-snap:
600         @$(TAR) $(TARFLAGS) -cvf - \
601                 `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` |\
602         tardy --user_number=0  --user_name=openssl \
603               --group_number=0 --group_name=openssl \
604               --prefix=openssl-$(VERSION) - > ../$(TARFILE);\
605         ls -l ../$(TARFILE)
606
607 dist:   
608         $(PERL) Configure dist
609         @$(MAKE) dist_pem_h
610         @$(MAKE) SDIRS='${SDIRS}' clean
611         @$(MAKE) TAR='${TAR}' TARFLAGS='${TARFLAGS}' tar
612
613 dist_pem_h:
614         (cd crypto/pem; $(MAKE) -e $(BUILDENV) pem.h; $(MAKE) clean)
615
616 install: all install_docs install_sw
617
618 install_sw:
619         @$(PERL) $(TOP)/util/mkdir-p.pl $(INSTALL_PREFIX)$(INSTALLTOP)/bin \
620                 $(INSTALL_PREFIX)$(INSTALLTOP)/lib \
621                 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/engines \
622                 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/pkgconfig \
623                 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl \
624                 $(INSTALL_PREFIX)$(OPENSSLDIR)/misc \
625                 $(INSTALL_PREFIX)$(OPENSSLDIR)/certs \
626                 $(INSTALL_PREFIX)$(OPENSSLDIR)/private
627         @set -e; headerlist="$(EXHEADER)"; for i in $$headerlist;\
628         do \
629         (cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \
630         chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \
631         done;
632         @set -e; target=install; $(RECURSIVE_BUILD_CMD)
633         @set -e; for i in $(LIBS) ;\
634         do \
635                 if [ -f "$$i" ]; then \
636                 (       echo installing $$i; \
637                         cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \
638                         $(RANLIB) $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \
639                         chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \
640                         mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i ); \
641                 fi; \
642         done;
643         @set -e; if [ -n "$(SHARED_LIBS)" ]; then \
644                 tmp="$(SHARED_LIBS)"; \
645                 for i in $${tmp:-x}; \
646                 do \
647                         if [ -f "$$i" -o -f "$$i.a" ]; then \
648                         (       echo installing $$i; \
649                                 if [ "$(PLATFORM)" != "Cygwin" ]; then \
650                                         cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \
651                                         chmod 555 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \
652                                         mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i; \
653                                 else \
654                                         c=`echo $$i | sed 's/^lib\(.*\)\.dll\.a/cyg\1-$(SHLIB_VERSION_NUMBER).dll/'`; \
655                                         cp $$c $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new; \
656                                         chmod 755 $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new; \
657                                         mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c; \
658                                         cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \
659                                         chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \
660                                         mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i; \
661                                 fi ); \
662                         fi; \
663                 done; \
664                 (       here="`pwd`"; \
665                         cd $(INSTALL_PREFIX)$(INSTALLTOP)/lib; \
666                         $(MAKE) -f $$here/Makefile HERE="$$here" link-shared ); \
667                 if [ "$(INSTALLTOP)" != "/usr" ]; then \
668                         echo 'OpenSSL shared libraries have been installed in:'; \
669                         echo '  $(INSTALLTOP)'; \
670                         echo ''; \
671                         sed -e '1,/^$$/d' doc/openssl-shared.txt; \
672                 fi; \
673         fi
674         cp libcrypto.pc $(INSTALL_PREFIX)$(INSTALLTOP)/lib/pkgconfig
675         chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/pkgconfig/libcrypto.pc
676         cp libssl.pc $(INSTALL_PREFIX)$(INSTALLTOP)/lib/pkgconfig
677         chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/pkgconfig/libssl.pc
678         cp openssl.pc $(INSTALL_PREFIX)$(INSTALLTOP)/lib/pkgconfig
679         chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/pkgconfig/openssl.pc
680
681 install_docs:
682         @$(PERL) $(TOP)/util/mkdir-p.pl \
683                 $(INSTALL_PREFIX)$(MANDIR)/man1 \
684                 $(INSTALL_PREFIX)$(MANDIR)/man3 \
685                 $(INSTALL_PREFIX)$(MANDIR)/man5 \
686                 $(INSTALL_PREFIX)$(MANDIR)/man7
687         @pod2man="`cd util; ./pod2mantest $(PERL)`"; \
688         here="`pwd`"; \
689         filecase=; \
690         if [ "$(PLATFORM)" = "DJGPP" -o "$(PLATFORM)" = "Cygwin" -o "$(PLATFORM)" = "mingw" ]; then \
691                 filecase=-i; \
692         fi; \
693         set -e; for i in doc/apps/*.pod; do \
694                 fn=`basename $$i .pod`; \
695                 sec=`$(PERL) util/extract-section.pl 1 < $$i`; \
696                 echo "installing man$$sec/$$fn.$${sec}$(MANSUFFIX)"; \
697                 (cd `$(PERL) util/dirname.pl $$i`; \
698                 sh -c "$$pod2man \
699                         --section=$$sec --center=OpenSSL \
700                         --release=$(VERSION) `basename $$i`") \
701                         >  $(INSTALL_PREFIX)$(MANDIR)/man$$sec/$$fn.$${sec}$(MANSUFFIX); \
702                 $(PERL) util/extract-names.pl < $$i | \
703                         (grep -v $$filecase "^$$fn\$$"; true) | \
704                         (grep -v "[     ]"; true) | \
705                         (cd $(INSTALL_PREFIX)$(MANDIR)/man$$sec/; \
706                          while read n; do \
707                                 $$here/util/point.sh $$fn.$${sec}$(MANSUFFIX) "$$n".$${sec}$(MANSUFFIX); \
708                          done); \
709         done; \
710         set -e; for i in doc/crypto/*.pod doc/ssl/*.pod; do \
711                 fn=`basename $$i .pod`; \
712                 sec=`$(PERL) util/extract-section.pl 3 < $$i`; \
713                 echo "installing man$$sec/$$fn.$${sec}$(MANSUFFIX)"; \
714                 (cd `$(PERL) util/dirname.pl $$i`; \
715                 sh -c "$$pod2man \
716                         --section=$$sec --center=OpenSSL \
717                         --release=$(VERSION) `basename $$i`") \
718                         >  $(INSTALL_PREFIX)$(MANDIR)/man$$sec/$$fn.$${sec}$(MANSUFFIX); \
719                 $(PERL) util/extract-names.pl < $$i | \
720                         (grep -v $$filecase "^$$fn\$$"; true) | \
721                         (grep -v "[     ]"; true) | \
722                         (cd $(INSTALL_PREFIX)$(MANDIR)/man$$sec/; \
723                          while read n; do \
724                                 $$here/util/point.sh $$fn.$${sec}$(MANSUFFIX) "$$n".$${sec}$(MANSUFFIX); \
725                          done); \
726         done
727
728 # DO NOT DELETE THIS LINE -- make depend depends on it.