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