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