]>
Commit | Line | Data |
---|---|---|
d56128f0 RE |
1 | ## |
2 | ## Makefile for OpenSSL | |
3 | ## | |
9ab6fc59 | 4 | ## {- join("\n## ", @autowarntext) -} |
d56128f0 | 5 | |
107b5792 RL |
6 | VERSION={- $config{version} -} |
7 | MAJOR={- $config{major} -} | |
8 | MINOR={- $config{minor} -} | |
9 | SHLIB_VERSION_NUMBER={- $config{shlib_version_number} -} | |
10 | SHLIB_VERSION_HISTORY={- $config{shlib_version_history} -} | |
11 | SHLIB_MAJOR={- $config{shlib_major} -} | |
12 | SHLIB_MINOR={- $config{shlib_minor} -} | |
e987f9f2 RL |
13 | SHLIB_EXT={- $target{shared_extension} || ".so" -} |
14 | SHLIB_EXT_SIMPLE={- $target{shared_extension_simple} || ".so" -} | |
15 | SHLIB_EXT_IMPORT={- $target{shared_import_extension} || "" -} | |
16 | DSO_EXT={- $target{dso_extension} || ".so" -} | |
107b5792 RL |
17 | PLATFORM={- $config{target} -} |
18 | OPTIONS={- $config{options} -} | |
19 | CONFIGURE_ARGS=({- join(", ",quotify_l(@{$config{perlargv}})) -}) | |
20 | SHLIB_TARGET={- $target{shared_target} -} | |
b436a982 | 21 | |
30c08f2e RL |
22 | # HERE indicates where this Makefile lives. This can be used to indicate |
23 | # where sub-Makefiles are expected to be. Currently has very limited usage, | |
24 | # and should probably not be bothered with at all. | |
25 | HERE=. | |
26 | ||
3c65577f | 27 | # DESTDIR is for package builders so that they can configure |
e5f3045f BM |
28 | # for, say, /usr/ and yet have everything installed to /tmp/somedir/usr/. |
29 | # Normally it is left empty. | |
3c65577f | 30 | DESTDIR= |
462ba4f6 | 31 | |
d74dfafd RL |
32 | # Do not edit these manually. Use Configure with --prefix or --openssldir |
33 | # to change this! Short explanation in the top comment in Configure | |
5482dac9 RL |
34 | INSTALLTOP={- # $prefix is used in the OPENSSLDIR perl snippet |
35 | # | |
36 | our $prefix = $config{prefix} || "/usr/local"; | |
37 | $prefix -} | |
38 | OPENSSLDIR={- # | |
39 | # The logic here is that if no --openssldir was given, | |
40 | # OPENSSLDIR will get the value from $prefix plus "/ssl". | |
41 | # If --openssldir was given and the value is an absolute | |
42 | # path, OPENSSLDIR will get its value without change. | |
43 | # If the value from --openssldir is a relative path, | |
44 | # OPENSSLDIR will get $prefix with the --openssldir | |
45 | # value appended as a subdirectory. | |
46 | # | |
47 | use File::Spec::Functions; | |
48 | our $openssldir = | |
49 | $config{openssldir} ? | |
50 | (file_name_is_absolute($config{openssldir}) ? | |
51 | $config{openssldir} | |
52 | : catdir($prefix, $config{openssldir})) | |
53 | : catdir($prefix, "ssl"); | |
54 | $openssldir -} | |
55 | LIBDIR={- # | |
56 | # if $prefix/lib$target{multilib} is not an existing | |
57 | # directory, then assume that it's not searched by linker | |
58 | # automatically, in which case adding $target{multilib} suffix | |
59 | # causes more grief than we're ready to tolerate, so don't... | |
60 | our $multilib = | |
61 | -d "$prefix/lib$target{multilib}" ? $target{multilib} : ""; | |
62 | our $libdir = $config{libdir} || "lib$multilib"; | |
63 | $libdir -} | |
64 | ENGINESDIR={- use File::Spec::Functions; | |
65 | catdir($prefix,$libdir,"engines") -} | |
d56128f0 | 66 | |
d02b48c6 RE |
67 | # NO_IDEA - Define to build without the IDEA algorithm |
68 | # NO_RC4 - Define to build without the RC4 algorithm | |
69 | # NO_RC2 - Define to build without the RC2 algorithm | |
70 | # THREADS - Define when building with threads, you will probably also need any | |
c98d63f2 | 71 | # system defines as well, i.e. _REENTRANT for Solaris 2.[34] |
d02b48c6 RE |
72 | # TERMIO - Define the termio terminal subsystem, needed if sgtty is missing. |
73 | # TERMIOS - Define the termios terminal subsystem, Silicon Graphics. | |
74 | # LONGCRYPT - Define to use HPUX 10.x's long password modification to crypt(3). | |
75 | # DEVRANDOM - Give this the value of the 'random device' if your OS supports | |
58964a49 RE |
76 | # one. 32 bytes will be read from this when the random |
77 | # number generator is initalised. | |
baf748ba | 78 | # SSL_FORBID_ENULL - define if you want the server to be not able to use the |
58964a49 | 79 | # NULL encryption ciphers. |
d02b48c6 RE |
80 | # |
81 | # LOCK_DEBUG - turns on lots of lock debug output :-) | |
f3f1cf84 | 82 | # REF_DEBUG - turn on some xyz_free() assertions. |
58964a49 | 83 | # REF_PRINT - prints some stuff on structure free. |
d02b48c6 | 84 | # MFUNC - Make all Malloc/Free/Realloc calls call |
58964a49 RE |
85 | # CRYPTO_malloc/CRYPTO_free/CRYPTO_realloc which can be setup to |
86 | # call application defined callbacks via CRYPTO_set_mem_functions() | |
87 | # MD5_ASM needs to be defined to use the x86 assembler for MD5 | |
88 | # SHA1_ASM needs to be defined to use the x86 assembler for SHA1 | |
89 | # RMD160_ASM needs to be defined to use the x86 assembler for RIPEMD160 | |
dfeab068 RE |
90 | # Do not define B_ENDIAN or L_ENDIAN if 'unsigned long' == 8. It must |
91 | # equal 4. | |
92 | # PKCS1_CHECK - pkcs1 tests. | |
d02b48c6 | 93 | |
107b5792 RL |
94 | CROSS_COMPILE= {- $config{cross_compile_prefix} -} |
95 | CC= $(CROSS_COMPILE){- $target{cc} -} | |
2952b9b8 | 96 | CFLAG={- our $cflags2 = join(" ",(map { "-D".$_} @{$target{defines}}, @{$config{defines}}),"-DOPENSSLDIR=\"\\\"\$(OPENSSLDIR)\\\"\"","-DENGINESDIR=\"\\\"\$(ENGINESDIR)\\\"\"") -} {- $target{cflags} -} {- $config{cflags} -} |
076e596f | 97 | CFLAG_Q={- $cflags2 =~ s|([\\"])|\\$1|g; $cflags2 -} {- $config{cflags} -} |
3ed1839d AP |
98 | LDFLAG= {- $target{lflags} -} {- $config{lflags} -} |
99 | PLIB_LDFLAG= {- $target{plib_lflags} -} {- $config{plib_lflags} -} | |
2952b9b8 | 100 | EX_LIBS= {- $target{ex_libs} -} {- $config{ex_libs} -} |
107b5792 RL |
101 | EXE_EXT= {- $target{exe_extension} -} |
102 | ARFLAGS= {- $target{arflags} -} | |
103 | AR=$(CROSS_COMPILE){- $target{ar} -} $(ARFLAGS) r | |
104 | RANLIB= {- $target{ranlib} -} | |
105 | NM= $(CROSS_COMPILE){- $target{nm} -} | |
106 | PERL= {- $config{perl} -} | |
9405a9a2 RS |
107 | #RM= echo -- |
108 | RM= rm -f | |
2dbb3ccd | 109 | TAR= tar |
63977104 | 110 | TARFLAGS= --no-recursion |
5482dac9 | 111 | MAKEDEPPROG=$(CROSS_COMPILE){- $config{makedepprog} -} |
d02b48c6 | 112 | |
3cc9a89d AP |
113 | # We let the C compiler driver to take care of .s files. This is done in |
114 | # order to be excused from maintaining a separate set of architecture | |
115 | # dependent assembler flags. E.g. if you throw -mcpu=ultrasparc at SPARC | |
116 | # gcc, then the driver will automatically translate it to -xarch=v8plus | |
117 | # and pass it down to assembler. | |
f072785e | 118 | AS=$(CC) -c |
01fc834b | 119 | ASFLAG=$(CFLAG) |
3cc9a89d | 120 | |
14e21f86 AP |
121 | # For x86 assembler: Set PROCESSOR to 386 if you want to support |
122 | # the 80386. | |
107b5792 | 123 | PROCESSOR= {- $config{processor} -} |
14e21f86 AP |
124 | |
125 | # CPUID module collects small commonly used assembler snippets | |
3a55c92b | 126 | APPS_OBJ={- $target{apps_obj} -} |
107b5792 | 127 | CPUID_OBJ= {- $target{cpuid_obj} -} |
b756967d | 128 | UPLINK_OBJ= {- $target{uplink_obj} -} |
107b5792 RL |
129 | BN_ASM= {- $target{bn_obj} -} |
130 | EC_ASM= {- $target{ec_obj} -} | |
131 | DES_ENC= {- $target{des_obj} -} | |
132 | AES_ENC= {- $target{aes_obj} -} | |
133 | BF_ENC= {- $target{bf_obj} -} | |
134 | CAST_ENC= {- $target{cast_obj} -} | |
135 | RC4_ENC= {- $target{rc4_obj} -} | |
136 | RC5_ENC= {- $target{rc5_obj} -} | |
137 | MD5_ASM_OBJ= {- $target{md5_obj} -} | |
138 | SHA1_ASM_OBJ= {- $target{sha1_obj} -} | |
139 | RMD160_ASM_OBJ= {- $target{rmd160_obj} -} | |
2d0b4412 | 140 | BLAKE2_OBJ= {- $target{blake2_obj} -} |
107b5792 RL |
141 | WP_ASM_OBJ= {- $target{wp_obj} -} |
142 | CMLL_ENC= {- $target{cmll_obj} -} | |
143 | MODES_ASM_OBJ= {- $target{modes_obj} -} | |
05e4e633 | 144 | PADLOCK_ASM_OBJ= {- $target{padlock_obj} -} |
107b5792 RL |
145 | CHACHA_ENC= {- $target{chacha_obj} -} |
146 | POLY1305_ASM_OBJ= {- $target{poly1305_obj} -} | |
147 | PERLASM_SCHEME= {- $target{perlasm_scheme} -} | |
58964a49 | 148 | |
ad2695b1 | 149 | # Zlib stuff |
20a5819f ML |
150 | ZLIB_INCLUDE={- $withargs{zlib_include} -} |
151 | LIBZLIB={- $withargs{zlib_lib} -} | |
ad2695b1 | 152 | |
1ab2f7f1 DSH |
153 | # This is the location of fipscanister.o and friends. |
154 | # The FIPS module build will place it $(INSTALLTOP)/lib | |
155 | # but since $(INSTALLTOP) can only take the default value | |
156 | # when the module is built it will be in /usr/local/ssl/lib | |
5084af28 | 157 | # $(INSTALLTOP) for this build may be different so hard |
1ab2f7f1 DSH |
158 | # code the path. |
159 | ||
107b5792 | 160 | FIPSLIBDIR={- $config{fipslibdir} -} |
1ab2f7f1 | 161 | |
1ab2f7f1 | 162 | # The location of the library which contains fipscanister.o |
f072785e DSH |
163 | # normally it will be libcrypto. If not compiling in FIPS mode |
164 | # at all this is empty making it a useful test for a FIPS compile. | |
1ab2f7f1 | 165 | |
107b5792 | 166 | FIPSCANLIB={- $config{fips} ? "libcrypto" : "" -} |
1ab2f7f1 DSH |
167 | |
168 | # Shared library base address. Currently only used on Windows. | |
169 | # | |
170 | ||
107b5792 | 171 | BASEADDR={- $config{baseaddr} -} |
1ab2f7f1 | 172 | |
107b5792 | 173 | DIRS= {- join(" ", @{$config{dirs}}) -} |
0973910f | 174 | SHLIBDIRS= crypto ssl |
dee502be | 175 | INSTALL_SUBS= engines apps tools |
0973910f | 176 | |
d02b48c6 | 177 | # dirs in crypto to build |
107b5792 | 178 | SDIRS= {- join(" ", @{$config{sdirs}}) -} |
d02b48c6 | 179 | |
f777408f RL |
180 | # tests to perform. "alltests" is a special word indicating that all tests |
181 | # should be performed. | |
182 | TESTS = alltests | |
183 | ||
42ba5d23 | 184 | MAKEFILE= Makefile |
d02b48c6 | 185 | |
d74dfafd | 186 | MANDIR=$(INSTALLTOP)/share/man |
d02b48c6 RE |
187 | MAN1=1 |
188 | MAN3=3 | |
1cc087fe | 189 | MANSUFFIX= |
60cdb821 | 190 | HTMLSUFFIX=html |
d74dfafd | 191 | HTMLDIR=$(INSTALLTOP)/share/doc/$(BASENAME)/html |
d02b48c6 RE |
192 | SHELL=/bin/sh |
193 | ||
58964a49 | 194 | TOP= . |
b436a982 | 195 | LIBS= libcrypto.a libssl.a |
a22fb399 RL |
196 | SHARED_CRYPTO=libcrypto$(SHLIB_EXT) |
197 | SHARED_SSL=libssl$(SHLIB_EXT) | |
5de75fb4 | 198 | SHARED_LIBS={- $disabled{shared} ? '' : '$(SHARED_CRYPTO) $(SHARED_SSL)' -} |
45502bfe | 199 | SHARED_CFLAG={- $target{shared_cflag} -} |
2952b9b8 | 200 | SHARED_LDFLAG={- $target{shared_ldflag}." ".$config{shared_ldflag} |
5482dac9 RL |
201 | # Unlike other OSes (like Solaris, Linux, Tru64, |
202 | # IRIX) BSD run-time linkers (tested OpenBSD, NetBSD | |
203 | # and FreeBSD) "demand" RPATH set on .so objects. | |
204 | # Apparently application RPATH is not global and | |
205 | # does not apply to .so linked with other .so. | |
206 | # Problem manifests itself when libssl.so fails to | |
207 | # load libcrypto.so. One can argue that we should | |
208 | # engrave this into Makefile.shared rules or into | |
209 | # BSD-* config lines above. Meanwhile let's try to | |
210 | # be cautious and pass -rpath to linker only when | |
211 | # $prefix is not /usr. | |
212 | . ($config{target} =~ m|^BSD-| && $prefix !~ m|^/usr/.*$| | |
213 | ? " -Wl,-rpath,\$\$(LIBRPATH)" : "") -} | |
64c443e3 | 214 | SHARED_RCFLAG={- $target{shared_rcflag} -} |
343ec2b0 | 215 | DYNAMIC_ENGINES={- $config{dynamic_engines} -} |
58964a49 RE |
216 | |
217 | GENERAL= Makefile | |
9ce5db45 | 218 | BASENAME= openssl |
58964a49 | 219 | NAME= $(BASENAME)-$(VERSION) |
4a544810 | 220 | TARFILE= ../$(NAME).tar |
58964a49 | 221 | HEADER= e_os.h |
d02b48c6 | 222 | |
9405a9a2 RS |
223 | # Directories created on install if they don't exist. |
224 | INSTALLDIRS= \ | |
3c65577f RL |
225 | $(DESTDIR)$(INSTALLTOP)/bin \ |
226 | $(DESTDIR)$(INSTALLTOP)/$(LIBDIR) \ | |
227 | $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/engines \ | |
228 | $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig \ | |
229 | $(DESTDIR)$(INSTALLTOP)/include/openssl \ | |
230 | $(DESTDIR)$(OPENSSLDIR)/misc \ | |
231 | $(DESTDIR)$(OPENSSLDIR)/certs \ | |
232 | $(DESTDIR)$(OPENSSLDIR)/private | |
9405a9a2 | 233 | |
7f458a48 | 234 | ENGDIRS={- join(" ", @{$config{engdirs}}) -} |
235 | ||
68a5f1a2 | 236 | all: Makefile build_all_but_tests |
d02b48c6 | 237 | |
02c31fa4 | 238 | # as we stick to -e, CLEARENV ensures that local variables in lower |
a41b0aad AP |
239 | # Makefiles remain local and variable. $${VAR+VAR} is tribute to Korn |
240 | # shell, which [annoyingly enough] terminates unset with error if VAR | |
241 | # is not present:-( TOP= && unset TOP is tribute to HP-UX /bin/sh, | |
242 | # which terminates unset with error if no variable was present:-( | |
243 | CLEARENV= TOP= && unset TOP $${LIB+LIB} $${LIBS+LIBS} \ | |
02c31fa4 AP |
244 | $${INCLUDE+INCLUDE} $${INCLUDES+INCLUDES} \ |
245 | $${DIR+DIR} $${DIRS+DIRS} $${SRC+SRC} \ | |
246 | $${LIBSRC+LIBSRC} $${LIBOBJ+LIBOBJ} $${ALL+ALL} \ | |
a80e33b9 | 247 | $${HEADER+HEADER} \ |
02c31fa4 AP |
248 | $${GENERAL+GENERAL} $${CFLAGS+CFLAGS} \ |
249 | $${ASFLAGS+ASFLAGS} $${AFLAGS+AFLAGS} \ | |
dce1cc2a | 250 | $${LDCMD+LDCMD} $${LDFLAGS+LDFLAGS} $${SCRIPTS+SCRIPTS} \ |
2f3c39bc | 251 | $${SHAREDCMD+SHAREDCMD} $${SHAREDFLAGS+SHAREDFLAGS} \ |
02c31fa4 AP |
252 | $${SHARED_LIB+SHARED_LIB} $${LIBEXTRAS+LIBEXTRAS} |
253 | ||
193ed2d7 AP |
254 | # LC_ALL=C ensures that error [and other] messages are delivered in |
255 | # same language for uniform treatment. | |
256 | BUILDENV= LC_ALL=C PLATFORM='$(PLATFORM)' PROCESSOR='$(PROCESSOR)'\ | |
076e596f | 257 | CC='$(CC)' CFLAG='$(CFLAG)' CFLAG_Q='$(CFLAG_Q)' \ |
45502bfe | 258 | SHARED_CFLAG='$(SHARED_CFLAG)' \ |
f072785e | 259 | AS='$(CC)' ASFLAG='$(CFLAG) -c' \ |
a370537b | 260 | AR='$(AR)' NM='$(NM)' RANLIB='$(RANLIB)' \ |
45502bfe | 261 | CROSS_COMPILE='$(CROSS_COMPILE)' \ |
343ec2b0 | 262 | PERL='$(PERL)' DYNAMIC_ENGINES='$(DYNAMIC_ENGINES)' \ |
6727565a | 263 | SDIRS='$(SDIRS)' LIBRPATH='$(INSTALLTOP)/$(LIBDIR)' \ |
3c65577f | 264 | DESTDIR='$(DESTDIR)' \ |
a370537b | 265 | INSTALLTOP='$(INSTALLTOP)' OPENSSLDIR='$(OPENSSLDIR)' \ |
19c5314f | 266 | LIBDIR='$(LIBDIR)' \ |
c86ddbe6 | 267 | SHARED_LDFLAG='$(SHARED_LDFLAG)' \ |
64c443e3 | 268 | SHARED_RCFLAG='$(SHARED_RCFLAG)' \ |
cc7399e7 | 269 | ZLIB_INCLUDE='$(ZLIB_INCLUDE)' LIBZLIB='$(LIBZLIB)' \ |
a370537b | 270 | EXE_EXT='$(EXE_EXT)' SHARED_LIBS='$(SHARED_LIBS)' \ |
e987f9f2 RL |
271 | SHLIB_EXT='$(SHLIB_EXT)' DSO_EXT='$(DSO_EXT)' \ |
272 | SHLIB_TARGET='$(SHLIB_TARGET)' \ | |
c86ddbe6 RL |
273 | LDFLAG='$(LDFLAG)' \ |
274 | PLIB_LDFLAG='$(PLIB_LDFLAG)' EX_LIBS='$(EX_LIBS)' \ | |
b756967d | 275 | APPS_OBJ='$(APPS_OBJ)' UPLINK_OBJ='$(UPLINK_OBJ)' \ |
6019cdd3 | 276 | CPUID_OBJ='$(CPUID_OBJ)' BN_ASM='$(BN_ASM)' \ |
9405a9a2 | 277 | EC_ASM='$(EC_ASM)' DES_ENC='$(DES_ENC)' \ |
a370537b AP |
278 | AES_ENC='$(AES_ENC)' CMLL_ENC='$(CMLL_ENC)' \ |
279 | BF_ENC='$(BF_ENC)' CAST_ENC='$(CAST_ENC)' \ | |
280 | RC4_ENC='$(RC4_ENC)' RC5_ENC='$(RC5_ENC)' \ | |
7f458a48 | 281 | ENGDIRS='$(ENGDIRS)' \ |
a370537b AP |
282 | SHA1_ASM_OBJ='$(SHA1_ASM_OBJ)' \ |
283 | MD5_ASM_OBJ='$(MD5_ASM_OBJ)' \ | |
284 | RMD160_ASM_OBJ='$(RMD160_ASM_OBJ)' \ | |
2d0b4412 | 285 | BLAKE2_OBJ='$(BLAKE2_OBJ)' \ |
a370537b | 286 | WP_ASM_OBJ='$(WP_ASM_OBJ)' \ |
8a1c92ce | 287 | MODES_ASM_OBJ='$(MODES_ASM_OBJ)' \ |
05e4e633 | 288 | PADLOCK_ASM_OBJ='$(PADLOCK_ASM_OBJ)' \ |
22c2e80f AP |
289 | CHACHA_ENC='$(CHACHA_ENC)' \ |
290 | POLY1305_ASM_OBJ='$(POLY1305_ASM_OBJ)' \ | |
a370537b | 291 | PERLASM_SCHEME='$(PERLASM_SCHEME)' \ |
1ab2f7f1 DSH |
292 | FIPSLIBDIR='${FIPSLIBDIR}' \ |
293 | FIPSCANLIB="$${FIPSCANLIB:-$(FIPSCANLIB)}" \ | |
02c31fa4 AP |
294 | THIS=$${THIS:-$@} MAKEFILE=Makefile MAKEOVERRIDES= |
295 | # MAKEOVERRIDES= effectively "equalizes" GNU-ish and SysV-ish make flavors, | |
296 | # which in turn eliminates ambiguities in variable treatment with -e. | |
d0590fe6 | 297 | |
b480283c RL |
298 | # BUILD_CMD is a generic macro to build a given target in a given |
299 | # subdirectory. The target must be given through the shell variable | |
300 | # `target' and the subdirectory to build in must be given through `dir'. | |
301 | # This macro shouldn't be used directly, use RECURSIVE_BUILD_CMD or | |
302 | # BUILD_ONE_CMD instead. | |
303 | # | |
b480283c RL |
304 | # RECURSIVE_BUILD_CMD is a macro to build a given target in all |
305 | # subdirectories defined in $(DIRS). It requires that the target | |
306 | # is given through the shell variable `target'. | |
9405a9a2 RS |
307 | # |
308 | # BUILD_ONE_CMD is a macro to build a given target in a given | |
309 | # subdirectory if that subdirectory is part of $(DIRS). It requires | |
310 | # exactly the same shell variables as BUILD_CMD. | |
02c31fa4 AP |
311 | BUILD_CMD= if [ -d "$$dir" ]; then \ |
312 | ( cd $$dir && echo "making $$target in $$dir..." && \ | |
313 | $(CLEARENV) && $(MAKE) -e $(BUILDENV) TOP=.. DIR=$$dir $$target \ | |
314 | ) || exit 1; \ | |
315 | fi | |
316 | RECURSIVE_BUILD_CMD=for dir in $(DIRS); do $(BUILD_CMD); done | |
f5ce5e14 | 317 | BUILD_ONE_CMD=\ |
b3b201b6 | 318 | if expr " $(DIRS) " : ".* $$dir " >/dev/null 2>&1; then \ |
f5ce5e14 RL |
319 | $(BUILD_CMD); \ |
320 | fi | |
88c80b3e | 321 | |
734540f8 | 322 | reflect: |
02c31fa4 | 323 | @[ -n "$(THIS)" ] && $(CLEARENV) && $(MAKE) $(THIS) -e $(BUILDENV) |
734540f8 | 324 | |
4c82171a | 325 | sub_all: build_all |
c3f22253 | 326 | |
68a5f1a2 RL |
327 | build_all_but_tests: build_libs build_apps build_tools |
328 | build_all: build_all_but_tests build_tests | |
88c80b3e | 329 | |
177b5f9c RL |
330 | build_libs: build_libcrypto build_libssl openssl.pc |
331 | ||
332 | build_libcrypto: build_crypto build_engines libcrypto.pc | |
333 | build_libssl: build_ssl libssl.pc | |
88c80b3e RL |
334 | |
335 | build_crypto: | |
f072785e | 336 | @dir=crypto; target=all; $(BUILD_ONE_CMD) |
c3f22253 | 337 | build_ssl: build_crypto |
f5ce5e14 | 338 | @dir=ssl; target=all; $(BUILD_ONE_CMD) |
c3f22253 | 339 | build_engines: build_crypto |
ed28aef8 | 340 | @dir=engines; target=all; AS='$(CC) -c'; export AS; $(BUILD_ONE_CMD) |
c3f22253 RS |
341 | |
342 | build_apps: build_libs | |
f5ce5e14 | 343 | @dir=apps; target=all; $(BUILD_ONE_CMD) |
c3f22253 | 344 | build_tests: build_libs |
f5ce5e14 | 345 | @dir=test; target=all; $(BUILD_ONE_CMD) |
c3f22253 | 346 | build_tools: build_libs |
f5ce5e14 | 347 | @dir=tools; target=all; $(BUILD_ONE_CMD) |
ba5477eb RL |
348 | |
349 | all_testapps: build_libs build_testapps | |
350 | build_testapps: | |
f5ce5e14 | 351 | @dir=crypto; target=testapps; $(BUILD_ONE_CMD) |
b436a982 | 352 | |
f072785e | 353 | libcrypto$(SHLIB_EXT): libcrypto.a |
f4316c36 | 354 | @if [ "$(SHLIB_TARGET)" != "" ]; then \ |
225c2721 DSH |
355 | if [ "$(FIPSCANLIB)" = "libcrypto" ]; then \ |
356 | FIPSLD_CC="$(CC)"; CC=fips/fipsld; \ | |
357 | export CC FIPSLD_CC; \ | |
358 | fi; \ | |
24e20db4 | 359 | $(MAKE) -e SHLIBDIRS=crypto CC="$${CC:-$(CC)}" build-shared; \ |
f4316c36 RL |
360 | else \ |
361 | echo "There's no support for shared libraries on this platform" >&2; \ | |
d0590fe6 | 362 | exit 1; \ |
f4316c36 | 363 | fi |
0f180d1d | 364 | |
a22fb399 | 365 | libssl$(SHLIB_EXT): libcrypto$(SHLIB_EXT) libssl.a |
f4316c36 | 366 | @if [ "$(SHLIB_TARGET)" != "" ]; then \ |
5ddcb866 | 367 | $(MAKE) SHLIBDIRS=ssl SHLIBDEPS='-lcrypto' build-shared; \ |
f4316c36 RL |
368 | else \ |
369 | echo "There's no support for shared libraries on this platform" >&2; \ | |
d0590fe6 | 370 | exit 1; \ |
f4316c36 | 371 | fi |
b436a982 | 372 | |
a22fb399 | 373 | link-shared: |
a370537b | 374 | @ set -e; for i in $(SHLIBDIRS); do \ |
755c5b33 | 375 | $(MAKE) -f $(HERE)/Makefile.shared -e $(BUILDENV) \ |
a370537b AP |
376 | LIBNAME=$$i LIBVERSION=$(SHLIB_MAJOR).$(SHLIB_MINOR) \ |
377 | LIBCOMPATVERSIONS=";$(SHLIB_VERSION_HISTORY)" \ | |
30afcc07 | 378 | symlink.$(SHLIB_TARGET); \ |
6b86bad5 | 379 | libs="$$libs -l$$i"; \ |
0fd44e2d RL |
380 | done |
381 | ||
30afcc07 RL |
382 | build-shared: do_$(SHLIB_TARGET) link-shared |
383 | ||
384 | do_$(SHLIB_TARGET): | |
a370537b | 385 | @ set -e; libs='-L. $(SHLIBDEPS)'; for i in $(SHLIBDIRS); do \ |
02c31fa4 | 386 | $(CLEARENV) && $(MAKE) -f Makefile.shared -e $(BUILDENV) \ |
a370537b AP |
387 | LIBNAME=$$i LIBVERSION=$(SHLIB_MAJOR).$(SHLIB_MINOR) \ |
388 | LIBCOMPATVERSIONS=";$(SHLIB_VERSION_HISTORY)" \ | |
30afcc07 | 389 | LIBDEPS="$$libs $(EX_LIBS)" \ |
e048fd51 | 390 | link_shlib.$(SHLIB_TARGET); \ |
c1269c81 | 391 | libs="-l$$i $$libs"; \ |
fcf80c46 RL |
392 | case "$(PLATFORM)" in \ |
393 | Cygwin*) \ | |
394 | rm -f apps/cyg$$i-$(SHLIB_MAJOR).$(SHLIB_MINOR).dll; \ | |
395 | rm -f test/cyg$$i-$(SHLIB_MAJOR).$(SHLIB_MINOR).dll; \ | |
396 | cp cyg$$i-$(SHLIB_MAJOR).$(SHLIB_MINOR).dll apps/; \ | |
397 | cp cyg$$i-$(SHLIB_MAJOR).$(SHLIB_MINOR).dll test/; \ | |
398 | ;; \ | |
399 | mingw*) \ | |
520f434b RL |
400 | arch=; \ |
401 | if expr $(PLATFORM) : mingw64 > /dev/null; then \ | |
402 | arch=-x64; \ | |
403 | fi; \ | |
404 | rm -f apps/lib$$i-$(SHLIB_MAJOR)_$(SHLIB_MINOR)$$arch.dll; \ | |
405 | rm -f test/lib$$i-$(SHLIB_MAJOR)_$(SHLIB_MINOR)$$arch.dll; \ | |
406 | cp lib$$i-$(SHLIB_MAJOR)_$(SHLIB_MINOR)$$arch.dll apps/; \ | |
407 | cp lib$$i-$(SHLIB_MAJOR)_$(SHLIB_MINOR)$$arch.dll test/; \ | |
408 | ;; \ | |
fcf80c46 | 409 | esac; \ |
a3fffd64 RL |
410 | done |
411 | ||
0962fbbf RL |
412 | libcrypto.pc: Makefile |
413 | @ ( echo 'prefix=$(INSTALLTOP)'; \ | |
414 | echo 'exec_prefix=$${prefix}'; \ | |
6727565a | 415 | echo 'libdir=$${exec_prefix}/$(LIBDIR)'; \ |
0962fbbf RL |
416 | echo 'includedir=$${prefix}/include'; \ |
417 | echo ''; \ | |
418 | echo 'Name: OpenSSL-libcrypto'; \ | |
419 | echo 'Description: OpenSSL cryptography library'; \ | |
420 | echo 'Version: '$(VERSION); \ | |
421 | echo 'Requires: '; \ | |
04296664 DSH |
422 | echo 'Libs: -L$${libdir} -lcrypto'; \ |
423 | echo 'Libs.private: $(EX_LIBS)'; \ | |
e36827f6 | 424 | echo 'Cflags: -I$${includedir}' ) > libcrypto.pc |
0962fbbf RL |
425 | |
426 | libssl.pc: Makefile | |
427 | @ ( echo 'prefix=$(INSTALLTOP)'; \ | |
428 | echo 'exec_prefix=$${prefix}'; \ | |
6727565a | 429 | echo 'libdir=$${exec_prefix}/$(LIBDIR)'; \ |
0962fbbf RL |
430 | echo 'includedir=$${prefix}/include'; \ |
431 | echo ''; \ | |
e6479c76 | 432 | echo 'Name: OpenSSL-libssl'; \ |
0962fbbf RL |
433 | echo 'Description: Secure Sockets Layer and cryptography libraries'; \ |
434 | echo 'Version: '$(VERSION); \ | |
e6479c76 MF |
435 | echo 'Requires.private: libcrypto'; \ |
436 | echo 'Libs: -L$${libdir} -lssl'; \ | |
04296664 | 437 | echo 'Libs.private: $(EX_LIBS)'; \ |
e36827f6 | 438 | echo 'Cflags: -I$${includedir}' ) > libssl.pc |
0962fbbf | 439 | |
42ba5d23 | 440 | openssl.pc: Makefile |
56824b96 RL |
441 | @ ( echo 'prefix=$(INSTALLTOP)'; \ |
442 | echo 'exec_prefix=$${prefix}'; \ | |
6727565a | 443 | echo 'libdir=$${exec_prefix}/$(LIBDIR)'; \ |
56824b96 RL |
444 | echo 'includedir=$${prefix}/include'; \ |
445 | echo ''; \ | |
446 | echo 'Name: OpenSSL'; \ | |
447 | echo 'Description: Secure Sockets Layer and cryptography libraries and tools'; \ | |
448 | echo 'Version: '$(VERSION); \ | |
e6479c76 | 449 | echo 'Requires: libssl libcrypto' ) > openssl.pc |
56824b96 | 450 | |
d10dac11 RS |
451 | Makefile: Makefile.in Configure config |
452 | @echo "Makefile is older than Makefile.in, Configure or config." | |
49b81422 | 453 | @echo "Reconfigure the source tree (via './config' or 'perl Configure'), please." |
9535d202 BL |
454 | @false |
455 | ||
dfeab068 | 456 | libclean: |
acb2f06a | 457 | rm -f *.map *.so *.so.* *.dylib *.dll engines/*.so engines/*.dll engines/*.dylib *.a engines/*.a */lib */*/lib |
dfeab068 | 458 | |
7841edc9 | 459 | clean: libclean |
6ab36414 | 460 | rm -f */*/*.o */*.o *.o core a.out fluff testlog make.log cctest cctest.c |
56999ba5 | 461 | rm -rf *.bak certs/.0 |
02c31fa4 | 462 | @set -e; target=clean; $(RECURSIVE_BUILD_CMD) |
34ccd24d | 463 | rm -f $(LIBS) tags TAGS |
0962fbbf | 464 | rm -f openssl.pc libssl.pc libcrypto.pc |
7841edc9 | 465 | rm -f speed.* .pure |
bb8f3c58 | 466 | rm -f $(TARFILE) |
d02b48c6 | 467 | |
1cc67fa8 RL |
468 | gentests: |
469 | @(cd test && echo "generating dummy tests (if needed)..." && \ | |
a370537b | 470 | $(CLEARENV) && $(MAKE) -e $(BUILDENV) TESTS='$(TESTS)' OPENSSL_DEBUG_MEMORY=on generate ); |
1cc67fa8 | 471 | |
007c80ea | 472 | test: tests |
d02b48c6 | 473 | |
6ab36414 | 474 | tests: build_tests |
bb8f3c58 | 475 | @(cd test && echo "testing..." && \ |
220bd849 | 476 | $(CLEARENV) && $(MAKE) -e $(BUILDENV) TOP=.. TESTS='$(TESTS)' OPENSSL_DEBUG_MEMORY=on OPENSSL_CONF=../apps/openssl.cnf tests ); |
1a3ae788 RS |
477 | @if [ -z "$(CROSS_COMPILE)" ]; then \ |
478 | OPENSSL_CONF=apps/openssl.cnf util/opensslwrap.sh version -a; \ | |
479 | fi | |
d02b48c6 | 480 | |
1780e6d9 RL |
481 | list-tests: |
482 | @(cd test && \ | |
483 | $(CLEARENV) && $(MAKE) -e $(BUILDENV) TOP=.. list-tests) | |
484 | ||
d7f0ab5f UM |
485 | report: |
486 | @$(PERL) util/selftest.pl | |
487 | ||
34ccd24d RS |
488 | tags TAGS: FORCE |
489 | rm -f TAGS tags | |
490 | -ctags -R . | |
7a64489f | 491 | -etags `find . -name '*.[ch]' -o -name '*.pm'` |
34ccd24d RS |
492 | |
493 | FORCE: | |
d02b48c6 | 494 | |
8cef1212 RS |
495 | depend: |
496 | @set -e; target=depend; $(RECURSIVE_BUILD_CMD) | |
497 | ||
498 | update: generate errors ordinals depend | |
499 | ||
500 | generate: | |
7eba4e62 VD |
501 | (cd apps && PERL='${PERL}' $(MAKE) generate) |
502 | (cd crypto/bn && PERL='${PERL}' $(MAKE) generate) | |
503 | (cd crypto/objects && PERL='${PERL}' $(MAKE) generate) | |
8cef1212 | 504 | |
d02b48c6 | 505 | errors: |
797c61aa | 506 | $(PERL) util/ck_errf.pl -strict */*.c */*/*.c |
f6485909 | 507 | $(PERL) util/mkerr.pl -recurse -write |
506fec1a | 508 | (cd engines; $(MAKE) PERL=$(PERL) errors) |
d02b48c6 | 509 | |
6928b617 RL |
510 | ordinals: util/libcrypto.num util/libssl.num test_ordinals TABLE |
511 | util/libcrypto.num:: | |
f6485909 | 512 | $(PERL) util/mkdef.pl crypto update |
6928b617 | 513 | util/libssl.num:: |
f6485909 | 514 | $(PERL) util/mkdef.pl ssl update |
8cef1212 RS |
515 | test_ordinals: |
516 | TOP=$(TOP) PERL=$(PERL) $(PERL) test/run_tests.pl test_ordinals | |
7740a1c6 | 517 | |
97a0cc52 | 518 | TABLE: Configure Configurations/*.conf |
2330e18b | 519 | (echo 'Output of `Configure TABLE'"':"; \ |
f6485909 | 520 | $(PERL) Configure TABLE) > TABLE |
7740a1c6 | 521 | |
f9de8446 LJ |
522 | # Build distribution tar-file. As the list of files returned by "find" is |
523 | # pretty long, on several platforms a "too many arguments" error or similar | |
524 | # would occur. Therefore the list of files is temporarily stored into a file | |
525 | # and read directly, requiring GNU-Tar. Call "make TAR=gtar dist" if the normal | |
526 | # tar does not support the --files-from option. | |
4a544810 | 527 | TAR_COMMAND=$(TAR) $(TARFLAGS) --files-from $(TARFILE).list \ |
2b0e65d0 | 528 | --owner 0 --group 0 \ |
4a544810 | 529 | --transform 's|^|$(NAME)/|' \ |
27f98436 RL |
530 | -cvf - |
531 | ||
4a544810 | 532 | $(TARFILE).list: |
2b0e65d0 RL |
533 | git diff --quiet HEAD |
534 | git ls-files | sort > $(TARFILE).list | |
27f98436 | 535 | |
4a544810 | 536 | tar: $(TARFILE).list |
756b9a00 LJ |
537 | find . -type d -print | xargs chmod 755 |
538 | find . -type f -print | xargs chmod a+r | |
539 | find . -type f -perm -0100 -print | xargs chmod a+x | |
4a544810 RL |
540 | $(TAR_COMMAND) | gzip --best > $(TARFILE).gz |
541 | rm -f $(TARFILE).list | |
542 | ls -l $(TARFILE).gz | |
d02b48c6 | 543 | |
4a544810 RL |
544 | tar-snap: $(TARFILE).list |
545 | $(TAR_COMMAND) > $(TARFILE) | |
546 | rm -f $(TARFILE).list | |
547 | ls -l $(TARFILE) | |
41d2a336 | 548 | |
7984f082 | 549 | dist: |
99aab161 | 550 | $(PERL) Configure dist |
a370537b | 551 | @$(MAKE) SDIRS='$(SDIRS)' clean |
4d3c30a1 | 552 | @$(MAKE) TAR='$(TAR)' TARFLAGS='$(TARFLAGS)' $(DISTTARVARS) tar |
d02b48c6 | 553 | |
28a80034 RL |
554 | install: all install_docs install_sw |
555 | ||
9405a9a2 RS |
556 | uninstall: uninstall_sw uninstall_docs |
557 | ||
28a80034 | 558 | install_sw: |
9405a9a2 | 559 | @$(PERL) $(TOP)/util/mkdir-p.pl $(INSTALLDIRS) |
dee502be | 560 | @set -e; for i in include/openssl/*.h; do \ |
3c65577f RL |
561 | (cp $$i $(DESTDIR)$(INSTALLTOP)/$$i; \ |
562 | chmod 644 $(DESTDIR)$(INSTALLTOP)/$$i ); \ | |
2a4a0a34 | 563 | done; |
dee502be | 564 | @set -e; target=install; for dir in $(INSTALL_SUBS); do $(BUILD_CMD); done |
d341e402 | 565 | @set -e; liblist="$(LIBS)"; for i in $$liblist ;\ |
d02b48c6 | 566 | do \ |
b436a982 RL |
567 | if [ -f "$$i" ]; then \ |
568 | ( echo installing $$i; \ | |
3c65577f RL |
569 | cp $$i $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \ |
570 | $(RANLIB) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \ | |
571 | chmod 644 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \ | |
572 | mv -f $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i.new $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i ); \ | |
2c975b50 LJ |
573 | fi; \ |
574 | done; | |
cfd06a62 | 575 | @set -e; if [ -n "$(SHARED_LIBS)" ]; then \ |
a22fb399 RL |
576 | tmp="$(SHARED_LIBS)"; \ |
577 | for i in $${tmp:-x}; \ | |
578 | do \ | |
1fe198b6 | 579 | if [ -f "$$i" -o -f "$$i.a" ]; then \ |
520f434b RL |
580 | case "$(PLATFORM)" in \ |
581 | Cygwin*) \ | |
582 | c=`echo $$i | sed 's/^lib\(.*\)\.dll/cyg\1-$(SHLIB_VERSION_NUMBER).dll/'`; \ | |
583 | echo installing $$c; \ | |
3c65577f RL |
584 | cp $$c $(DESTDIR)$(INSTALLTOP)/bin/$$c.new; \ |
585 | chmod 755 $(DESTDIR)$(INSTALLTOP)/bin/$$c.new; \ | |
586 | mv -f $(DESTDIR)$(INSTALLTOP)/bin/$$c.new $(DESTDIR)$(INSTALLTOP)/bin/$$c; \ | |
520f434b RL |
587 | echo installing $$i.a; \ |
588 | cp $$i.a $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i.a.new; \ | |
589 | chmod 644 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i.a.new; \ | |
590 | mv -f $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i.a.new $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i.a; \ | |
591 | ;; \ | |
592 | mingw*) \ | |
593 | arch=; \ | |
594 | if expr $(PLATFORM) : mingw64 > /dev/null; then \ | |
595 | arch=-x64; \ | |
596 | fi; \ | |
597 | m=`echo $$i | sed -e 's/\.dll$$/-$(SHLIB_MAJOR)_$(SHLIB_MINOR)'"$$arch"'.dll/'`; \ | |
598 | echo installing $$m; \ | |
599 | cp $$m $(DESTDIR)$(INSTALLTOP)/bin/$$m.new; \ | |
600 | chmod 755 $(DESTDIR)$(INSTALLTOP)/bin/$$m.new; \ | |
601 | mv -f $(DESTDIR)$(INSTALLTOP)/bin/$$m.new $(DESTDIR)$(INSTALLTOP)/bin/$$m; \ | |
602 | echo installing $$i.a; \ | |
603 | cp $$i.a $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i.a.new; \ | |
604 | chmod 555 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i.a.new; \ | |
605 | mv -f $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i.a.new $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i.a; \ | |
606 | ;; \ | |
607 | *) \ | |
608 | echo installing $$i; \ | |
3c65577f RL |
609 | cp $$i $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \ |
610 | chmod 555 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i.new; \ | |
611 | mv -f $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i.new $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i; \ | |
520f434b RL |
612 | ;; \ |
613 | esac; \ | |
2c975b50 | 614 | fi; \ |
a22fb399 RL |
615 | done; \ |
616 | ( here="`pwd`"; \ | |
3c65577f | 617 | cd $(DESTDIR)$(INSTALLTOP)/$(LIBDIR); \ |
4c3a2d64 | 618 | $(MAKE) -f $$here/Makefile HERE="$$here" link-shared ); \ |
e68cb95d RL |
619 | if [ "$(INSTALLTOP)" != "/usr" ]; then \ |
620 | echo 'OpenSSL shared libraries have been installed in:'; \ | |
621 | echo ' $(INSTALLTOP)'; \ | |
e68cb95d | 622 | fi; \ |
a22fb399 | 623 | fi |
3c65577f RL |
624 | cp libcrypto.pc $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig |
625 | chmod 644 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libcrypto.pc | |
626 | cp libssl.pc $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig | |
627 | chmod 644 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libssl.pc | |
628 | cp openssl.pc $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig | |
629 | chmod 644 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/openssl.pc | |
e6e7b5f3 | 630 | |
9405a9a2 | 631 | uninstall_sw: |
3c65577f | 632 | cd include/openssl && files=* && cd $(DESTDIR)$(INSTALLTOP)/include/openssl && $(RM) $$files |
9405a9a2 RS |
633 | @for i in $(LIBS) ;\ |
634 | do \ | |
635 | test -f "$$i" && \ | |
3c65577f RL |
636 | echo $(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i && \ |
637 | $(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i; \ | |
9405a9a2 RS |
638 | done; |
639 | @if [ -n "$(SHARED_LIBS)" ]; then \ | |
640 | tmp="$(SHARED_LIBS)"; \ | |
641 | for i in $${tmp:-x}; \ | |
642 | do \ | |
643 | if [ -f "$$i" -o -f "$$i.a" ]; then \ | |
520f434b RL |
644 | case "$(PLATFORM)" in \ |
645 | Cygwin*) \ | |
646 | c=`echo $$i | sed 's/^lib\(.*\)\.dll/cyg\1-$(SHLIB_VERSION_NUMBER).dll/'`; \ | |
3c65577f RL |
647 | echo $(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$c; \ |
648 | $(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$c; \ | |
520f434b RL |
649 | echo $(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i.a; \ |
650 | $(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i.a; \ | |
651 | ;; \ | |
652 | mingw*) \ | |
653 | arch=; \ | |
654 | if expr $(PLATFORM) : mingw64 > /dev/null; then \ | |
655 | arch=-x64; \ | |
656 | fi; \ | |
657 | m=`echo $$i | sed -e 's/\.dll$$/-$(SHLIB_MAJOR)_$(SHLIB_MINOR)'"$$arch"'.dll/'`; \ | |
658 | echo $(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$m; \ | |
659 | $(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$m; \ | |
660 | echo $(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i.a; \ | |
661 | $(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i.a; \ | |
662 | ;; \ | |
663 | *) \ | |
3c65577f RL |
664 | echo $(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i; \ |
665 | $(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/$$i; \ | |
520f434b RL |
666 | ;; \ |
667 | esac; \ | |
9405a9a2 RS |
668 | fi; \ |
669 | done; \ | |
670 | fi | |
3c65577f RL |
671 | $(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libcrypto.pc |
672 | $(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/libssl.pc | |
673 | $(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/pkgconfig/openssl.pc | |
df302cdc | 674 | @target=uninstall; for dir in $(INSTALL_SUBS); do $(BUILD_CMD); done |
9405a9a2 | 675 | |
60cdb821 UM |
676 | install_html_docs: |
677 | here="`pwd`"; \ | |
82d9185a | 678 | filecase=; \ |
457f7b14 | 679 | case "$(PLATFORM)" in DJGPP|Cygwin*|mingw*|darwin*-*-cc) \ |
82d9185a JR |
680 | filecase=-i; \ |
681 | esac; \ | |
60cdb821 | 682 | for subdir in apps crypto ssl; do \ |
3c65577f | 683 | $(PERL) $(TOP)/util/mkdir-p $(DESTDIR)$(HTMLDIR)/$$subdir; \ |
60cdb821 UM |
684 | for i in doc/$$subdir/*.pod; do \ |
685 | fn=`basename $$i .pod`; \ | |
686 | echo "installing html/$$fn.$(HTMLSUFFIX)"; \ | |
687 | cat $$i \ | |
688 | | sed -r 's/L<([^)]*)(\([0-9]\))?\|([^)]*)(\([0-9]\))?>/L<\1|\3>/g' \ | |
690a2b1f | 689 | | pod2html --podroot=doc --htmlroot=.. --podpath=$$subdir:apps:crypto:ssl \ |
60cdb821 | 690 | | sed -r 's/<!DOCTYPE.*//g' \ |
3c65577f | 691 | > $(DESTDIR)$(HTMLDIR)/$$subdir/$$fn.$(HTMLSUFFIX); \ |
60cdb821 UM |
692 | $(PERL) util/extract-names.pl < $$i | \ |
693 | grep -v $$filecase "^$$fn\$$" | \ | |
3c65577f | 694 | (cd $(DESTDIR)$(HTMLDIR)/$$subdir; \ |
60cdb821 | 695 | while read n; do \ |
220bd849 | 696 | PLATFORM=$(PLATFORM) $$here/util/point.sh $$fn.$(HTMLSUFFIX) "$$n".$(HTMLSUFFIX); \ |
60cdb821 UM |
697 | done); \ |
698 | done; \ | |
699 | done | |
700 | ||
9405a9a2 RS |
701 | uninstall_html_docs: |
702 | here="`pwd`"; \ | |
703 | filecase=; \ | |
704 | case "$(PLATFORM)" in DJGPP|Cygwin*|mingw*|darwin*-*-cc) \ | |
705 | filecase=-i; \ | |
706 | esac; \ | |
707 | for subdir in apps crypto ssl; do \ | |
708 | for i in doc/$$subdir/*.pod; do \ | |
709 | fn=`basename $$i .pod`; \ | |
3c65577f | 710 | $(RM) $(DESTDIR)$(HTMLDIR)/$$subdir/$$fn.$(HTMLSUFFIX); \ |
9405a9a2 RS |
711 | $(PERL) util/extract-names.pl < $$i | \ |
712 | grep -v $$filecase "^$$fn\$$" | \ | |
713 | while read n; do \ | |
3c65577f | 714 | $(RM) $(DESTDIR)$(HTMLDIR)/$$subdir/"$$n".$(HTMLSUFFIX); \ |
9405a9a2 RS |
715 | done; \ |
716 | done; \ | |
717 | done | |
718 | ||
e6e7b5f3 BM |
719 | install_docs: |
720 | @$(PERL) $(TOP)/util/mkdir-p.pl \ | |
3c65577f RL |
721 | $(DESTDIR)$(MANDIR)/man1 \ |
722 | $(DESTDIR)$(MANDIR)/man3 \ | |
723 | $(DESTDIR)$(MANDIR)/man5 \ | |
724 | $(DESTDIR)$(MANDIR)/man7 | |
ec9f67f6 RL |
725 | here="`pwd`"; \ |
726 | filecase=; \ | |
457f7b14 | 727 | case "$(PLATFORM)" in DJGPP|Cygwin*|mingw*|darwin*-*-cc) \ |
ec9f67f6 | 728 | filecase=-i; \ |
b3ef742c | 729 | esac; \ |
cfd06a62 | 730 | set -e; for i in doc/apps/*.pod; do \ |
c6ce792f | 731 | fn=`basename $$i .pod`; \ |
401ee37a | 732 | sec=`$(PERL) util/extract-section.pl 1 < $$i`; \ |
1cc087fe | 733 | echo "installing man$$sec/$$fn.$${sec}$(MANSUFFIX)"; \ |
d13363af | 734 | (cd `$(PERL) util/dirname.pl $$i`; \ |
a4a93411 | 735 | pod2man \ |
2962243d | 736 | --section=$$sec --center=OpenSSL \ |
a4a93411 | 737 | --release=$(VERSION) `basename $$i`) \ |
3c65577f | 738 | > $(DESTDIR)$(MANDIR)/man$$sec/$$fn.$${sec}$(MANSUFFIX); \ |
ec9f67f6 | 739 | $(PERL) util/extract-names.pl < $$i | \ |
f6098f2d RL |
740 | (grep -v $$filecase "^$$fn\$$"; true) | \ |
741 | (grep -v "[ ]"; true) | \ | |
3c65577f | 742 | (cd $(DESTDIR)$(MANDIR)/man$$sec/; \ |
ec9f67f6 | 743 | while read n; do \ |
220bd849 | 744 | PLATFORM=$(PLATFORM) $$here/util/point.sh $$fn.$${sec}$(MANSUFFIX) "$$n".$${sec}$(MANSUFFIX); \ |
ec9f67f6 | 745 | done); \ |
f6f99618 | 746 | done; \ |
cfd06a62 | 747 | set -e; for i in doc/crypto/*.pod doc/ssl/*.pod; do \ |
c6ce792f | 748 | fn=`basename $$i .pod`; \ |
401ee37a | 749 | sec=`$(PERL) util/extract-section.pl 3 < $$i`; \ |
1cc087fe | 750 | echo "installing man$$sec/$$fn.$${sec}$(MANSUFFIX)"; \ |
d13363af | 751 | (cd `$(PERL) util/dirname.pl $$i`; \ |
a4a93411 | 752 | pod2man \ |
2962243d | 753 | --section=$$sec --center=OpenSSL \ |
a4a93411 | 754 | --release=$(VERSION) `basename $$i`) \ |
3c65577f | 755 | > $(DESTDIR)$(MANDIR)/man$$sec/$$fn.$${sec}$(MANSUFFIX); \ |
ec9f67f6 | 756 | $(PERL) util/extract-names.pl < $$i | \ |
f6098f2d RL |
757 | (grep -v $$filecase "^$$fn\$$"; true) | \ |
758 | (grep -v "[ ]"; true) | \ | |
3c65577f | 759 | (cd $(DESTDIR)$(MANDIR)/man$$sec/; \ |
ec9f67f6 | 760 | while read n; do \ |
220bd849 | 761 | PLATFORM=$(PLATFORM) $$here/util/point.sh $$fn.$${sec}$(MANSUFFIX) "$$n".$${sec}$(MANSUFFIX); \ |
ec9f67f6 | 762 | done); \ |
c6ce792f | 763 | done |
d02b48c6 | 764 | |
9405a9a2 RS |
765 | uninstall_docs: |
766 | @here="`pwd`"; \ | |
767 | filecase=; \ | |
768 | case "$(PLATFORM)" in DJGPP|Cygwin*|mingw*) \ | |
769 | filecase=-i; \ | |
770 | esac; \ | |
771 | for i in doc/apps/*.pod; do \ | |
772 | fn=`basename $$i .pod`; \ | |
773 | sec=`$(PERL) util/extract-section.pl 1 < $$i`; \ | |
3c65577f RL |
774 | echo $(RM) $(DESTDIR)$(MANDIR)/man$$sec/$$fn.$${sec}$(MANSUFFIX); \ |
775 | $(RM) $(DESTDIR)$(MANDIR)/man$$sec/$$fn.$${sec}$(MANSUFFIX); \ | |
9405a9a2 RS |
776 | $(PERL) util/extract-names.pl < $$i | \ |
777 | (grep -v $$filecase "^$$fn\$$"; true) | \ | |
778 | (grep -v "[ ]"; true) | \ | |
779 | while read n; do \ | |
3c65577f RL |
780 | echo $(RM) $(DESTDIR)$(MANDIR)/man$$sec/"$$n".$${sec}$(MANSUFFIX); \ |
781 | $(RM) $(DESTDIR)$(MANDIR)/man$$sec/"$$n".$${sec}$(MANSUFFIX); \ | |
9405a9a2 RS |
782 | done; \ |
783 | done; \ | |
784 | for i in doc/crypto/*.pod doc/ssl/*.pod; do \ | |
785 | fn=`basename $$i .pod`; \ | |
786 | sec=`$(PERL) util/extract-section.pl 3 < $$i`; \ | |
3c65577f RL |
787 | echo $(RM) $(DESTDIR)$(MANDIR)/man$$sec/$$fn.$${sec}$(MANSUFFIX); \ |
788 | $(RM) $(DESTDIR)$(MANDIR)/man$$sec/$$fn.$${sec}$(MANSUFFIX); \ | |
9405a9a2 RS |
789 | $(PERL) util/extract-names.pl < $$i | \ |
790 | (grep -v $$filecase "^$$fn\$$"; true) | \ | |
791 | (grep -v "[ ]"; true) | \ | |
792 | while read n; do \ | |
3c65577f RL |
793 | echo $(RM) $(DESTDIR)$(MANDIR)/man$$sec/"$$n".$${sec}$(MANSUFFIX); \ |
794 | $(RM) $(DESTDIR)$(MANDIR)/man$$sec/"$$n".$${sec}$(MANSUFFIX); \ | |
9405a9a2 RS |
795 | done; \ |
796 | done | |
797 | ||
d02b48c6 | 798 | # DO NOT DELETE THIS LINE -- make depend depends on it. |