]>
Commit | Line | Data |
---|---|---|
d56128f0 RE |
1 | ## |
2 | ## Makefile for OpenSSL | |
3 | ## | |
4 | ||
0973910f UM |
5 | VERSION= |
6 | MAJOR= | |
7 | MINOR= | |
b436a982 RL |
8 | SHLIB_VERSION_NUMBER= |
9 | SHLIB_VERSION_HISTORY= | |
10 | SHLIB_MAJOR= | |
11 | SHLIB_MINOR= | |
a22fb399 | 12 | SHLIB_EXT= |
d56128f0 | 13 | PLATFORM=dist |
31ff97b2 | 14 | OPTIONS= |
c59cb511 | 15 | CONFIGURE_ARGS= |
b436a982 RL |
16 | SHLIB_TARGET= |
17 | ||
30c08f2e RL |
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 | ||
e5f3045f BM |
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= | |
462ba4f6 UM |
27 | INSTALLTOP=/usr/local/ssl |
28 | ||
29 | # Do not edit this manually. Use Configure --openssldir=DIR do change this! | |
30 | OPENSSLDIR=/usr/local/ssl | |
d56128f0 | 31 | |
d02b48c6 RE |
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 | |
58964a49 | 36 | # system defines as well, i.e. _REENTERANT for Solaris 2.[34] |
d02b48c6 RE |
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 | |
58964a49 RE |
41 | # one. 32 bytes will be read from this when the random |
42 | # number generator is initalised. | |
baf748ba | 43 | # SSL_FORBID_ENULL - define if you want the server to be not able to use the |
58964a49 | 44 | # NULL encryption ciphers. |
d02b48c6 RE |
45 | # |
46 | # LOCK_DEBUG - turns on lots of lock debug output :-) | |
47 | # REF_CHECK - turn on some xyz_free() assertions. | |
58964a49 | 48 | # REF_PRINT - prints some stuff on structure free. |
d02b48c6 RE |
49 | # CRYPTO_MDEBUG - turns on my 'memory leak' detecting stuff |
50 | # MFUNC - Make all Malloc/Free/Realloc calls call | |
58964a49 RE |
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 | |
dfeab068 RE |
56 | # Do not define B_ENDIAN or L_ENDIAN if 'unsigned long' == 8. It must |
57 | # equal 4. | |
58 | # PKCS1_CHECK - pkcs1 tests. | |
d02b48c6 | 59 | |
67ea999d AP |
60 | CC= cc |
61 | CFLAG= -O | |
f5d7a031 | 62 | DEPFLAG= |
bc29d0e5 | 63 | PEX_LIBS= |
651d0aff | 64 | EX_LIBS= |
967d95f0 | 65 | EXE_EXT= |
179add2b RL |
66 | ARFLAGS= |
67 | AR=ar $(ARFLAGS) r | |
99aab161 UM |
68 | RANLIB= ranlib |
69 | PERL= perl | |
2dbb3ccd | 70 | TAR= tar |
63977104 | 71 | TARFLAGS= --no-recursion |
cf1b7d96 | 72 | MAKEDEPPROG=makedepend |
d02b48c6 | 73 | |
3cc9a89d AP |
74 | # We let the C compiler driver to take care of .s files. This is done in |
75 | # order to be excused from maintaining a separate set of architecture | |
76 | # dependent assembler flags. E.g. if you throw -mcpu=ultrasparc at SPARC | |
77 | # gcc, then the driver will automatically translate it to -xarch=v8plus | |
78 | # and pass it down to assembler. | |
79 | AS=$(CC) -c | |
01fc834b | 80 | ASFLAG=$(CFLAG) |
3cc9a89d | 81 | |
14e21f86 AP |
82 | # For x86 assembler: Set PROCESSOR to 386 if you want to support |
83 | # the 80386. | |
84 | PROCESSOR= | |
85 | ||
86 | # CPUID module collects small commonly used assembler snippets | |
87 | CPUID_OBJ= | |
dfeab068 | 88 | BN_ASM= bn_asm.o |
67ea999d | 89 | DES_ENC= des_enc.o fcrypt_b.o |
ed65fab9 | 90 | AES_ASM_OBJ=aes_core.o aes_cbc.o |
67ea999d AP |
91 | BF_ENC= bf_enc.o |
92 | CAST_ENC= c_enc.o | |
93 | RC4_ENC= rc4_enc.o | |
94 | RC5_ENC= rc5_enc.o | |
95 | MD5_ASM_OBJ= | |
96 | SHA1_ASM_OBJ= | |
97 | RMD160_ASM_OBJ= | |
58964a49 | 98 | |
f9b3bff6 RL |
99 | # KRB5 stuff |
100 | KRB5_INCLUDES= | |
c1269c81 | 101 | LIBKRB5= |
f9b3bff6 | 102 | |
7614f0e5 DSH |
103 | # Zlib stuff |
104 | ZLIB_INCLUDE= | |
105 | LIBZLIB= | |
106 | ||
506fec1a | 107 | DIRS= crypto ssl engines apps test tools |
0973910f UM |
108 | SHLIBDIRS= crypto ssl |
109 | ||
d02b48c6 RE |
110 | # dirs in crypto to build |
111 | SDIRS= \ | |
d87b79bf | 112 | objects \ |
3009458e | 113 | md2 md4 md5 sha mdc2 hmac ripemd \ |
67ea999d AP |
114 | des aes rc2 rc4 rc5 idea bf cast \ |
115 | bn ec rsa dsa ecdsa dh ecdh dso engine \ | |
d87b79bf | 116 | buffer bio stack lhash rand err \ |
a5db6fa5 | 117 | evp asn1 pem x509 x509v3 conf txt_db pkcs7 pkcs12 comp ocsp ui krb5 \ |
36d16f8e | 118 | store pqueue |
a24b7eeb AP |
119 | # keep in mind that the above list is adjusted by ./Configure |
120 | # according to no-xxx arguments... | |
d02b48c6 | 121 | |
f777408f RL |
122 | # tests to perform. "alltests" is a special word indicating that all tests |
123 | # should be performed. | |
124 | TESTS = alltests | |
125 | ||
42ba5d23 | 126 | MAKEFILE= Makefile |
d02b48c6 | 127 | |
e1c55191 | 128 | MANDIR=$(OPENSSLDIR)/man |
d02b48c6 RE |
129 | MAN1=1 |
130 | MAN3=3 | |
1cc087fe | 131 | MANSUFFIX= |
d02b48c6 RE |
132 | SHELL=/bin/sh |
133 | ||
58964a49 | 134 | TOP= . |
d02b48c6 | 135 | ONEDIRS=out tmp |
7d7d2cbc | 136 | EDIRS= times doc bugs util include certs ms shlib mt demos perl sf dep VMS |
58964a49 | 137 | WDIRS= windows |
b436a982 | 138 | LIBS= libcrypto.a libssl.a |
a22fb399 RL |
139 | SHARED_CRYPTO=libcrypto$(SHLIB_EXT) |
140 | SHARED_SSL=libssl$(SHLIB_EXT) | |
141 | SHARED_LIBS= | |
142 | SHARED_LIBS_LINK_EXTS= | |
a5595fde | 143 | SHARED_LDFLAGS= |
58964a49 RE |
144 | |
145 | GENERAL= Makefile | |
9ce5db45 | 146 | BASENAME= openssl |
58964a49 RE |
147 | NAME= $(BASENAME)-$(VERSION) |
148 | TARFILE= $(NAME).tar | |
149 | WTARFILE= $(NAME)-win.tar | |
cf1b7d96 | 150 | EXHEADER= e_os2.h |
58964a49 | 151 | HEADER= e_os.h |
d02b48c6 | 152 | |
ef8a18f4 | 153 | all: Makefile build_all openssl.pc libssl.pc libcrypto.pc |
d02b48c6 | 154 | |
a24b7eeb AP |
155 | # as we stick to -e, CLEARENV ensures that local variables in lower |
156 | # Makefiles remain local and variable. $${VAR+VAR} is tribute to Korn | |
157 | # shell, which [annoyingly enough] terminates unset with error if VAR | |
158 | # is not present:-( TOP= && unset TOP is tribute to HP-UX /bin/sh, | |
159 | # which terminates unset with error if no variable was present:-( | |
160 | CLEARENV= TOP= && unset TOP $${LIB+LIB} $${LIBS+LIBS} \ | |
161 | $${INCLUDE+INCLUDE} $${INCLUDES+INCLUDES} \ | |
162 | $${DIR+DIR} $${DIRS+DIRS} $${SRC+SRC} \ | |
163 | $${LIBSRC+LIBSRC} $${LIBOBJ+LIBOBJ} $${ALL+ALL} \ | |
164 | $${EXHEADER+EXHEADER} $${HEADER+HEADER} \ | |
165 | $${GENERAL+GENERAL} $${CFLAGS+CFLAGS} \ | |
166 | $${ASFLAGS+ASFLAGS} $${AFLAGS+AFLAGS} \ | |
167 | $${LDCMD+LDCMD} $${LDFLAGS+LDFLAGS} \ | |
168 | $${SHAREDCMD+SHAREDCMD} $${SHAREDFLAGS+SHAREDFLAGS} \ | |
169 | $${SHARED_LIB+SHARED_LIB} $${LIBEXTRAS+LIBEXTRAS} | |
170 | ||
d0590fe6 | 171 | BUILDENV= PLATFORM='${PLATFORM}' PROCESSOR='${PROCESSOR}' \ |
d0590fe6 | 172 | CC='${CC}' CFLAG='${CFLAG}' \ |
33c3ecf7 | 173 | AS='${CC}' ASFLAG='${CFLAG} -c' \ |
d0590fe6 | 174 | AR='${AR}' PERL='${PERL}' RANLIB='${RANLIB}' \ |
7844ff73 RL |
175 | SDIRS='${SDIRS}' LIBRPATH='${INSTALLTOP}/lib' \ |
176 | INSTALL_PREFIX='${INSTALL_PREFIX}' \ | |
7abbffc3 | 177 | INSTALLTOP='${INSTALLTOP}' OPENSSLDIR='${OPENSSLDIR}' \ |
a24b7eeb | 178 | MAKEDEPEND='$$$${TOP}/util/domd $$$${TOP} -MD ${MAKEDEPPROG}' \ |
ce92b6eb AP |
179 | DEPFLAG='-DOPENSSL_NO_DEPRECATED ${DEPFLAG}' \ |
180 | MAKEDEPPROG='${MAKEDEPPROG}' \ | |
a24b7eeb | 181 | SHARED_LDFLAGS='${SHARED_LDFLAGS}' \ |
d0590fe6 AP |
182 | KRB5_INCLUDES='${KRB5_INCLUDES}' LIBKRB5='${LIBKRB5}' \ |
183 | EXE_EXT='${EXE_EXT}' SHARED_LIBS='${SHARED_LIBS}' \ | |
184 | SHLIB_EXT='${SHLIB_EXT}' SHLIB_TARGET='${SHLIB_TARGET}' \ | |
185 | PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' \ | |
14e21f86 | 186 | CPUID_OBJ='${CPUID_OBJ}' \ |
d0590fe6 AP |
187 | BN_ASM='${BN_ASM}' DES_ENC='${DES_ENC}' \ |
188 | AES_ASM_OBJ='${AES_ASM_OBJ}' \ | |
189 | BF_ENC='${BF_ENC}' CAST_ENC='${CAST_ENC}' \ | |
190 | RC4_ENC='${RC4_ENC}' RC5_ENC='${RC5_ENC}' \ | |
191 | SHA1_ASM_OBJ='${SHA1_ASM_OBJ}' \ | |
192 | MD5_ASM_OBJ='${MD5_ASM_OBJ}' \ | |
7abbffc3 | 193 | RMD160_ASM_OBJ='${RMD160_ASM_OBJ}' \ |
a24b7eeb AP |
194 | THIS=$${THIS:-$@} MAKEFILE=Makefile MAKEOVERRIDES= |
195 | # MAKEOVERRIDES= effectively "equalizes" GNU-ish and SysV-ish make flavors, | |
196 | # which in turn eliminates ambiguities in variable treatment with -e. | |
d0590fe6 | 197 | |
a24b7eeb AP |
198 | BUILD_CMD= if [ -d "$$dir" ]; then \ |
199 | ( cd $$dir && echo "making $$target in $$dir..." && \ | |
200 | $(CLEARENV) && $(MAKE) -e $(BUILDENV) TOP=.. DIR=$$dir $$target \ | |
201 | ) || exit 1; \ | |
202 | fi | |
203 | RECURSIVE_BUILD_CMD=for dir in $(DIRS); do $(BUILD_CMD); done | |
88c80b3e | 204 | |
734540f8 | 205 | reflect: |
a24b7eeb | 206 | @[ -n "$(THIS)" ] && $(CLEARENV) && $(MAKE) $(THIS) -e $(BUILDENV) |
734540f8 | 207 | |
4c82171a | 208 | sub_all: build_all |
88c80b3e RL |
209 | build_all: build_libs build_apps build_tests build_tools |
210 | ||
506fec1a | 211 | build_libs: build_crypto build_ssl build_engines |
88c80b3e RL |
212 | |
213 | build_crypto: | |
ba5477eb | 214 | @dir=crypto; target=all; $(BUILD_CMD) |
88c80b3e | 215 | build_ssl: |
ba5477eb | 216 | @dir=ssl; target=all; $(BUILD_CMD) |
506fec1a | 217 | build_engines: |
ba5477eb | 218 | @dir=engines; target=all; $(BUILD_CMD) |
88c80b3e | 219 | build_apps: |
ba5477eb | 220 | @dir=apps; target=all; $(BUILD_CMD) |
88c80b3e | 221 | build_tests: |
ba5477eb | 222 | @dir=test; target=all; $(BUILD_CMD) |
88c80b3e | 223 | build_tools: |
ba5477eb RL |
224 | @dir=tools; target=all; $(BUILD_CMD) |
225 | ||
226 | all_testapps: build_libs build_testapps | |
227 | build_testapps: | |
228 | @dir=crypto; target=testapps; $(BUILD_CMD) | |
b436a982 | 229 | |
a22fb399 | 230 | libcrypto$(SHLIB_EXT): libcrypto.a |
f4316c36 | 231 | @if [ "$(SHLIB_TARGET)" != "" ]; then \ |
a22fb399 | 232 | $(MAKE) SHLIBDIRS=crypto build-shared; \ |
f4316c36 RL |
233 | else \ |
234 | echo "There's no support for shared libraries on this platform" >&2; \ | |
d0590fe6 | 235 | exit 1; \ |
f4316c36 | 236 | fi |
0f180d1d | 237 | |
a22fb399 | 238 | libssl$(SHLIB_EXT): libcrypto$(SHLIB_EXT) libssl.a |
f4316c36 | 239 | @if [ "$(SHLIB_TARGET)" != "" ]; then \ |
5ddcb866 | 240 | $(MAKE) SHLIBDIRS=ssl SHLIBDEPS='-lcrypto' build-shared; \ |
f4316c36 RL |
241 | else \ |
242 | echo "There's no support for shared libraries on this platform" >&2; \ | |
d0590fe6 | 243 | exit 1; \ |
f4316c36 | 244 | fi |
b436a982 RL |
245 | |
246 | clean-shared: | |
cfd06a62 | 247 | @set -e; for i in $(SHLIBDIRS); do \ |
a22fb399 RL |
248 | if [ -n "$(SHARED_LIBS_LINK_EXTS)" ]; then \ |
249 | tmp="$(SHARED_LIBS_LINK_EXTS)"; \ | |
250 | for j in $${tmp:-x}; do \ | |
251 | ( set -x; rm -f lib$$i$$j ); \ | |
252 | done; \ | |
253 | fi; \ | |
254 | ( set -x; rm -f lib$$i$(SHLIB_EXT) ); \ | |
49e04548 | 255 | if [ "$(PLATFORM)" = "Cygwin" ]; then \ |
1fe198b6 RL |
256 | ( set -x; rm -f cyg$$i$(SHLIB_EXT) lib$$i$(SHLIB_EXT).a ); \ |
257 | fi; \ | |
b436a982 | 258 | done |
d02b48c6 | 259 | |
a22fb399 | 260 | link-shared: |
cfd06a62 | 261 | @ set -e; for i in ${SHLIBDIRS}; do \ |
3bfe024d | 262 | $(MAKE) -f $(HERE)/Makefile.shared -e $(BUILDENV) \ |
30afcc07 RL |
263 | LIBNAME=$$i LIBVERSION=${SHLIB_MAJOR}.${SHLIB_MINOR} \ |
264 | LIBCOMPATVERSIONS=";${SHLIB_VERSION_HISTORY}" \ | |
265 | symlink.$(SHLIB_TARGET); \ | |
6b86bad5 | 266 | libs="$$libs -l$$i"; \ |
0fd44e2d RL |
267 | done |
268 | ||
30afcc07 RL |
269 | build-shared: do_$(SHLIB_TARGET) link-shared |
270 | ||
271 | do_$(SHLIB_TARGET): | |
cfd06a62 | 272 | @ set -e; libs='-L. ${SHLIBDEPS}'; for i in ${SHLIBDIRS}; do \ |
c1269c81 RL |
273 | if [ "${SHLIBDIRS}" = "ssl" -a -n "$(LIBKRB5)" ]; then \ |
274 | libs="$(LIBKRB5) $$libs"; \ | |
275 | fi; \ | |
a24b7eeb | 276 | $(CLEARENV) && $(MAKE) -f Makefile.shared -e $(BUILDENV) \ |
30afcc07 RL |
277 | LIBNAME=$$i LIBVERSION=${SHLIB_MAJOR}.${SHLIB_MINOR} \ |
278 | LIBCOMPATVERSIONS=";${SHLIB_VERSION_HISTORY}" \ | |
279 | LIBDEPS="$$libs $(EX_LIBS)" \ | |
280 | link_a.$(SHLIB_TARGET); \ | |
c1269c81 | 281 | libs="-l$$i $$libs"; \ |
a3fffd64 RL |
282 | done |
283 | ||
ef8a18f4 RL |
284 | libcrypto.pc: Makefile |
285 | @ ( echo 'prefix=$(INSTALLTOP)'; \ | |
286 | echo 'exec_prefix=$${prefix}'; \ | |
287 | echo 'libdir=$${exec_prefix}/lib'; \ | |
288 | echo 'includedir=$${prefix}/include'; \ | |
289 | echo ''; \ | |
290 | echo 'Name: OpenSSL-libcrypto'; \ | |
291 | echo 'Description: OpenSSL cryptography library'; \ | |
292 | echo 'Version: '$(VERSION); \ | |
293 | echo 'Requires: '; \ | |
294 | echo 'Libs: -L$${libdir} -lcrypto $(EX_LIBS)'; \ | |
295 | echo 'Cflags: -I$${includedir} $(KRB5_INCLUDES)' ) > libcrypto.pc | |
296 | ||
297 | libssl.pc: Makefile | |
298 | @ ( echo 'prefix=$(INSTALLTOP)'; \ | |
299 | echo 'exec_prefix=$${prefix}'; \ | |
300 | echo 'libdir=$${exec_prefix}/lib'; \ | |
301 | echo 'includedir=$${prefix}/include'; \ | |
302 | echo ''; \ | |
303 | echo 'Name: OpenSSL'; \ | |
304 | echo 'Description: Secure Sockets Layer and cryptography libraries'; \ | |
305 | echo 'Version: '$(VERSION); \ | |
306 | echo 'Requires: '; \ | |
307 | echo 'Libs: -L$${libdir} -lssl -lcrypto $(EX_LIBS)'; \ | |
308 | echo 'Cflags: -I$${includedir} $(KRB5_INCLUDES)' ) > libssl.pc | |
309 | ||
42ba5d23 | 310 | openssl.pc: Makefile |
56824b96 RL |
311 | @ ( echo 'prefix=$(INSTALLTOP)'; \ |
312 | echo 'exec_prefix=$${prefix}'; \ | |
313 | echo 'libdir=$${exec_prefix}/lib'; \ | |
314 | echo 'includedir=$${prefix}/include'; \ | |
315 | echo ''; \ | |
316 | echo 'Name: OpenSSL'; \ | |
317 | echo 'Description: Secure Sockets Layer and cryptography libraries and tools'; \ | |
318 | echo 'Version: '$(VERSION); \ | |
319 | echo 'Requires: '; \ | |
320 | echo 'Libs: -L$${libdir} -lssl -lcrypto $(EX_LIBS)'; \ | |
49be7042 | 321 | echo 'Cflags: -I$${includedir} $(KRB5_INCLUDES)' ) > openssl.pc |
56824b96 | 322 | |
c7199e62 BL |
323 | Makefile: Makefile.org Configure config |
324 | @echo "Makefile is older than Makefile.org, Configure or config." | |
49b81422 | 325 | @echo "Reconfigure the source tree (via './config' or 'perl Configure'), please." |
9535d202 BL |
326 | @false |
327 | ||
dfeab068 | 328 | libclean: |
15da07d4 | 329 | rm -f *.map *.so *.so.* *.dll engines/*.so engines/*.dll *.a engines/*.a */lib */*/lib |
dfeab068 | 330 | |
7841edc9 RL |
331 | clean: libclean |
332 | rm -f shlib/*.o *.o core a.out fluff rehash.time testlog make.log cctest cctest.c | |
a24b7eeb AP |
333 | @set -e; target=clean; $(RECURSIVE_BUILD_CMD) |
334 | rm -f $(LIBS) | |
ef8a18f4 | 335 | rm -f openssl.pc libssl.pc libcrypto.pc |
7841edc9 | 336 | rm -f speed.* .pure |
bb8f3c58 | 337 | rm -f $(TARFILE) |
cfd06a62 | 338 | @set -e; for i in $(ONEDIRS) ;\ |
d02b48c6 | 339 | do \ |
bb8f3c58 | 340 | rm -fr $$i/*; \ |
d02b48c6 RE |
341 | done |
342 | ||
343 | makefile.one: files | |
99aab161 | 344 | $(PERL) util/mk1mf.pl >makefile.one; \ |
d02b48c6 RE |
345 | sh util/do_ms.sh |
346 | ||
bacad008 | 347 | files: |
42ba5d23 | 348 | $(PERL) $(TOP)/util/files.pl Makefile > $(TOP)/MINFO |
a24b7eeb | 349 | @set -e; target=files; $(RECURSIVE_BUILD_CMD) |
d02b48c6 RE |
350 | |
351 | links: | |
6576774b | 352 | @$(PERL) $(TOP)/util/mkdir-p.pl include/openssl |
41d2a336 | 353 | @$(PERL) $(TOP)/util/mklink.pl include/openssl $(EXHEADER) |
a24b7eeb | 354 | @set -e; target=links; $(RECURSIVE_BUILD_CMD) |
d02b48c6 | 355 | |
1cc67fa8 RL |
356 | gentests: |
357 | @(cd test && echo "generating dummy tests (if needed)..." && \ | |
a24b7eeb | 358 | $(CLEARENV) && $(MAKE) -e $(BUILDENV) TESTS='${TESTS}' OPENSSL_DEBUG_MEMORY=on generate ); |
1cc67fa8 | 359 | |
d02b48c6 | 360 | dclean: |
bb8f3c58 | 361 | rm -f *.bak |
a24b7eeb | 362 | @set -e; target=dclean; $(RECURSIVE_BUILD_CMD) |
d02b48c6 | 363 | |
e6e7b5f3 BM |
364 | rehash: rehash.time |
365 | rehash.time: certs | |
62d27939 AP |
366 | @(OPENSSL="`pwd`/util/opensslwrap.sh"; \ |
367 | OPENSSL_DEBUG_MEMORY=on; \ | |
69c922f5 | 368 | export OPENSSL OPENSSL_DEBUG_MEMORY; \ |
69c922f5 | 369 | $(PERL) tools/c_rehash certs) |
3ebf0be1 | 370 | touch rehash.time |
d02b48c6 | 371 | |
58964a49 | 372 | test: tests |
d02b48c6 | 373 | |
73bfb9ad | 374 | tests: rehash |
bb8f3c58 | 375 | @(cd test && echo "testing..." && \ |
a24b7eeb | 376 | $(CLEARENV) && $(MAKE) -e $(BUILDENV) TOP=.. TESTS='${TESTS}' OPENSSL_DEBUG_MEMORY=on tests ); |
62d27939 | 377 | util/opensslwrap.sh version -a |
d02b48c6 | 378 | |
d7f0ab5f UM |
379 | report: |
380 | @$(PERL) util/selftest.pl | |
381 | ||
d02b48c6 | 382 | depend: |
a24b7eeb | 383 | @set -e; target=depend; $(RECURSIVE_BUILD_CMD) |
d02b48c6 RE |
384 | |
385 | lint: | |
a24b7eeb | 386 | @set -e; target=lint; $(RECURSIVE_BUILD_CMD) |
d02b48c6 RE |
387 | |
388 | tags: | |
a273a282 BL |
389 | rm -f TAGS |
390 | find . -name '[^.]*.[ch]' | xargs etags -a | |
d02b48c6 RE |
391 | |
392 | errors: | |
f6485909 | 393 | $(PERL) util/mkerr.pl -recurse -write |
506fec1a | 394 | (cd engines; $(MAKE) PERL=$(PERL) errors) |
fbeaa3c4 | 395 | $(PERL) util/ck_errf.pl */*.c */*/*.c |
d02b48c6 | 396 | |
e41c8d6a | 397 | stacks: |
f6485909 | 398 | $(PERL) util/mkstack.pl -write |
e41c8d6a | 399 | |
7740a1c6 | 400 | util/libeay.num:: |
f6485909 | 401 | $(PERL) util/mkdef.pl crypto update |
7740a1c6 BM |
402 | |
403 | util/ssleay.num:: | |
f6485909 | 404 | $(PERL) util/mkdef.pl ssl update |
7740a1c6 | 405 | |
1d00800e | 406 | crypto/objects/obj_dat.h: crypto/objects/obj_dat.pl crypto/objects/obj_mac.h |
f6485909 | 407 | $(PERL) crypto/objects/obj_dat.pl crypto/objects/obj_mac.h crypto/objects/obj_dat.h |
0357422d | 408 | crypto/objects/obj_mac.h: crypto/objects/objects.pl crypto/objects/objects.txt crypto/objects/obj_mac.num |
f6485909 | 409 | $(PERL) crypto/objects/objects.pl crypto/objects/objects.txt crypto/objects/obj_mac.num crypto/objects/obj_mac.h |
49e747e6 | 410 | |
2faa930b RL |
411 | apps/openssl-vms.cnf: apps/openssl.cnf |
412 | $(PERL) VMS/VMSify-conf.pl < apps/openssl.cnf > apps/openssl-vms.cnf | |
413 | ||
d8e64093 RL |
414 | crypto/bn/bn_prime.h: crypto/bn/bn_prime.pl |
415 | $(PERL) crypto/bn/bn_prime.pl >crypto/bn/bn_prime.h | |
416 | ||
417 | ||
62c419d6 | 418 | TABLE: Configure |
2330e18b | 419 | (echo 'Output of `Configure TABLE'"':"; \ |
f6485909 | 420 | $(PERL) Configure TABLE) > TABLE |
7740a1c6 | 421 | |
d8e64093 | 422 | update: errors stacks util/libeay.num util/ssleay.num crypto/objects/obj_dat.h apps/openssl-vms.cnf crypto/bn/bn_prime.h TABLE depend |
7740a1c6 | 423 | |
f9de8446 LJ |
424 | # Build distribution tar-file. As the list of files returned by "find" is |
425 | # pretty long, on several platforms a "too many arguments" error or similar | |
426 | # would occur. Therefore the list of files is temporarily stored into a file | |
427 | # and read directly, requiring GNU-Tar. Call "make TAR=gtar dist" if the normal | |
428 | # tar does not support the --files-from option. | |
d02b48c6 | 429 | tar: |
756b9a00 LJ |
430 | find . -type d -print | xargs chmod 755 |
431 | find . -type f -print | xargs chmod a+r | |
432 | find . -type f -perm -0100 -print | xargs chmod a+x | |
f9de8446 LJ |
433 | find * \! -path CVS/\* \! -path \*/CVS/\* \! -name CVS \! -name .cvsignore \! -name STATUS \! -name TABLE | sort > ../$(TARFILE).list; \ |
434 | $(TAR) $(TARFLAGS) --files-from ../$(TARFILE).list -cvf - | \ | |
5a061129 | 435 | tardy --user_number=0 --user_name=openssl \ |
9ce5db45 RE |
436 | --group_number=0 --group_name=openssl \ |
437 | --prefix=openssl-$(VERSION) - |\ | |
651d0aff | 438 | gzip --best >../$(TARFILE).gz; \ |
f9de8446 | 439 | rm -f ../$(TARFILE).list; \ |
651d0aff | 440 | ls -l ../$(TARFILE).gz |
d02b48c6 | 441 | |
41d2a336 RL |
442 | tar-snap: |
443 | @$(TAR) $(TARFLAGS) -cvf - \ | |
3a7cef3e | 444 | `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` |\ |
41d2a336 RL |
445 | tardy --user_number=0 --user_name=openssl \ |
446 | --group_number=0 --group_name=openssl \ | |
447 | --prefix=openssl-$(VERSION) - > ../$(TARFILE);\ | |
448 | ls -l ../$(TARFILE) | |
449 | ||
58964a49 | 450 | dist: |
99aab161 | 451 | $(PERL) Configure dist |
d02b48c6 RE |
452 | @$(MAKE) dist_pem_h |
453 | @$(MAKE) SDIRS='${SDIRS}' clean | |
870d3d55 | 454 | @$(MAKE) TAR='${TAR}' TARFLAGS='${TARFLAGS}' tar |
d02b48c6 RE |
455 | |
456 | dist_pem_h: | |
a24b7eeb | 457 | (cd crypto/pem; $(MAKE) -e $(BUILDENV) pem.h; $(MAKE) clean) |
d02b48c6 | 458 | |
28a80034 RL |
459 | install: all install_docs install_sw |
460 | ||
461 | install_sw: | |
f0588887 BM |
462 | @$(PERL) $(TOP)/util/mkdir-p.pl $(INSTALL_PREFIX)$(INSTALLTOP)/bin \ |
463 | $(INSTALL_PREFIX)$(INSTALLTOP)/lib \ | |
90819805 | 464 | $(INSTALL_PREFIX)$(INSTALLTOP)/lib/engines \ |
9d5c42b6 | 465 | $(INSTALL_PREFIX)$(INSTALLTOP)/lib/pkgconfig \ |
f0588887 BM |
466 | $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl \ |
467 | $(INSTALL_PREFIX)$(OPENSSLDIR)/misc \ | |
468 | $(INSTALL_PREFIX)$(OPENSSLDIR)/certs \ | |
8d472bdd | 469 | $(INSTALL_PREFIX)$(OPENSSLDIR)/private |
a2ac429d | 470 | @set -e; headerlist="$(EXHEADER)"; for i in $$headerlist;\ |
2a4a0a34 BM |
471 | do \ |
472 | (cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \ | |
473 | chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \ | |
474 | done; | |
a24b7eeb | 475 | @set -e; target=install; $(RECURSIVE_BUILD_CMD) |
cfd06a62 | 476 | @set -e; for i in $(LIBS) ;\ |
d02b48c6 | 477 | do \ |
b436a982 RL |
478 | if [ -f "$$i" ]; then \ |
479 | ( echo installing $$i; \ | |
7104c376 RL |
480 | cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \ |
481 | $(RANLIB) $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \ | |
482 | chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \ | |
30c08f2e | 483 | mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i ); \ |
2c975b50 LJ |
484 | fi; \ |
485 | done; | |
cfd06a62 | 486 | @set -e; if [ -n "$(SHARED_LIBS)" ]; then \ |
a22fb399 RL |
487 | tmp="$(SHARED_LIBS)"; \ |
488 | for i in $${tmp:-x}; \ | |
489 | do \ | |
1fe198b6 | 490 | if [ -f "$$i" -o -f "$$i.a" ]; then \ |
a22fb399 | 491 | ( echo installing $$i; \ |
49e04548 | 492 | if [ "$(PLATFORM)" != "Cygwin" ]; then \ |
7104c376 RL |
493 | cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \ |
494 | chmod 555 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \ | |
30c08f2e | 495 | mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i; \ |
1fe198b6 | 496 | else \ |
15da07d4 | 497 | c=`echo $$i | sed 's/^lib\(.*\)\.dll\.a/cyg\1-$(SHLIB_VERSION_NUMBER).dll/'`; \ |
7104c376 RL |
498 | cp $$c $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new; \ |
499 | chmod 755 $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new; \ | |
30c08f2e | 500 | mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c.new $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$c; \ |
15da07d4 RL |
501 | cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \ |
502 | chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new; \ | |
503 | mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/lib/$$i; \ | |
1fe198b6 | 504 | fi ); \ |
2c975b50 | 505 | fi; \ |
a22fb399 RL |
506 | done; \ |
507 | ( here="`pwd`"; \ | |
508 | cd $(INSTALL_PREFIX)$(INSTALLTOP)/lib; \ | |
4c3a2d64 | 509 | $(MAKE) -f $$here/Makefile HERE="$$here" link-shared ); \ |
e68cb95d RL |
510 | if [ "$(INSTALLTOP)" != "/usr" ]; then \ |
511 | echo 'OpenSSL shared libraries have been installed in:'; \ | |
512 | echo ' $(INSTALLTOP)'; \ | |
513 | echo ''; \ | |
c0cc5c30 | 514 | sed -e '1,/^$$/d' doc/openssl-shared.txt; \ |
e68cb95d | 515 | fi; \ |
a22fb399 | 516 | fi |
ef8a18f4 RL |
517 | cp libcrypto.pc $(INSTALL_PREFIX)$(INSTALLTOP)/lib/pkgconfig |
518 | chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/pkgconfig/libcrypto.pc | |
519 | cp libssl.pc $(INSTALL_PREFIX)$(INSTALLTOP)/lib/pkgconfig | |
520 | chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/pkgconfig/libssl.pc | |
8e7a8b68 | 521 | cp openssl.pc $(INSTALL_PREFIX)$(INSTALLTOP)/lib/pkgconfig |
eeff6bb6 | 522 | chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/lib/pkgconfig/openssl.pc |
e6e7b5f3 BM |
523 | |
524 | install_docs: | |
525 | @$(PERL) $(TOP)/util/mkdir-p.pl \ | |
e1c55191 UM |
526 | $(INSTALL_PREFIX)$(MANDIR)/man1 \ |
527 | $(INSTALL_PREFIX)$(MANDIR)/man3 \ | |
528 | $(INSTALL_PREFIX)$(MANDIR)/man5 \ | |
529 | $(INSTALL_PREFIX)$(MANDIR)/man7 | |
623e9e66 | 530 | @pod2man="`cd util; ./pod2mantest $(PERL)`"; \ |
ec9f67f6 RL |
531 | here="`pwd`"; \ |
532 | filecase=; \ | |
94c1672e | 533 | if [ "$(PLATFORM)" = "DJGPP" -o "$(PLATFORM)" = "Cygwin" -o "$(PLATFORM)" = "mingw" ]; then \ |
ec9f67f6 RL |
534 | filecase=-i; \ |
535 | fi; \ | |
cfd06a62 | 536 | set -e; for i in doc/apps/*.pod; do \ |
c6ce792f | 537 | fn=`basename $$i .pod`; \ |
401ee37a | 538 | sec=`$(PERL) util/extract-section.pl 1 < $$i`; \ |
1cc087fe | 539 | echo "installing man$$sec/$$fn.$${sec}$(MANSUFFIX)"; \ |
d13363af | 540 | (cd `$(PERL) util/dirname.pl $$i`; \ |
623e9e66 | 541 | sh -c "$$pod2man \ |
2962243d RL |
542 | --section=$$sec --center=OpenSSL \ |
543 | --release=$(VERSION) `basename $$i`") \ | |
1cc087fe | 544 | > $(INSTALL_PREFIX)$(MANDIR)/man$$sec/$$fn.$${sec}$(MANSUFFIX); \ |
ec9f67f6 | 545 | $(PERL) util/extract-names.pl < $$i | \ |
a4ae7466 RL |
546 | (grep -v $$filecase "^$$fn\$$"; true) | \ |
547 | (grep -v "[ ]"; true) | \ | |
ec9f67f6 RL |
548 | (cd $(INSTALL_PREFIX)$(MANDIR)/man$$sec/; \ |
549 | while read n; do \ | |
49096719 | 550 | $$here/util/point.sh $$fn.$${sec}$(MANSUFFIX) "$$n".$${sec}$(MANSUFFIX); \ |
ec9f67f6 | 551 | done); \ |
f6f99618 | 552 | done; \ |
cfd06a62 | 553 | set -e; for i in doc/crypto/*.pod doc/ssl/*.pod; do \ |
c6ce792f | 554 | fn=`basename $$i .pod`; \ |
401ee37a | 555 | sec=`$(PERL) util/extract-section.pl 3 < $$i`; \ |
1cc087fe | 556 | echo "installing man$$sec/$$fn.$${sec}$(MANSUFFIX)"; \ |
d13363af | 557 | (cd `$(PERL) util/dirname.pl $$i`; \ |
623e9e66 | 558 | sh -c "$$pod2man \ |
2962243d RL |
559 | --section=$$sec --center=OpenSSL \ |
560 | --release=$(VERSION) `basename $$i`") \ | |
1cc087fe | 561 | > $(INSTALL_PREFIX)$(MANDIR)/man$$sec/$$fn.$${sec}$(MANSUFFIX); \ |
ec9f67f6 | 562 | $(PERL) util/extract-names.pl < $$i | \ |
a4ae7466 RL |
563 | (grep -v $$filecase "^$$fn\$$"; true) | \ |
564 | (grep -v "[ ]"; true) | \ | |
ec9f67f6 RL |
565 | (cd $(INSTALL_PREFIX)$(MANDIR)/man$$sec/; \ |
566 | while read n; do \ | |
49096719 | 567 | $$here/util/point.sh $$fn.$${sec}$(MANSUFFIX) "$$n".$${sec}$(MANSUFFIX); \ |
ec9f67f6 | 568 | done); \ |
c6ce792f | 569 | done |
d02b48c6 RE |
570 | |
571 | # DO NOT DELETE THIS LINE -- make depend depends on it. |