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