Ooops! No ROTATE on some platforms after x86_64 performance patch...
[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                 if [ "$(PLATFORM)" = "DJGPP" ]; then PATH="`pwd`\;$$PATH";  \
365                 elif [ "$(PLATFORM)" != "Cygwin" ];  then PATH="`pwd`:$$PATH"; fi; \
366                 export LD_LIBRARY_PATH DYLD_LIBRARY_PATH SHLIB_PATH LIBPATH PATH; \
367                 $(PERL) tools/c_rehash certs)
368         touch rehash.time
369
370 test:   tests
371
372 tests: rehash
373         @(cd test && echo "testing..." && \
374         $(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 );
375         @LD_LIBRARY_PATH="`pwd`"; DYLD_LIBRARY_PATH="`pwd`"; SHLIB_PATH="`pwd`"; LIBPATH="`pwd`"; \
376                 if [ "$(PLATFORM)" = "DJGPP" ]; then PATH="`pwd`\;$$PATH";  \
377                 elif [ "$(PLATFORM)" != "Cygwin" ];  then PATH="`pwd`:$$PATH"; fi; \
378                 export LD_LIBRARY_PATH DYLD_LIBRARY_PATH SHLIB_PATH LIBPATH PATH; \
379                 apps/openssl version -a
380
381 report:
382         @$(PERL) util/selftest.pl
383
384 depend:
385         @for i in $(DIRS) ;\
386         do \
387         if [ -d "$$i" ]; then \
388                 (cd $$i && echo "making dependencies $$i..." && \
389                 $(MAKE) SDIRS='${SDIRS}' CFLAG='${CFLAG}' DEPFLAG='${DEPFLAG}' MAKEDEPPROG='${MAKEDEPPROG}' KRB5_INCLUDES='${KRB5_INCLUDES}' PERL='${PERL}' depend ) || exit 1; \
390         fi; \
391         done;
392
393 lint:
394         @for i in $(DIRS) ;\
395         do \
396         if [ -d "$$i" ]; then \
397                 (cd $$i && echo "making lint $$i..." && \
398                 $(MAKE) SDIRS='${SDIRS}' lint ) || exit 1; \
399         fi; \
400         done;
401
402 tags:
403         @for i in $(DIRS) ;\
404         do \
405         if [ -d "$$i" ]; then \
406                 (cd $$i && echo "making tags $$i..." && \
407                 $(MAKE) SDIRS='${SDIRS}' tags ) || exit 1; \
408         fi; \
409         done;
410
411 errors:
412         $(PERL) util/mkerr.pl -recurse -write
413         (cd engines; $(MAKE) PERL=$(PERL) errors)
414
415 stacks:
416         $(PERL) util/mkstack.pl -write
417
418 util/libeay.num::
419         $(PERL) util/mkdef.pl crypto update
420
421 util/ssleay.num::
422         $(PERL) util/mkdef.pl ssl update
423
424 crypto/objects/obj_dat.h: crypto/objects/obj_dat.pl crypto/objects/obj_mac.h
425         $(PERL) crypto/objects/obj_dat.pl crypto/objects/obj_mac.h crypto/objects/obj_dat.h
426 crypto/objects/obj_mac.h: crypto/objects/objects.pl crypto/objects/objects.txt crypto/objects/obj_mac.num
427         $(PERL) crypto/objects/objects.pl crypto/objects/objects.txt crypto/objects/obj_mac.num crypto/objects/obj_mac.h
428
429 TABLE: Configure
430         (echo 'Output of `Configure TABLE'"':"; \
431         $(PERL) Configure TABLE) > TABLE
432
433 update: depend errors stacks util/libeay.num util/ssleay.num crypto/objects/obj_dat.h TABLE
434
435 # Build distribution tar-file. As the list of files returned by "find" is
436 # pretty long, on several platforms a "too many arguments" error or similar
437 # would occur. Therefore the list of files is temporarily stored into a file
438 # and read directly, requiring GNU-Tar. Call "make TAR=gtar dist" if the normal
439 # tar does not support the --files-from option.
440 tar:
441         find . -type d -print | xargs chmod 755
442         find . -type f -print | xargs chmod a+r
443         find . -type f -perm -0100 -print | xargs chmod a+x
444         find * \! -path CVS/\* \! -path \*/CVS/\* \! -name CVS \! -name .cvsignore \! -name STATUS \! -name TABLE | sort > ../$(TARFILE).list; \
445         $(TAR) $(TARFLAGS) --files-from ../$(TARFILE).list -cvf - | \
446         tardy --user_number=0  --user_name=openssl \
447               --group_number=0 --group_name=openssl \
448               --prefix=openssl-$(VERSION) - |\
449         gzip --best >../$(TARFILE).gz; \
450         rm -f ../$(TARFILE).list; \
451         ls -l ../$(TARFILE).gz
452
453 tar-snap:
454         @$(TAR) $(TARFLAGS) -cvf - \
455                 `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` |\
456         tardy --user_number=0  --user_name=openssl \
457               --group_number=0 --group_name=openssl \
458               --prefix=openssl-$(VERSION) - > ../$(TARFILE);\
459         ls -l ../$(TARFILE)
460
461 dist:   
462         $(PERL) Configure dist
463         @$(MAKE) dist_pem_h
464         @$(MAKE) SDIRS='${SDIRS}' clean
465         @$(MAKE) TAR='${TAR}' TARFLAGS='${TARFLAGS}' tar
466
467 dist_pem_h:
468         (cd crypto/pem; $(MAKE) CC='${CC}' SDIRS='${SDIRS}' CFLAG='${CFLAG}' pem.h; $(MAKE) clean)
469
470 install: all install_docs
471         @$(PERL) $(TOP)/util/mkdir-p.pl $(INSTALL_PREFIX)$(INSTALLTOP)/bin \
472                 $(INSTALL_PREFIX)$(INSTALLTOP)/lib \
473                 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/pkginfo \
474                 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl \
475                 $(INSTALL_PREFIX)$(OPENSSLDIR)/engines \
476                 $(INSTALL_PREFIX)$(OPENSSLDIR)/misc \
477                 $(INSTALL_PREFIX)$(OPENSSLDIR)/certs \
478                 $(INSTALL_PREFIX)$(OPENSSLDIR)/private \
479                 $(INSTALL_PREFIX)$(OPENSSLDIR)/lib
480         @for i in $(EXHEADER) ;\
481         do \
482         (cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \
483         chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \
484         done;
485         @for i in $(DIRS) ;\
486         do \
487         if [ -d "$$i" ]; then \
488                 (cd $$i; echo "installing $$i..."; \
489                 $(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 ); \
490         fi; \
491         done
492         @for i in $(LIBS) ;\
493         do \
494                 if [ -f "$$i" ]; then \
495                 (       echo installing $$i; \
496                         cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \
497                         $(RANLIB) $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \
498                         chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \
499                         mv $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i ); \
500                 fi; \
501         done;
502         @if [ -n "$(SHARED_LIBS)" ]; then \
503                 tmp="$(SHARED_LIBS)"; \
504                 for i in $${tmp:-x}; \
505                 do \
506                         if [ -f "$$i" -o -f "$$i.a" ]; then \
507                         (       echo installing $$i; \
508                                 if [ "$(PLATFORM)" != "Cygwin" ]; then \
509                                         cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \
510                                         chmod 555 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \
511                                         mv $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i; \
512                                 else \
513                                         c=`echo $$i | sed 's/^lib/cyg/'`; \
514                                         cp $$c $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new; \
515                                         chmod 755 $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new; \
516                                         mv $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c; \
517                                         cp $$i.a $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.a.new; \
518                                         chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.a.new; \
519                                         mv $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.a.new $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.a; \
520                                 fi ); \
521                         fi; \
522                 done; \
523                 (       here="`pwd`"; \
524                         cd $(INSTALL_PREFIX)$(INSTALLTOP)/lib; \
525                         $(NEWMAKE) -f $$here/Makefile link-shared ); \
526         fi
527         cp openssl.pc $(INSTALL_PREFIX)$(INSTALLTOP)/lib/pkginfo
528
529 install_docs:
530         @$(PERL) $(TOP)/util/mkdir-p.pl \
531                 $(INSTALL_PREFIX)$(MANDIR)/man1 \
532                 $(INSTALL_PREFIX)$(MANDIR)/man3 \
533                 $(INSTALL_PREFIX)$(MANDIR)/man5 \
534                 $(INSTALL_PREFIX)$(MANDIR)/man7
535         @pod2man="`cd util; ./pod2mantest $(PERL)`"; \
536         for i in doc/apps/*.pod; do \
537                 fn=`basename $$i .pod`; \
538                 if [ "$$fn" = "config" ]; then sec=5; else sec=1; fi; \
539                 echo "installing man$$sec/$$fn.$$sec"; \
540                 (cd `$(PERL) util/dirname.pl $$i`; \
541                 sh -c "$$pod2man \
542                         --section=$$sec --center=OpenSSL \
543                         --release=$(VERSION) `basename $$i`") \
544                         >  $(INSTALL_PREFIX)$(MANDIR)/man$$sec/$$fn.$$sec; \
545                 $(PERL) util/extract-names.pl < $$i | grep -v "^$$fn" | \
546                         while read n; do \
547                                 util/point.sh $$fn.$$sec $(INSTALL_PREFIX)$(MANDIR)/man$$sec/$$n.$$sec; \
548                         done; \
549         done; \
550         for i in doc/crypto/*.pod doc/ssl/*.pod; do \
551                 fn=`basename $$i .pod`; \
552                 if [ "$$fn" = "des_modes" ]; then sec=7; else sec=3; fi; \
553                 echo "installing man$$sec/$$fn.$$sec"; \
554                 (cd `$(PERL) util/dirname.pl $$i`; \
555                 sh -c "$$pod2man \
556                         --section=$$sec --center=OpenSSL \
557                         --release=$(VERSION) `basename $$i`") \
558                         >  $(INSTALL_PREFIX)$(MANDIR)/man$$sec/$$fn.$$sec; \
559                 $(PERL) util/extract-names.pl < $$i | grep -v "^$$fn" | \
560                         while read n; do \
561                                 util/point.sh $$fn.$$sec $(INSTALL_PREFIX)$(MANDIR)/man$$sec/$$n.$$sec; \
562                         done; \
563         done
564
565 # DO NOT DELETE THIS LINE -- make depend depends on it.