Opportunistic change to work around pod2latex bug: rename NAME OPTIONS
[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 # INSTALL_PREFIX is for package builders so that they can configure
19 # for, say, /usr/ and yet have everything installed to /tmp/somedir/usr/.
20 # Normally it is left empty.
21 INSTALL_PREFIX=
22 INSTALLTOP=/usr/local/ssl
23
24 # Do not edit this manually. Use Configure --openssldir=DIR do change this!
25 OPENSSLDIR=/usr/local/ssl
26
27 # NO_IDEA - Define to build without the IDEA algorithm
28 # NO_RC4  - Define to build without the RC4 algorithm
29 # NO_RC2  - Define to build without the RC2 algorithm
30 # THREADS - Define when building with threads, you will probably also need any
31 #           system defines as well, i.e. _REENTERANT for Solaris 2.[34]
32 # TERMIO  - Define the termio terminal subsystem, needed if sgtty is missing.
33 # TERMIOS - Define the termios terminal subsystem, Silicon Graphics.
34 # LONGCRYPT - Define to use HPUX 10.x's long password modification to crypt(3).
35 # DEVRANDOM - Give this the value of the 'random device' if your OS supports
36 #           one.  32 bytes will be read from this when the random
37 #           number generator is initalised.
38 # SSL_FORBID_ENULL - define if you want the server to be not able to use the
39 #           NULL encryption ciphers.
40 #
41 # LOCK_DEBUG - turns on lots of lock debug output :-)
42 # REF_CHECK - turn on some xyz_free() assertions.
43 # REF_PRINT - prints some stuff on structure free.
44 # CRYPTO_MDEBUG - turns on my 'memory leak' detecting stuff
45 # MFUNC - Make all Malloc/Free/Realloc calls call
46 #       CRYPTO_malloc/CRYPTO_free/CRYPTO_realloc which can be setup to
47 #       call application defined callbacks via CRYPTO_set_mem_functions()
48 # MD5_ASM needs to be defined to use the x86 assembler for MD5
49 # SHA1_ASM needs to be defined to use the x86 assembler for SHA1
50 # RMD160_ASM needs to be defined to use the x86 assembler for RIPEMD160
51 # Do not define B_ENDIAN or L_ENDIAN if 'unsigned long' == 8.  It must
52 # equal 4.
53 # PKCS1_CHECK - pkcs1 tests.
54
55 CC= gcc
56 #CFLAG= -DL_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -m486 -Wall -Wuninitialized -DSHA1_ASM -DMD5_ASM -DRMD160_ASM
57 CFLAG= -DTERMIOS -DL_ENDIAN -fomit-frame-pointer -O3 -m486 -Wall -DSHA1_ASM -DMD5_ASM -DRMD160_ASM
58 DEPFLAG= 
59 PEX_LIBS= 
60 EX_LIBS= 
61 EXE_EXT= 
62 ARFLAGS=
63 AR=ar $(ARFLAGS) r
64 RANLIB= ranlib
65 PERL= perl
66 TAR= tar
67 TARFLAGS= --no-recursion
68 MAKEDEPPROG=makedepend
69
70 # Set BN_ASM to bn_asm.o if you want to use the C version
71 BN_ASM= bn_asm.o
72 #BN_ASM= bn_asm.o
73 #BN_ASM= asm/bn86-elf.o # elf, linux-elf
74 #BN_ASM= asm/bn86-sol.o # solaris
75 #BN_ASM= asm/bn86-out.o # a.out, FreeBSD
76 #BN_ASM= asm/bn86bsdi.o # bsdi
77 #BN_ASM= asm/alpha.o    # DEC Alpha
78 #BN_ASM= asm/pa-risc2.o # HP-UX PA-RISC
79 #BN_ASM= asm/r3000.o    # SGI MIPS cpu
80 #BN_ASM= asm/sparc.o    # Sun solaris/SunOS
81 #BN_ASM= asm/bn-win32.o # Windows 95/NT
82 #BN_ASM= asm/x86w16.o   # 16 bit code for Windows 3.1/DOS
83 #BN_ASM= asm/x86w32.o   # 32 bit code for Windows 3.1
84
85 # For x86 assembler: Set PROCESSOR to 386 if you want to support
86 # the 80386.
87 PROCESSOR=
88
89 # Set DES_ENC to des_enc.o if you want to use the C version
90 #There are 4 x86 assember options.
91 DES_ENC= asm/dx86-out.o asm/yx86-out.o
92 #DES_ENC= des_enc.o fcrypt_b.o          # C
93 #DES_ENC= asm/dx86-elf.o asm/yx86-elf.o # elf
94 #DES_ENC= asm/dx86-sol.o asm/yx86-sol.o # solaris
95 #DES_ENC= asm/dx86-out.o asm/yx86-out.o # a.out, FreeBSD
96 #DES_ENC= asm/dx86bsdi.o asm/yx86bsdi.o # bsdi
97
98 # Set BF_ENC to bf_enc.o if you want to use the C version
99 #There are 4 x86 assember options.
100 BF_ENC= asm/bx86-out.o
101 #BF_ENC= bf_enc.o
102 #BF_ENC= asm/bx86-elf.o # elf
103 #BF_ENC= asm/bx86-sol.o # solaris
104 #BF_ENC= asm/bx86-out.o # a.out, FreeBSD
105 #BF_ENC= asm/bx86bsdi.o # bsdi
106
107 # Set CAST_ENC to c_enc.o if you want to use the C version
108 #There are 4 x86 assember options.
109 CAST_ENC= asm/cx86-out.o
110 #CAST_ENC= c_enc.o
111 #CAST_ENC= asm/cx86-elf.o # elf
112 #CAST_ENC= asm/cx86-sol.o # solaris
113 #CAST_ENC= asm/cx86-out.o # a.out, FreeBSD
114 #CAST_ENC= asm/cx86bsdi.o # bsdi
115
116 # Set RC4_ENC to rc4_enc.o if you want to use the C version
117 #There are 4 x86 assember options.
118 RC4_ENC= asm/rx86-out.o
119 #RC4_ENC= rc4_enc.o
120 #RC4_ENC= asm/rx86-elf.o # elf
121 #RC4_ENC= asm/rx86-sol.o # solaris
122 #RC4_ENC= asm/rx86-out.o # a.out, FreeBSD
123 #RC4_ENC= asm/rx86bsdi.o # bsdi
124
125 # Set RC5_ENC to rc5_enc.o if you want to use the C version
126 #There are 4 x86 assember options.
127 RC5_ENC= asm/r586-out.o
128 #RC5_ENC= rc5_enc.o
129 #RC5_ENC= asm/r586-elf.o # elf
130 #RC5_ENC= asm/r586-sol.o # solaris
131 #RC5_ENC= asm/r586-out.o # a.out, FreeBSD
132 #RC5_ENC= asm/r586bsdi.o # bsdi
133
134 # Also need MD5_ASM defined
135 MD5_ASM_OBJ= asm/mx86-out.o
136 #MD5_ASM_OBJ= asm/mx86-elf.o        # elf
137 #MD5_ASM_OBJ= asm/mx86-sol.o        # solaris
138 #MD5_ASM_OBJ= asm/mx86-out.o        # a.out, FreeBSD
139 #MD5_ASM_OBJ= asm/mx86bsdi.o        # bsdi
140
141 # Also need SHA1_ASM defined
142 SHA1_ASM_OBJ= asm/sx86-out.o
143 #SHA1_ASM_OBJ= asm/sx86-elf.o       # elf
144 #SHA1_ASM_OBJ= asm/sx86-sol.o       # solaris
145 #SHA1_ASM_OBJ= asm/sx86-out.o       # a.out, FreeBSD
146 #SHA1_ASM_OBJ= asm/sx86bsdi.o       # bsdi
147
148 # Also need RMD160_ASM defined
149 RMD160_ASM_OBJ= asm/rm86-out.o
150 #RMD160_ASM_OBJ= asm/rm86-elf.o       # elf
151 #RMD160_ASM_OBJ= asm/rm86-sol.o       # solaris
152 #RMD160_ASM_OBJ= asm/rm86-out.o       # a.out, FreeBSD
153 #RMD160_ASM_OBJ= asm/rm86bsdi.o       # bsdi
154
155 # KRB5 stuff
156 KRB5_INCLUDES=
157 LIBKRB5=
158
159 DIRS=   crypto ssl engines apps test tools
160 SHLIBDIRS= crypto ssl
161
162 # dirs in crypto to build
163 SDIRS=  \
164         md2 md4 md5 sha mdc2 hmac ripemd \
165         des rc2 rc4 rc5 idea bf cast \
166         bn ec rsa dsa ecdsa dh ecdh dso engine aes \
167         buffer bio stack lhash rand err objects \
168         evp asn1 pem x509 x509v3 conf txt_db pkcs7 pkcs12 comp ocsp ui krb5
169
170 # tests to perform.  "alltests" is a special word indicating that all tests
171 # should be performed.
172 TESTS = alltests
173
174 MAKEFILE= Makefile.ssl
175 NEWMAKE=  make
176 MAKE=     $(NEWMAKE) -f Makefile.ssl
177
178 MANDIR=$(OPENSSLDIR)/man
179 MAN1=1
180 MAN3=3
181 SHELL=/bin/sh
182
183 TOP=    .
184 ONEDIRS=out tmp
185 EDIRS=  times doc bugs util include certs ms shlib mt demos perl sf dep VMS
186 WDIRS=  windows
187 LIBS=   libcrypto.a libssl.a
188 SHARED_CRYPTO=libcrypto$(SHLIB_EXT)
189 SHARED_SSL=libssl$(SHLIB_EXT)
190 SHARED_LIBS=
191 SHARED_LIBS_LINK_EXTS=
192 SHARED_LDFLAGS=
193
194 GENERAL=        Makefile
195 BASENAME=       openssl
196 NAME=           $(BASENAME)-$(VERSION)
197 TARFILE=        $(NAME).tar
198 WTARFILE=       $(NAME)-win.tar
199 EXHEADER=       e_os2.h
200 HEADER=         e_os.h
201
202 all: Makefile.ssl build_all openssl.pc
203
204 BUILD_CMD=if echo " $(DIRS) " | grep " $$i " >/dev/null 2>/dev/null; then \
205         if [ -d "$$i" ]; then \
206                 (cd $$i && echo "making all in $$i..." && \
207                 $(MAKE) CC='${CC}' PLATFORM='${PLATFORM}' CFLAG='${CFLAG}' SDIRS='$(SDIRS)' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' BN_ASM='${BN_ASM}' DES_ENC='${DES_ENC}' BF_ENC='${BF_ENC}' CAST_ENC='${CAST_ENC}' RC4_ENC='${RC4_ENC}' RC5_ENC='${RC5_ENC}' SHA1_ASM_OBJ='${SHA1_ASM_OBJ}' MD5_ASM_OBJ='${MD5_ASM_OBJ}' RMD160_ASM_OBJ='${RMD160_ASM_OBJ}' AR='${AR}' PROCESSOR='${PROCESSOR}' PERL='${PERL}' RANLIB='${RANLIB}' KRB5_INCLUDES='${KRB5_INCLUDES}' LIBKRB5='${LIBKRB5}' EXE_EXT='${EXE_EXT}' SHARED_LIBS='${SHARED_LIBS}' SHLIB_EXT='${SHLIB_EXT}' SHLIB_TARGET='${SHLIB_TARGET}' all ) || exit 1; \
208         else \
209                 $(MAKE) $$i; \
210         fi; fi
211
212 sub_all: build_all
213 build_all: build_libs build_apps build_tests build_tools
214
215 build_libs: build_crypto build_ssl build_engines
216
217 build_crypto:
218         @i=crypto; $(BUILD_CMD)
219 build_ssl:
220         @i=ssl; $(BUILD_CMD)
221 build_engines:
222         @i=engines; $(BUILD_CMD)
223 build_apps:
224         @i=apps; $(BUILD_CMD)
225 build_tests:
226         @i=test; $(BUILD_CMD)
227 build_tools:
228         @i=tools; $(BUILD_CMD)
229
230 libcrypto$(SHLIB_EXT): libcrypto.a
231         @if [ "$(SHLIB_TARGET)" != "" ]; then \
232                 $(MAKE) SHLIBDIRS=crypto build-shared; \
233         else \
234                 echo "There's no support for shared libraries on this platform" >&2; \
235         fi
236
237 libssl$(SHLIB_EXT): libcrypto$(SHLIB_EXT) libssl.a
238         @if [ "$(SHLIB_TARGET)" != "" ]; then \
239                 $(MAKE) SHLIBDIRS=ssl SHLIBDEPS='-lcrypto' build-shared; \
240         else \
241                 echo "There's no support for shared libraries on this platform" >&2; \
242         fi
243
244 clean-shared:
245         @for i in $(SHLIBDIRS); do \
246                 if [ -n "$(SHARED_LIBS_LINK_EXTS)" ]; then \
247                         tmp="$(SHARED_LIBS_LINK_EXTS)"; \
248                         for j in $${tmp:-x}; do \
249                                 ( set -x; rm -f lib$$i$$j ); \
250                         done; \
251                 fi; \
252                 ( set -x; rm -f lib$$i$(SHLIB_EXT) ); \
253                 if [ "$(PLATFORM)" = "Cygwin" ]; then \
254                         ( set -x; rm -f cyg$$i$(SHLIB_EXT) lib$$i$(SHLIB_EXT).a ); \
255                 fi; \
256         done
257
258 link-shared:
259         @ for i in ${SHLIBDIRS}; do \
260                 $(NEWMAKE) -f Makefile.shared \
261                         LIBNAME=$$i LIBVERSION=${SHLIB_MAJOR}.${SHLIB_MINOR} \
262                         LIBCOMPATVERSIONS=";${SHLIB_VERSION_HISTORY}" \
263                         symlink.$(SHLIB_TARGET); \
264                 libs="$$libs -l$$i"; \
265         done
266
267 build-shared: do_$(SHLIB_TARGET) link-shared
268
269 do_$(SHLIB_TARGET):
270         @ libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \
271                 $(NEWMAKE) -f Makefile.shared \
272                         CC="$(CC)" LDFLAGS="$(LDFLAGS)" \
273                         SHARED_LDFLAGS="$(SHARED_LDFLAGS)" \
274                         LIBNAME=$$i LIBVERSION=${SHLIB_MAJOR}.${SHLIB_MINOR} \
275                         LIBCOMPATVERSIONS=";${SHLIB_VERSION_HISTORY}" \
276                         LIBDEPS="$$libs $(EX_LIBS)" \
277                         link_a.$(SHLIB_TARGET); \
278                 libs="$$libs -l$$i"; \
279         done
280
281 openssl.pc:
282         @ ( echo 'prefix=$(INSTALLTOP)'; \
283             echo 'exec_prefix=$${prefix}'; \
284             echo 'libdir=$${exec_prefix}/lib'; \
285             echo 'includedir=$${prefix}/include'; \
286             echo ''; \
287             echo 'Name: OpenSSL'; \
288             echo 'Description: Secure Sockets Layer and cryptography libraries and tools'; \
289             echo 'Version: '$(VERSION); \
290             echo 'Requires: '; \
291             echo 'Libs: -L$${libdir} -lssl -lcrypto $(EX_LIBS)'; \
292             echo 'Cflags: -I$${includedir}' ) > openssl.pc
293
294 Makefile.ssl: Makefile.org
295         @echo "Makefile.ssl is older than Makefile.org."
296         @echo "Reconfigure the source tree (via './config' or 'perl Configure'), please."
297         @false
298
299 libclean:
300         rm -f *.so *.so.* engines/*.so *.a */lib */*/lib
301
302 clean:
303         rm -f shlib/*.o *.o core a.out fluff *.map rehash.time testlog make.log cctest cctest.c
304         @for i in $(DIRS) ;\
305         do \
306         if [ -d "$$i" ]; then \
307                 (cd $$i && echo "making clean in $$i..." && \
308                 $(MAKE) SDIRS='${SDIRS}' clean ) || exit 1; \
309                 rm -f $(LIBS); \
310         fi; \
311         done;
312         rm -f openssl.pc
313         rm -f *.a *.o speed.* *.map *.so .pure core
314         rm -f $(TARFILE)
315         @for i in $(ONEDIRS) ;\
316         do \
317         rm -fr $$i/*; \
318         done
319
320 makefile.one: files
321         $(PERL) util/mk1mf.pl >makefile.one; \
322         sh util/do_ms.sh
323
324 files:
325         $(PERL) $(TOP)/util/files.pl Makefile.ssl > $(TOP)/MINFO
326         @for i in $(DIRS) ;\
327         do \
328         if [ -d "$$i" ]; then \
329                 (cd $$i && echo "making 'files' in $$i..." && \
330                 $(MAKE) SDIRS='${SDIRS}' PERL='${PERL}' files ) || exit 1; \
331         fi; \
332         done;
333
334 links:
335         @$(TOP)/util/point.sh Makefile.ssl Makefile
336         @$(PERL) $(TOP)/util/mkdir-p.pl include/openssl
337         @$(PERL) $(TOP)/util/mklink.pl include/openssl $(EXHEADER)
338         @for i in $(DIRS); do \
339         if [ -d "$$i" ]; then \
340                 (cd $$i && echo "making links in $$i..." && \
341                 $(MAKE) CC='${CC}' PLATFORM='${PLATFORM}' CFLAG='${CFLAG}' SDIRS='$(SDIRS)' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' BN_ASM='${BN_ASM}' DES_ENC='${DES_ENC}' BF_ENC='${BF_ENC}' CAST_ENC='${CAST_ENC}' RC4_ENC='${RC4_ENC}' RC5_ENC='${RC5_ENC}' SHA1_ASM_OBJ='${SHA1_ASM_OBJ}' MD5_ASM_OBJ='${MD5_ASM_OBJ}' RMD160_ASM_OBJ='${RMD160_ASM_OBJ}' AR='${AR}' PERL='${PERL}' KRB5_INCLUDES='${KRB5_INCLUDES}' LIBKRB5='${LIBKRB5}' links ) || exit 1; \
342         fi; \
343         done;
344
345 gentests:
346         @(cd test && echo "generating dummy tests (if needed)..." && \
347         $(MAKE) CC='${CC}' PLATFORM='${PLATFORM}' CFLAG='${CFLAG}' SDIRS='$(SDIRS)' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' BN_ASM='${BN_ASM}' DES_ENC='${DES_ENC}' BF_ENC='${BF_ENC}' CAST_ENC='${CAST_ENC}' RC4_ENC='${RC4_ENC}' RC5_ENC='${RC5_ENC}' SHA1_ASM_OBJ='${SHA1_ASM_OBJ}' MD5_ASM_OBJ='${MD5_ASM_OBJ}' RMD160_ASM_OBJ='${RMD160_ASM_OBJ}' AR='${AR}' PROCESSOR='${PROCESSOR}' PERL='${PERL}' RANLIB='${RANLIB}' TESTS='${TESTS}' KRB5_INCLUDES='${KRB5_INCLUDES}' LIBKRB5='${LIBKRB5}' EXE_EXT='${EXE_EXT}' SHARED_LIBS='${SHARED_LIBS}' SHLIB_EXT='${SHLIB_EXT}' SHLIB_TARGET='${SHLIB_TARGET}' TESTS='${TESTS}' OPENSSL_DEBUG_MEMORY=on generate );
348
349 dclean:
350         rm -f *.bak
351         @for i in $(DIRS) ;\
352         do \
353         if [ -d "$$i" ]; then \
354                 (cd $$i && echo "making dclean in $$i..." && \
355                 $(MAKE) SDIRS='${SDIRS}' PERL='${PERL}' dclean ) || exit 1; \
356         fi; \
357         done;
358
359 rehash: rehash.time
360 rehash.time: certs
361         @(OPENSSL="`pwd`/apps/openssl"; OPENSSL_DEBUG_MEMORY=on; \
362                 export OPENSSL OPENSSL_DEBUG_MEMORY; \
363                 LD_LIBRARY_PATH="`pwd`"; DYLD_LIBRARY_PATH="`pwd`"; SHLIB_PATH="`pwd`"; LIBPATH="`pwd`"; \
364                 export LD_LIBRARY_PATH DYLD_LIBRARY_PATH SHLIB_PATH LIBPATH; \
365                 $(PERL) tools/c_rehash certs)
366         touch rehash.time
367
368 test:   tests
369
370 tests: rehash
371         @(cd test && echo "testing..." && \
372         $(MAKE) CC='${CC}' PLATFORM='${PLATFORM}' CFLAG='${CFLAG}' SDIRS='$(SDIRS)' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' BN_ASM='${BN_ASM}' DES_ENC='${DES_ENC}' BF_ENC='${BF_ENC}' CAST_ENC='${CAST_ENC}' RC4_ENC='${RC4_ENC}' RC5_ENC='${RC5_ENC}' SHA1_ASM_OBJ='${SHA1_ASM_OBJ}' MD5_ASM_OBJ='${MD5_ASM_OBJ}' RMD160_ASM_OBJ='${RMD160_ASM_OBJ}' AR='${AR}' PROCESSOR='${PROCESSOR}' PERL='${PERL}' RANLIB='${RANLIB}' TESTS='${TESTS}' KRB5_INCLUDES='${KRB5_INCLUDES}' LIBKRB5='${LIBKRB5}' EXE_EXT='${EXE_EXT}' SHARED_LIBS='${SHARED_LIBS}' SHLIB_EXT='${SHLIB_EXT}' SHLIB_TARGET='${SHLIB_TARGET}' TESTS='${TESTS}' OPENSSL_DEBUG_MEMORY=on tests );
373         @LD_LIBRARY_PATH="`pwd`"; DYLD_LIBRARY_PATH="`pwd`"; SHLIB_PATH="`pwd`"; LIBPATH="`pwd`"; \
374                 export LD_LIBRARY_PATH DYLD_LIBRARY_PATH SHLIB_PATH LIBPATH; \
375                 apps/openssl version -a
376
377 report:
378         @$(PERL) util/selftest.pl
379
380 depend:
381         @for i in $(DIRS) ;\
382         do \
383         if [ -d "$$i" ]; then \
384                 (cd $$i && echo "making dependencies $$i..." && \
385                 $(MAKE) SDIRS='${SDIRS}' CFLAG='${CFLAG}' DEPFLAG='${DEPFLAG}' MAKEDEPPROG='${MAKEDEPPROG}' KRB5_INCLUDES='${KRB5_INCLUDES}' PERL='${PERL}' depend ) || exit 1; \
386         fi; \
387         done;
388
389 lint:
390         @for i in $(DIRS) ;\
391         do \
392         if [ -d "$$i" ]; then \
393                 (cd $$i && echo "making lint $$i..." && \
394                 $(MAKE) SDIRS='${SDIRS}' lint ) || exit 1; \
395         fi; \
396         done;
397
398 tags:
399         @for i in $(DIRS) ;\
400         do \
401         if [ -d "$$i" ]; then \
402                 (cd $$i && echo "making tags $$i..." && \
403                 $(MAKE) SDIRS='${SDIRS}' tags ) || exit 1; \
404         fi; \
405         done;
406
407 errors:
408         $(PERL) util/mkerr.pl -recurse -write
409         (cd engines; $(MAKE) PERL=$(PERL) errors)
410
411 stacks:
412         $(PERL) util/mkstack.pl -write
413
414 util/libeay.num::
415         $(PERL) util/mkdef.pl crypto update
416
417 util/ssleay.num::
418         $(PERL) util/mkdef.pl ssl update
419
420 crypto/objects/obj_dat.h: crypto/objects/obj_dat.pl crypto/objects/obj_mac.h
421         $(PERL) crypto/objects/obj_dat.pl crypto/objects/obj_mac.h crypto/objects/obj_dat.h
422 crypto/objects/obj_mac.h: crypto/objects/objects.pl crypto/objects/objects.txt crypto/objects/obj_mac.num
423         $(PERL) crypto/objects/objects.pl crypto/objects/objects.txt crypto/objects/obj_mac.num crypto/objects/obj_mac.h
424
425 TABLE: Configure
426         (echo 'Output of `Configure TABLE'"':"; \
427         $(PERL) Configure TABLE) > TABLE
428
429 update: depend errors stacks util/libeay.num util/ssleay.num crypto/objects/obj_dat.h TABLE
430
431 # Build distribution tar-file. As the list of files returned by "find" is
432 # pretty long, on several platforms a "too many arguments" error or similar
433 # would occur. Therefore the list of files is temporarily stored into a file
434 # and read directly, requiring GNU-Tar. Call "make TAR=gtar dist" if the normal
435 # tar does not support the --files-from option.
436 tar:
437         find . -type d -print | xargs chmod 755
438         find . -type f -print | xargs chmod a+r
439         find . -type f -perm -0100 -print | xargs chmod a+x
440         find * \! -path CVS/\* \! -path \*/CVS/\* \! -name CVS \! -name .cvsignore \! -name STATUS \! -name TABLE | sort > ../$(TARFILE).list; \
441         $(TAR) $(TARFLAGS) --files-from ../$(TARFILE).list -cvf - | \
442         tardy --user_number=0  --user_name=openssl \
443               --group_number=0 --group_name=openssl \
444               --prefix=openssl-$(VERSION) - |\
445         gzip --best >../$(TARFILE).gz; \
446         rm -f ../$(TARFILE).list; \
447         ls -l ../$(TARFILE).gz
448
449 tar-snap:
450         @$(TAR) $(TARFLAGS) -cvf - \
451                 `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` |\
452         tardy --user_number=0  --user_name=openssl \
453               --group_number=0 --group_name=openssl \
454               --prefix=openssl-$(VERSION) - > ../$(TARFILE);\
455         ls -l ../$(TARFILE)
456
457 dist:   
458         $(PERL) Configure dist
459         @$(MAKE) dist_pem_h
460         @$(MAKE) SDIRS='${SDIRS}' clean
461         @$(MAKE) TAR='${TAR}' TARFLAGS='${TARFLAGS}' tar
462
463 dist_pem_h:
464         (cd crypto/pem; $(MAKE) CC='${CC}' SDIRS='${SDIRS}' CFLAG='${CFLAG}' pem.h; $(MAKE) clean)
465
466 install: all install_docs
467         @$(PERL) $(TOP)/util/mkdir-p.pl $(INSTALL_PREFIX)$(INSTALLTOP)/bin \
468                 $(INSTALL_PREFIX)$(INSTALLTOP)/lib \
469                 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/pkginfo \
470                 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl \
471                 $(INSTALL_PREFIX)$(OPENSSLDIR)/engines \
472                 $(INSTALL_PREFIX)$(OPENSSLDIR)/misc \
473                 $(INSTALL_PREFIX)$(OPENSSLDIR)/certs \
474                 $(INSTALL_PREFIX)$(OPENSSLDIR)/private \
475                 $(INSTALL_PREFIX)$(OPENSSLDIR)/lib
476         @for i in $(EXHEADER) ;\
477         do \
478         (cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \
479         chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \
480         done;
481         @for i in $(DIRS) ;\
482         do \
483         if [ -d "$$i" ]; then \
484                 (cd $$i; echo "installing $$i..."; \
485                 $(MAKE) CC='${CC}' CFLAG='${CFLAG}' INSTALL_PREFIX='${INSTALL_PREFIX}' INSTALLTOP='${INSTALLTOP}' OPENSSLDIR='${OPENSSLDIR}' EX_LIBS='${EX_LIBS}' SDIRS='${SDIRS}' RANLIB='${RANLIB}' EXE_EXT='${EXE_EXT}' SHARED_LIBS='${SHARED_LIBS}' install ); \
486         fi; \
487         done
488         @for i in $(LIBS) ;\
489         do \
490                 if [ -f "$$i" ]; then \
491                 (       echo installing $$i; \
492                         cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \
493                         $(RANLIB) $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \
494                         chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \
495                         mv $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i ); \
496                 fi; \
497         done;
498         @if [ -n "$(SHARED_LIBS)" ]; then \
499                 tmp="$(SHARED_LIBS)"; \
500                 for i in $${tmp:-x}; \
501                 do \
502                         if [ -f "$$i" -o -f "$$i.a" ]; then \
503                         (       echo installing $$i; \
504                                 if [ "$(PLATFORM)" != "Cygwin" ]; then \
505                                         cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \
506                                         chmod 555 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \
507                                         mv $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i; \
508                                 else \
509                                         c=`echo $$i | sed 's/^lib/cyg/'`; \
510                                         cp $$c $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new; \
511                                         chmod 755 $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new; \
512                                         mv $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c; \
513                                         cp $$i.a $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.a.new; \
514                                         chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.a.new; \
515                                         mv $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.a.new $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.a; \
516                                 fi ); \
517                         fi; \
518                 done; \
519                 (       here="`pwd`"; \
520                         cd $(INSTALL_PREFIX)$(INSTALLTOP)/lib; \
521                         $(NEWMAKE) -f $$here/Makefile link-shared ); \
522         fi
523         cp openssl.pc $(INSTALL_PREFIX)$(INSTALLTOP)/lib/pkginfo
524
525 install_docs:
526         @$(PERL) $(TOP)/util/mkdir-p.pl \
527                 $(INSTALL_PREFIX)$(MANDIR)/man1 \
528                 $(INSTALL_PREFIX)$(MANDIR)/man3 \
529                 $(INSTALL_PREFIX)$(MANDIR)/man5 \
530                 $(INSTALL_PREFIX)$(MANDIR)/man7
531         @pod2man="`cd util; ./pod2mantest $(PERL)`"; \
532         for i in doc/apps/*.pod; do \
533                 fn=`basename $$i .pod`; \
534                 if [ "$$fn" = "config" ]; then sec=5; else sec=1; fi; \
535                 echo "installing man$$sec/`basename $$i .pod`.$$sec"; \
536                 (cd `$(PERL) util/dirname.pl $$i`; \
537                 sh -c "$$pod2man \
538                         --section=$$sec --center=OpenSSL \
539                         --release=$(VERSION) `basename $$i`") \
540                         >  $(INSTALL_PREFIX)$(MANDIR)/man$$sec/`basename $$i .pod`.$$sec; \
541         done; \
542         for i in doc/crypto/*.pod doc/ssl/*.pod; do \
543                 fn=`basename $$i .pod`; \
544                 if [ "$$fn" = "des_modes" ]; then sec=7; else sec=3; fi; \
545                 echo "installing man$$sec/`basename $$i .pod`.$$sec"; \
546                 (cd `$(PERL) util/dirname.pl $$i`; \
547                 sh -c "$$pod2man \
548                         --section=$$sec --center=OpenSSL \
549                         --release=$(VERSION) `basename $$i`") \
550                         >  $(INSTALL_PREFIX)$(MANDIR)/man$$sec/`basename $$i .pod`.$$sec; \
551         done
552
553 # DO NOT DELETE THIS LINE -- make depend depends on it.