2 ## Makefile for OpenSSL
4 ## {- join("\n## ", @autowarntext) -}
6 our $makedepprog = platform->makedepprog();
8 sub windowsdll { $config{target} =~ /^(?:Cygwin|mingw)/ }
10 # Shared AIX support is special. We put libcrypto[64].so.ver into
11 # libcrypto.a and use libcrypto_a.a as static one.
12 sub sharedaix { !$disabled{shared} && $config{target} =~ /^aix/ }
14 our $sover_dirname = platform->shlib_version_as_filename();
16 # This makes sure things get built in the order they need
21 return "$target: build_generated\n\t\$(MAKE) depend && \$(MAKE) _$target\n_$target";
24 our $COLUMNS = $ENV{COLUMNS};
25 if ($COLUMNS =~ /^\d+$/) {
26 $COLUMNS = int($COLUMNS) - 2; # 2 to leave space for ending ' \'
32 my $item_sep = shift; # string
33 my $line_length = shift; # number of chars
39 my $fill_line = $result[$resultpos] // '';
41 ($fill_line eq '' ? '' : $fill_line . $item_sep) . $_;
43 if (length($newline) > $line_length) {
44 # If this is a single item and the intended result line
45 # is empty, we put it there anyway
46 if ($fill_line eq '') {
47 $result[$resultpos++] = $newline;
49 $result[++$resultpos] = $_;
52 $result[$resultpos] = $newline;
59 PLATFORM={- $config{target} -}
60 OPTIONS={- $config{options} -}
61 CONFIGURE_ARGS=({- join(", ",quotify_l(@{$config{perlargv}})) -})
62 SRCDIR={- $config{sourcedir} -}
63 BLDDIR={- $config{builddir} -}
65 VERSION={- "$config{full_version}" -}
66 MAJOR={- $config{major} -}
67 MINOR={- $config{minor} -}
68 SHLIB_VERSION_NUMBER={- $config{shlib_version} -}
69 SHLIB_TARGET={- $target{shared_target} -}
71 LIBS={- join(" \\\n" . ' ' x 5,
72 fill_lines(" ", $COLUMNS - 5,
73 map { platform->staticlib($_) // () }
74 @{$unified_info{libraries}})) -}
75 SHLIBS={- join(" \\\n" . ' ' x 7,
76 fill_lines(" ", $COLUMNS - 7,
77 map { platform->sharedlib($_) // () }
78 @{$unified_info{libraries}})) -}
79 SHLIB_INFO={- join(" \\\n" . ' ' x 11,
80 fill_lines(" ", $COLUMNS - 11,
81 map { my $x = platform->sharedlib($_);
82 my $y = platform->sharedlib_simple($_);
83 $x ? "\"$x;$y\"" : () }
84 @{$unified_info{libraries}})) -}
85 MODULES={- join(" \\\n" . ' ' x 8,
86 fill_lines(" ", $COLUMNS - 8,
87 map { platform->dso($_) }
88 @{$unified_info{modules}})) -}
89 PROGRAMS={- join(" \\\n" . ' ' x 9,
90 fill_lines(" ", $COLUMNS - 9,
91 map { platform->bin($_) }
92 @{$unified_info{programs}})) -}
93 SCRIPTS={- join(" \\\n" . ' ' x 8,
94 fill_lines(" ", $COLUMNS - 8, @{$unified_info{scripts}})) -}
95 {- output_off() if $disabled{makedepend}; "" -}
96 DEPS={- join(" \\\n" . ' ' x 5,
97 fill_lines(" ", $COLUMNS - 5,
98 map { platform->isobj($_) ? platform->dep($_) : () }
99 grep { $unified_info{sources}->{$_}->[0] =~ /\.c$/ }
100 keys %{$unified_info{sources}})); -}
101 {- output_on() if $disabled{makedepend}; "" -}
102 GENERATED_MANDATORY={- join(" \\\n" . ' ' x 20,
103 fill_lines(" ", $COLUMNS - 20,
104 @{$unified_info{depends}->{""}})) -}
105 GENERATED={- # common0.tmpl provides @generated
106 join(" \\\n" . ' ' x 5,
107 fill_lines(" ", $COLUMNS - 5,
108 map { platform->convertext($_) } @generated )) -}
111 join(" \\\n" . ' ' x 13,
112 fill_lines(" ", $COLUMNS - 13,
113 map { platform->staticlib($_) // () }
114 grep { !$unified_info{attributes}->{libraries}->{$_}->{noinst} }
115 @{$unified_info{libraries}}))
118 join(" \\\n" . ' ' x 15,
119 fill_lines(" ", $COLUMNS - 15,
120 map { platform->sharedlib($_) // () }
121 grep { !$unified_info{attributes}->{libraries}->{$_}->{noinst} }
122 @{$unified_info{libraries}}))
124 INSTALL_SHLIB_INFO={-
125 join(" \\\n" . ' ' x 19,
126 fill_lines(" ", $COLUMNS - 19,
127 map { my $x = platform->sharedlib($_);
128 my $y = platform->sharedlib_simple($_);
129 $x ? "\"$x;$y\"" : () }
130 grep { !$unified_info{attributes}->{libraries}->{$_}->{noinst} }
131 @{$unified_info{libraries}}))
134 join(" \\\n" . ' ' x 16,
135 fill_lines(" ", $COLUMNS - 16,
136 map { platform->dso($_) }
137 grep { !$unified_info{attributes}->{modules}->{$_}->{noinst}
138 && $unified_info{attributes}->{modules}->{$_}->{engine} }
139 @{$unified_info{modules}}))
142 join(" \\\n" . ' ' x 16,
143 fill_lines(" ", $COLUMNS - 16, map { platform->bin($_) }
144 grep { !$unified_info{attributes}->{programs}->{$_}->{noinst} }
145 @{$unified_info{programs}}))
148 join(" \\\n" . ' ' x 12,
149 fill_lines(" ", $COLUMNS - 12,
150 map { my $x = $unified_info{attributes}->{scripts}->{$_}->{linkname};
152 grep { !$unified_info{attributes}->{scripts}->{$_}->{noinst}
153 && !$unified_info{attributes}->{scripts}->{$_}->{misc} }
154 @{$unified_info{scripts}}))
157 join(" \\\n" . ' ' x 13,
158 fill_lines(" ", $COLUMNS - 13,
159 map { my $x = $unified_info{attributes}->{scripts}->{$_}->{linkname};
161 grep { !$unified_info{attributes}->{scripts}->{$_}->{noinst}
162 && $unified_info{attributes}->{scripts}->{$_}->{misc} }
163 @{$unified_info{scripts}}))
166 join(" \\\n" . ' ' x 10,
167 fill_lines(" ", $COLUMNS - 10, map { platform->bin($_) }
168 @{$unified_info{htmldocs}->{man1}})) -}
170 join(" \\\n" . ' ' x 10,
171 fill_lines(" ", $COLUMNS - 10, map { platform->bin($_) }
172 @{$unified_info{htmldocs}->{man3}})) -}
174 join(" \\\n" . ' ' x 10,
175 fill_lines(" ", $COLUMNS - 10, map { platform->bin($_) }
176 @{$unified_info{htmldocs}->{man5}})) -}
178 join(" \\\n" . ' ' x 10,
179 fill_lines(" ", $COLUMNS - 10, map { platform->bin($_) }
180 @{$unified_info{htmldocs}->{man7}})) -}
182 join(" \\\n" . ' ' x 9,
183 fill_lines(" ", $COLUMNS - 9, map { platform->bin($_) }
184 @{$unified_info{mandocs}->{man1}})) -}
186 join(" \\\n" . ' ' x 9,
187 fill_lines(" ", $COLUMNS - 9, map { platform->bin($_) }
188 @{$unified_info{mandocs}->{man3}})) -}
190 join(" \\\n" . ' ' x 9,
191 fill_lines(" ", $COLUMNS - 9, map { platform->bin($_) }
192 @{$unified_info{mandocs}->{man5}})) -}
194 join(" \\\n" . ' ' x 9,
195 fill_lines(" ", $COLUMNS - 9, map { platform->bin($_) }
196 @{$unified_info{mandocs}->{man7}})) -}
198 APPS_OPENSSL={- use File::Spec::Functions;
199 catfile("apps","openssl") -}
201 # DESTDIR is for package builders so that they can configure for, say,
202 # /usr/ and yet have everything installed to /tmp/somedir/usr/.
203 # Normally it is left empty.
206 # Do not edit these manually. Use Configure with --prefix or --openssldir
207 # to change this! Short explanation in the top comment in Configure
208 INSTALLTOP={- # $prefix is used in the OPENSSLDIR perl snippet
210 our $prefix = $config{prefix} || "/usr/local";
213 # The logic here is that if no --openssldir was given,
214 # OPENSSLDIR will get the value from $prefix plus "/ssl".
215 # If --openssldir was given and the value is an absolute
216 # path, OPENSSLDIR will get its value without change.
217 # If the value from --openssldir is a relative path,
218 # OPENSSLDIR will get $prefix with the --openssldir
219 # value appended as a subdirectory.
221 use File::Spec::Functions;
223 $config{openssldir} ?
224 (file_name_is_absolute($config{openssldir}) ?
226 : catdir($prefix, $config{openssldir}))
227 : catdir($prefix, "ssl");
229 LIBDIR={- our $libdir = $config{libdir};
232 # if $prefix/lib$target{multilib} is not an existing
233 # directory, then assume that it's not searched by linker
234 # automatically, in which case adding $target{multilib} suffix
235 # causes more grief than we're ready to tolerate, so don't...
237 -d "$prefix/lib$target{multilib}" ? $target{multilib} : "";
238 $libdir = "lib$multilib";
240 file_name_is_absolute($libdir) ? "" : $libdir -}
241 # $(libdir) is chosen to be compatible with the GNU coding standards
242 libdir={- file_name_is_absolute($libdir)
243 ? $libdir : '$(INSTALLTOP)/$(LIBDIR)' -}
244 ENGINESDIR=$(libdir)/engines-{- $sover_dirname -}
245 MODULESDIR=$(libdir)/ossl-modules
247 # Convenience variable for those who want to set the rpath in shared
248 # libraries and applications
251 MANDIR=$(INSTALLTOP)/share/man
252 DOCDIR=$(INSTALLTOP)/share/doc/$(BASENAME)
253 HTMLDIR=$(DOCDIR)/html
255 # MANSUFFIX is for the benefit of anyone who may want to have a suffix
256 # appended after the manpage file section number. "ssl" is popular,
257 # resulting in files such as config.5ssl rather than config.5.
261 # For "optional" echo messages, to get "real" silence
264 ##### User defined commands and flags ################################
266 # We let the C compiler driver to take care of .s files. This is done in
267 # order to be excused from maintaining a separate set of architecture
268 # dependent assembler flags. E.g. if you throw -mcpu=ultrasparc at SPARC
269 # gcc, then the driver will automatically translate it to -xarch=v8plus
270 # and pass it down to assembler. In any case, we do not define AS or
271 # ASFLAGS for this reason.
273 CROSS_COMPILE={- $config{CROSS_COMPILE} -}
274 CC=$(CROSS_COMPILE){- $config{CC} -}
275 CXX={- $config{CXX} ? "\$(CROSS_COMPILE)$config{CXX}" : '' -}
276 CPPFLAGS={- our $cppflags1 = join(" ",
277 (map { "-D".$_} @{$config{CPPDEFINES}}),
278 (map { "-I".$_} @{$config{CPPINCLUDES}}),
279 @{$config{CPPFLAGS}}) -}
280 CFLAGS={- join(' ', @{$config{CFLAGS}}) -}
281 CXXFLAGS={- join(' ', @{$config{CXXFLAGS}}) -}
282 LDFLAGS= {- join(' ', @{$config{LDFLAGS}}) -}
283 EX_LIBS= {- join(' ', @{$config{LDLIBS}}) -}
285 MAKEDEPEND={- $config{makedepprog} -}
287 PERL={- $config{PERL} -}
289 AR=$(CROSS_COMPILE){- $config{AR} -}
290 ARFLAGS= {- join(' ', @{$config{ARFLAGS}}) -}
291 RANLIB={- $config{RANLIB} ? "\$(CROSS_COMPILE)$config{RANLIB}" : "true"; -}
292 RC= $(CROSS_COMPILE){- $config{RC} -}
293 RCFLAGS={- join(' ', @{$config{RCFLAGS}}) -} {- $target{shared_rcflag} -}
297 TAR= {- $target{TAR} || "tar" -}
298 TARFLAGS= {- $target{TARFLAGS} -}
301 NAME= $(BASENAME)-$(VERSION)
302 # Relative to $(SRCDIR)
303 TARFILE= ../$(NAME).tar
305 ##### Project flags ##################################################
307 # Variables starting with CNF_ are common variables for all product types
309 CNF_CPPFLAGS={- our $cppflags2 =
310 join(' ', $target{cppflags} || (),
311 (map { "-D".$_} @{$target{defines}},
312 @{$config{defines}}),
313 (map { "-I".$_} @{$target{includes}},
314 @{$config{includes}}),
315 @{$config{cppflags}}) -}
316 CNF_CFLAGS={- join(' ', $target{cflags} || (),
317 @{$config{cflags}}) -}
318 CNF_CXXFLAGS={- join(' ', $target{cxxflags} || (),
319 @{$config{cxxflags}}) -}
320 CNF_LDFLAGS={- join(' ', $target{lflags} || (),
321 @{$config{lflags}}) -}
322 CNF_EX_LIBS={- join(' ', $target{ex_libs} || (),
323 @{$config{ex_libs}}) -}
325 # Variables starting with LIB_ are used to build library object files
326 # and shared libraries.
327 # Variables starting with DSO_ are used to build DSOs and their object files.
328 # Variables starting with BIN_ are used to build programs and their object
331 LIB_CPPFLAGS={- our $lib_cppflags =
332 join(' ', $target{lib_cppflags} || (),
333 $target{shared_cppflag} || (),
335 @{$config{lib_defines} || ()},
336 @{$config{shared_defines} || ()}),
337 @{$config{lib_cppflags}},
338 @{$config{shared_cppflag}});
339 join(' ', $lib_cppflags,
341 'OPENSSLDIR="\"$(OPENSSLDIR)\""',
342 'ENGINESDIR="\"$(ENGINESDIR)\""',
343 'MODULESDIR="\"$(MODULESDIR)\""'),
344 '$(CNF_CPPFLAGS)', '$(CPPFLAGS)') -}
345 LIB_CFLAGS={- join(' ', $target{lib_cflags} || (),
346 $target{shared_cflag} || (),
347 @{$config{lib_cflags}},
348 @{$config{shared_cflag}},
349 '$(CNF_CFLAGS)', '$(CFLAGS)') -}
350 LIB_CXXFLAGS={- join(' ', $target{lib_cxxflags} || (),
351 $target{shared_cxxflag} || (),
352 @{$config{lib_cxxflags}},
353 @{$config{shared_cxxflag}},
354 '$(CNF_CXXFLAGS)', '$(CXXFLAGS)') -}
355 LIB_LDFLAGS={- join(' ', $target{shared_ldflag} || (),
356 $config{shared_ldflag} || (),
357 '$(CNF_LDFLAGS)', '$(LDFLAGS)') -}
358 LIB_EX_LIBS=$(CNF_EX_LIBS) $(EX_LIBS)
359 DSO_CPPFLAGS={- join(' ', $target{dso_cppflags} || (),
360 $target{module_cppflags} || (),
362 @{$config{dso_defines} || ()},
363 @{$config{module_defines} || ()}),
364 @{$config{dso_cppflags}},
365 @{$config{module_cppflags}},
366 '$(CNF_CPPFLAGS)', '$(CPPFLAGS)') -}
367 DSO_CFLAGS={- join(' ', $target{dso_cflags} || (),
368 $target{module_cflags} || (),
369 @{$config{dso_cflags}},
370 @{$config{module_cflags}},
371 '$(CNF_CFLAGS)', '$(CFLAGS)') -}
372 DSO_CXXFLAGS={- join(' ', $target{dso_cxxflags} || (),
373 $target{module_cxxflags} || (),
374 @{$config{dso_cxxflags}},
375 @{$config{module_cxxflag}},
376 '$(CNF_CXXFLAGS)', '$(CXXFLAGS)') -}
377 DSO_LDFLAGS={- join(' ', $target{dso_ldflags} || (),
378 $target{module_ldflags} || (),
379 @{$config{dso_ldflags}},
380 @{$config{module_ldflags}},
381 '$(CNF_LDFLAGS)', '$(LDFLAGS)') -}
382 DSO_EX_LIBS=$(CNF_EX_LIBS) $(EX_LIBS)
383 BIN_CPPFLAGS={- join(' ', $target{bin_cppflags} || (),
384 (map { '-D'.$_ } @{$config{bin_defines} || ()}),
385 @{$config{bin_cppflags}},
386 '$(CNF_CPPFLAGS)', '$(CPPFLAGS)') -}
387 BIN_CFLAGS={- join(' ', $target{bin_cflags} || (),
388 @{$config{bin_cflags}},
389 '$(CNF_CFLAGS)', '$(CFLAGS)') -}
390 BIN_CXXFLAGS={- join(' ', $target{bin_cxxflags} || (),
391 @{$config{bin_cxxflags}},
392 '$(CNF_CXXFLAGS)', '$(CXXFLAGS)') -}
393 BIN_LDFLAGS={- join(' ', $target{bin_lflags} || (),
394 @{$config{bin_lflags}},
395 '$(CNF_LDFLAGS)', '$(LDFLAGS)') -}
396 BIN_EX_LIBS=$(CNF_EX_LIBS) $(EX_LIBS)
398 # CPPFLAGS_Q is used for one thing only: to build up buildinf.h
399 CPPFLAGS_Q={- $cppflags1 =~ s|([\\"])|\\$1|g;
400 $cppflags2 =~ s|([\\"])|\\$1|g;
401 $lib_cppflags =~ s|([\\"])|\\$1|g;
402 join(' ', $lib_cppflags || (), $cppflags2 || (),
405 PERLASM_SCHEME= {- $target{perlasm_scheme} -}
407 # For x86 assembler: Set PROCESSOR to 386 if you want to support
409 PROCESSOR= {- $config{processor} -}
411 # We want error [and other] messages in English. Trouble is that make(1)
412 # doesn't pass macros down as environment variables unless there already
413 # was corresponding variable originally set. In other words we can only
414 # reassign environment variables, but not set new ones, not in portable
415 # manner that is. That's why we reassign several, just to be sure...
420 # The main targets ###################################################
422 {- dependmagic('build_sw'); -}: build_libs_nodep build_modules_nodep build_programs_nodep link-utils
423 {- dependmagic('build_libs'); -}: build_libs_nodep
424 {- dependmagic('build_modules'); -}: build_modules_nodep
425 {- dependmagic('build_programs'); -}: build_programs_nodep
427 build_docs: build_man_docs build_html_docs
428 build_man_docs: $(MANDOCS1) $(MANDOCS3) $(MANDOCS5) $(MANDOCS7)
429 build_html_docs: $(HTMLDOCS1) $(HTMLDOCS3) $(HTMLDOCS5) $(HTMLDOCS7)
431 build_generated: $(GENERATED_MANDATORY)
432 build_libs_nodep: libcrypto.pc libssl.pc openssl.pc
433 build_modules_nodep: $(MODULES)
434 build_programs_nodep: $(PROGRAMS) $(SCRIPTS)
436 # Kept around for backward compatibility
437 build_apps build_tests: build_programs
439 # Convenience target to prebuild all generated files, not just the mandatory
441 build_all_generated: $(GENERATED_MANDATORY) $(GENERATED) build_docs
442 @ : {- output_off() if $disabled{makedepend}; "" -}
443 @echo "Warning: consider configuring with no-makedepend, because if"
444 @echo " target system doesn't have $(PERL),"
445 @echo " then make will fail..."
446 @ : {- output_on() if $disabled{makedepend}; "" -}
448 all: build_sw build_docs
451 {- dependmagic('tests'); -}: build_programs_nodep build_modules_nodep link-utils
452 @ : {- output_off() if $disabled{tests}; "" -}
454 mkdir -p test-runs; \
455 SRCTOP=../$(SRCDIR) \
456 BLDTOP=../$(BLDDIR) \
459 EXE_EXT={- platform->binext() -} \
460 OPENSSL_ENGINES=`cd ../$(BLDDIR)/engines 2>/dev/null && pwd` \
461 OPENSSL_MODULES=`cd ../$(BLDDIR)/providers 2>/dev/null && pwd` \
462 $(PERL) ../$(SRCDIR)/test/run_tests.pl $(TESTS) )
463 @ : {- if ($disabled{tests}) { output_on(); } else { output_off(); } "" -}
464 @echo "Tests are not supported with your chosen Configure options"
465 @ : {- output_on() if !$disabled{tests}; "" -}
468 @ : {- output_off() if $disabled{tests}; "" -}
469 @SRCTOP="$(SRCDIR)" \
470 $(PERL) $(SRCDIR)/test/run_tests.pl list
471 @ : {- if ($disabled{tests}) { output_on(); } else { output_off(); } "" -}
472 @echo "Tests are not supported with your chosen Configure options"
473 @ : {- output_on() if !$disabled{tests}; "" -}
475 install: install_sw install_ssldirs install_docs
477 uninstall: uninstall_docs uninstall_sw
480 @set -e; for s in $(SHLIB_INFO); do \
481 if [ "$$s" = ";" ]; then continue; fi; \
482 s1=`echo "$$s" | cut -f1 -d";"`; \
483 s2=`echo "$$s" | cut -f2 -d";"`; \
484 $(ECHO) $(RM) $$s1; {- output_off() unless windowsdll(); "" -}\
487 $(RM) fuzz/$$s1; {- output_on() unless windowsdll(); "" -}\
489 if [ "$$s1" != "$$s2" ]; then \
490 $(ECHO) $(RM) $$s2; \
495 $(RM) *{- platform->defext() -}
498 $(RM) $(HTMLDOCS1) $(HTMLDOCS3) $(HTMLDOCS5) $(HTMLDOCS7)
499 $(RM) $(MANDOCS1) $(MANDOCS3) $(MANDOCS5) $(MANDOCS7)
500 $(RM) $(PROGRAMS) $(TESTPROGS) $(MODULES) $(SCRIPTS)
501 $(RM) $(GENERATED_MANDATORY) $(GENERATED)
502 -$(RM) `find . -name '*{- platform->depext() -}' \! -name '.*' \! -type d -print`
503 -$(RM) `find . -name '*{- platform->objext() -}' \! -name '.*' \! -type d -print`
505 $(RM) tags TAGS doc-nits
506 $(RM) -r test/test-runs
507 $(RM) openssl.pc libcrypto.pc libssl.pc
508 -$(RM) `find . -type l \! -name '.*' -print`
515 # We check if any depfile is newer than Makefile and decide to
516 # concatenate only if that is true.
518 @: {- output_off() if $disabled{makedepend}; "" -}
519 @$(PERL) $(SRCDIR)/util/add-depends.pl {-
520 defined $makedepprog && $makedepprog =~ /\/makedepend/
521 ? 'makedepend' : 'gcc' -}
522 @: {- output_on() if $disabled{makedepend}; "" -}
524 # Install helper targets #############################################
526 install_sw: install_dev install_engines install_runtime
528 uninstall_sw: uninstall_runtime uninstall_engines uninstall_dev
530 install_docs: install_man_docs install_html_docs
532 uninstall_docs: uninstall_man_docs uninstall_html_docs
533 $(RM) -r $(DESTDIR)$(DOCDIR)
536 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(OPENSSLDIR)/certs
537 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(OPENSSLDIR)/private
538 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(OPENSSLDIR)/misc
539 @set -e; for x in dummy $(MISC_SCRIPTS); do \
540 if [ "$$x" = "dummy" ]; then continue; fi; \
541 x1=`echo "$$x" | cut -f1 -d:`; \
542 x2=`echo "$$x" | cut -f2 -d:`; \
543 fn=`basename $$x1`; \
544 $(ECHO) "install $$x1 -> $(DESTDIR)$(OPENSSLDIR)/misc/$$fn"; \
545 cp $$x1 $(DESTDIR)$(OPENSSLDIR)/misc/$$fn.new; \
546 chmod 755 $(DESTDIR)$(OPENSSLDIR)/misc/$$fn.new; \
547 mv -f $(DESTDIR)$(OPENSSLDIR)/misc/$$fn.new \
548 $(DESTDIR)$(OPENSSLDIR)/misc/$$fn; \
549 if [ "$$x1" != "$$x2" ]; then \
550 ln=`basename "$$x2"`; \
551 : {- output_off() unless windowsdll(); "" -}; \
552 $(ECHO) "copy $(DESTDIR)$(OPENSSLDIR)/misc/$$ln -> $(DESTDIR)$(OPENSSLDIR)/misc/$$fn"; \
553 cp $(DESTDIR)$(OPENSSLDIR)/misc/$$fn $(DESTDIR)$(OPENSSLDIR)/misc/$$ln; \
554 : {- output_on() unless windowsdll();
555 output_off() if windowsdll(); "" -}; \
556 $(ECHO) "link $(DESTDIR)$(OPENSSLDIR)/misc/$$ln -> $(DESTDIR)$(OPENSSLDIR)/misc/$$fn"; \
557 ln -sf $$fn $(DESTDIR)$(OPENSSLDIR)/misc/$$ln; \
558 : {- output_on() if windowsdll(); "" -}; \
561 @$(ECHO) "install $(SRCDIR)/apps/openssl.cnf -> $(DESTDIR)$(OPENSSLDIR)/openssl.cnf.dist"
562 @cp $(SRCDIR)/apps/openssl.cnf $(DESTDIR)$(OPENSSLDIR)/openssl.cnf.new
563 @chmod 644 $(DESTDIR)$(OPENSSLDIR)/openssl.cnf.new
564 @mv -f $(DESTDIR)$(OPENSSLDIR)/openssl.cnf.new $(DESTDIR)$(OPENSSLDIR)/openssl.cnf.dist
565 @if [ ! -f "$(DESTDIR)$(OPENSSLDIR)/openssl.cnf" ]; then \
566 $(ECHO) "install $(SRCDIR)/apps/openssl.cnf -> $(DESTDIR)$(OPENSSLDIR)/openssl.cnf"; \
567 cp $(SRCDIR)/apps/openssl.cnf $(DESTDIR)$(OPENSSLDIR)/openssl.cnf; \
568 chmod 644 $(DESTDIR)$(OPENSSLDIR)/openssl.cnf; \
570 @$(ECHO) "install $(SRCDIR)/apps/ct_log_list.cnf -> $(DESTDIR)$(OPENSSLDIR)/ct_log_list.cnf.dist"
571 @cp $(SRCDIR)/apps/ct_log_list.cnf $(DESTDIR)$(OPENSSLDIR)/ct_log_list.cnf.new
572 @chmod 644 $(DESTDIR)$(OPENSSLDIR)/ct_log_list.cnf.new
573 @mv -f $(DESTDIR)$(OPENSSLDIR)/ct_log_list.cnf.new $(DESTDIR)$(OPENSSLDIR)/ct_log_list.cnf.dist
574 @if [ ! -f "$(DESTDIR)$(OPENSSLDIR)/ct_log_list.cnf" ]; then \
575 $(ECHO) "install $(SRCDIR)/apps/ct_log_list.cnf -> $(DESTDIR)$(OPENSSLDIR)/ct_log_list.cnf"; \
576 cp $(SRCDIR)/apps/ct_log_list.cnf $(DESTDIR)$(OPENSSLDIR)/ct_log_list.cnf; \
577 chmod 644 $(DESTDIR)$(OPENSSLDIR)/ct_log_list.cnf; \
580 install_dev: install_runtime_libs
581 @[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
582 @$(ECHO) "*** Installing development files"
583 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(INSTALLTOP)/include/openssl
584 @ : {- output_off() unless grep { $_ eq "OPENSSL_USE_APPLINK" } (@{$target{defines}}, @{$config{defines}}); "" -}
585 @$(ECHO) "install $(SRCDIR)/ms/applink.c -> $(DESTDIR)$(INSTALLTOP)/include/openssl/applink.c"
586 @cp $(SRCDIR)/ms/applink.c $(DESTDIR)$(INSTALLTOP)/include/openssl/applink.c
587 @chmod 644 $(DESTDIR)$(INSTALLTOP)/include/openssl/applink.c
588 @ : {- output_on() unless grep { $_ eq "OPENSSL_USE_APPLINK" } (@{$target{defines}}, @{$config{defines}}); "" -}
589 @set -e; for i in $(SRCDIR)/include/openssl/*.h \
590 $(BLDDIR)/include/openssl/*.h; do \
592 $(ECHO) "install $$i -> $(DESTDIR)$(INSTALLTOP)/include/openssl/$$fn"; \
593 cp $$i $(DESTDIR)$(INSTALLTOP)/include/openssl/$$fn; \
594 chmod 644 $(DESTDIR)$(INSTALLTOP)/include/openssl/$$fn; \
596 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(libdir)
597 @set -e; for l in $(INSTALL_LIBS); do \
599 $(ECHO) "install $$l -> $(DESTDIR)$(libdir)/$$fn"; \
600 cp $$l $(DESTDIR)$(libdir)/$$fn.new; \
601 $(RANLIB) $(DESTDIR)$(libdir)/$$fn.new; \
602 chmod 644 $(DESTDIR)$(libdir)/$$fn.new; \
603 mv -f $(DESTDIR)$(libdir)/$$fn.new \
604 $(DESTDIR)$(libdir)/$$fn; \
606 @ : {- output_off() if $disabled{shared}; "" -}
607 @set -e; for s in $(INSTALL_SHLIB_INFO); do \
608 s1=`echo "$$s" | cut -f1 -d";"`; \
609 s2=`echo "$$s" | cut -f2 -d";"`; \
610 fn1=`basename $$s1`; \
611 fn2=`basename $$s2`; \
612 : {- output_off(); output_on() unless windowsdll() or sharedaix(); "" -}; \
613 if [ "$$fn1" != "$$fn2" ]; then \
614 $(ECHO) "link $(DESTDIR)$(libdir)/$$fn2 -> $(DESTDIR)$(libdir)/$$fn1"; \
615 ln -sf $$fn1 $(DESTDIR)$(libdir)/$$fn2; \
617 : {- output_off() unless windowsdll() or sharedaix(); output_on() if windowsdll(); "" -}; \
618 $(ECHO) "install $$s2 -> $(DESTDIR)$(libdir)/$$fn2"; \
619 cp $$s2 $(DESTDIR)$(libdir)/$$fn2.new; \
620 chmod 755 $(DESTDIR)$(libdir)/$$fn2.new; \
621 mv -f $(DESTDIR)$(libdir)/$$fn2.new \
622 $(DESTDIR)$(libdir)/$$fn2; \
623 : {- output_off() if windowsdll(); output_on() if sharedaix(); "" -}; \
624 a=$(DESTDIR)$(libdir)/$$fn2; \
625 $(ECHO) "install $$s1 -> $$a"; \
626 if [ -f $$a ]; then ( trap "rm -rf /tmp/ar.$$$$" INT 0; \
627 mkdir /tmp/ar.$$$$; ( cd /tmp/ar.$$$$; \
629 for so in `$(AR) t $$a`; do \
632 strip -X32_64 -e $$so; \
633 $(AR) r $$a.new $$so; \
636 $(AR) r $$a.new $$s1; \
638 : {- output_off() if sharedaix(); output_on(); "" -}; \
640 @ : {- output_on() if $disabled{shared}; "" -}
641 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(libdir)/pkgconfig
642 @$(ECHO) "install libcrypto.pc -> $(DESTDIR)$(libdir)/pkgconfig/libcrypto.pc"
643 @cp libcrypto.pc $(DESTDIR)$(libdir)/pkgconfig
644 @chmod 644 $(DESTDIR)$(libdir)/pkgconfig/libcrypto.pc
645 @$(ECHO) "install libssl.pc -> $(DESTDIR)$(libdir)/pkgconfig/libssl.pc"
646 @cp libssl.pc $(DESTDIR)$(libdir)/pkgconfig
647 @chmod 644 $(DESTDIR)$(libdir)/pkgconfig/libssl.pc
648 @$(ECHO) "install openssl.pc -> $(DESTDIR)$(libdir)/pkgconfig/openssl.pc"
649 @cp openssl.pc $(DESTDIR)$(libdir)/pkgconfig
650 @chmod 644 $(DESTDIR)$(libdir)/pkgconfig/openssl.pc
652 uninstall_dev: uninstall_runtime_libs
653 @$(ECHO) "*** Uninstalling development files"
654 @ : {- output_off() unless grep { $_ eq "OPENSSL_USE_APPLINK" } (@{$target{defines}}, @{$config{defines}}); "" -}
655 @$(ECHO) "$(RM) $(DESTDIR)$(INSTALLTOP)/include/openssl/applink.c"
656 @$(RM) $(DESTDIR)$(INSTALLTOP)/include/openssl/applink.c
657 @ : {- output_on() unless grep { $_ eq "OPENSSL_USE_APPLINK" } (@{$target{defines}}, @{$config{defines}}); "" -}
658 @set -e; for i in $(SRCDIR)/include/openssl/*.h \
659 $(BLDDIR)/include/openssl/*.h; do \
661 $(ECHO) "$(RM) $(DESTDIR)$(INSTALLTOP)/include/openssl/$$fn"; \
662 $(RM) $(DESTDIR)$(INSTALLTOP)/include/openssl/$$fn; \
664 -$(RMDIR) $(DESTDIR)$(INSTALLTOP)/include/openssl
665 -$(RMDIR) $(DESTDIR)$(INSTALLTOP)/include
666 @set -e; for l in $(INSTALL_LIBS); do \
668 $(ECHO) "$(RM) $(DESTDIR)$(libdir)/$$fn"; \
669 $(RM) $(DESTDIR)$(libdir)/$$fn; \
671 @ : {- output_off() if $disabled{shared}; "" -}
672 @set -e; for s in $(INSTALL_SHLIB_INFO); do \
673 s1=`echo "$$s" | cut -f1 -d";"`; \
674 s2=`echo "$$s" | cut -f2 -d";"`; \
675 fn1=`basename $$s1`; \
676 fn2=`basename $$s2`; \
677 : {- output_off() if windowsdll(); "" -}; \
678 $(ECHO) "$(RM) $(DESTDIR)$(libdir)/$$fn2"; \
679 $(RM) $(DESTDIR)$(libdir)/$$fn2; \
680 if [ "$$fn1" != "$$fn2" -a -f "$(DESTDIR)$(libdir)/$$fn1" ]; then \
681 $(ECHO) "$(RM) $(DESTDIR)$(libdir)/$$fn1"; \
682 $(RM) $(DESTDIR)$(libdir)/$$fn1; \
684 : {- output_on() if windowsdll(); "" -}{- output_off() unless windowsdll(); "" -}; \
685 $(ECHO) "$(RM) $(DESTDIR)$(libdir)/$$fn2"; \
686 $(RM) $(DESTDIR)$(libdir)/$$fn2; \
687 : {- output_on() unless windowsdll(); "" -}; \
689 @ : {- output_on() if $disabled{shared}; "" -}
690 $(RM) $(DESTDIR)$(libdir)/pkgconfig/libcrypto.pc
691 $(RM) $(DESTDIR)$(libdir)/pkgconfig/libssl.pc
692 $(RM) $(DESTDIR)$(libdir)/pkgconfig/openssl.pc
693 -$(RMDIR) $(DESTDIR)$(libdir)/pkgconfig
694 -$(RMDIR) $(DESTDIR)$(libdir)
696 install_engines: install_runtime_libs build_modules
697 @[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
698 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(ENGINESDIR)/
699 @$(ECHO) "*** Installing ENGINE modules"
700 @set -e; for e in dummy $(INSTALL_ENGINES); do \
701 if [ "$$e" = "dummy" ]; then continue; fi; \
703 $(ECHO) "install $$e -> $(DESTDIR)$(ENGINESDIR)/$$fn"; \
704 cp $$e $(DESTDIR)$(ENGINESDIR)/$$fn.new; \
705 chmod 755 $(DESTDIR)$(ENGINESDIR)/$$fn.new; \
706 mv -f $(DESTDIR)$(ENGINESDIR)/$$fn.new \
707 $(DESTDIR)$(ENGINESDIR)/$$fn; \
711 @$(ECHO) "*** Uninstalling ENGINE modules"
712 @set -e; for e in dummy $(INSTALL_ENGINES); do \
713 if [ "$$e" = "dummy" ]; then continue; fi; \
715 if [ "$$fn" = '{- platform->dso("ossltest") -}' ]; then \
718 $(ECHO) "$(RM) $(DESTDIR)$(ENGINESDIR)/$$fn"; \
719 $(RM) $(DESTDIR)$(ENGINESDIR)/$$fn; \
721 -$(RMDIR) $(DESTDIR)$(ENGINESDIR)
723 install_runtime: install_programs
725 install_runtime_libs: build_libs
726 @[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
727 @ : {- output_off() if windowsdll(); "" -}
728 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(libdir)
729 @ : {- output_on() if windowsdll(); output_off() unless windowsdll(); "" -}
730 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(INSTALLTOP)/bin
731 @ : {- output_on() unless windowsdll(); "" -}
732 @$(ECHO) "*** Installing runtime libraries"
733 @set -e; for s in dummy $(INSTALL_SHLIBS); do \
734 if [ "$$s" = "dummy" ]; then continue; fi; \
736 : {- output_off() unless windowsdll(); "" -}; \
737 $(ECHO) "install $$s -> $(DESTDIR)$(INSTALLTOP)/bin/$$fn"; \
738 cp $$s $(DESTDIR)$(INSTALLTOP)/bin/$$fn.new; \
739 chmod 755 $(DESTDIR)$(INSTALLTOP)/bin/$$fn.new; \
740 mv -f $(DESTDIR)$(INSTALLTOP)/bin/$$fn.new \
741 $(DESTDIR)$(INSTALLTOP)/bin/$$fn; \
742 : {- output_on() unless windowsdll(); "" -}{- output_off() if windowsdll(); "" -}; \
743 $(ECHO) "install $$s -> $(DESTDIR)$(libdir)/$$fn"; \
744 cp $$s $(DESTDIR)$(libdir)/$$fn.new; \
745 chmod 755 $(DESTDIR)$(libdir)/$$fn.new; \
746 mv -f $(DESTDIR)$(libdir)/$$fn.new \
747 $(DESTDIR)$(libdir)/$$fn; \
748 : {- output_on() if windowsdll(); "" -}; \
751 install_programs: install_runtime_libs build_programs
752 @[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
753 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(INSTALLTOP)/bin
754 @$(ECHO) "*** Installing runtime programs"
755 @set -e; for x in dummy $(INSTALL_PROGRAMS); do \
756 if [ "$$x" = "dummy" ]; then continue; fi; \
758 $(ECHO) "install $$x -> $(DESTDIR)$(INSTALLTOP)/bin/$$fn"; \
759 cp $$x $(DESTDIR)$(INSTALLTOP)/bin/$$fn.new; \
760 chmod 755 $(DESTDIR)$(INSTALLTOP)/bin/$$fn.new; \
761 mv -f $(DESTDIR)$(INSTALLTOP)/bin/$$fn.new \
762 $(DESTDIR)$(INSTALLTOP)/bin/$$fn; \
764 @set -e; for x in dummy $(BIN_SCRIPTS); do \
765 if [ "$$x" = "dummy" ]; then continue; fi; \
767 $(ECHO) "install $$x -> $(DESTDIR)$(INSTALLTOP)/bin/$$fn"; \
768 cp $$x $(DESTDIR)$(INSTALLTOP)/bin/$$fn.new; \
769 chmod 755 $(DESTDIR)$(INSTALLTOP)/bin/$$fn.new; \
770 mv -f $(DESTDIR)$(INSTALLTOP)/bin/$$fn.new \
771 $(DESTDIR)$(INSTALLTOP)/bin/$$fn; \
774 uninstall_runtime: uninstall_programs uninstall_runtime_libs
777 @$(ECHO) "*** Uninstalling runtime programs"
778 @set -e; for x in dummy $(INSTALL_PROGRAMS); \
780 if [ "$$x" = "dummy" ]; then continue; fi; \
782 $(ECHO) "$(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$fn"; \
783 $(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$fn; \
785 @set -e; for x in dummy $(BIN_SCRIPTS); \
787 if [ "$$x" = "dummy" ]; then continue; fi; \
789 $(ECHO) "$(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$fn"; \
790 $(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$fn; \
792 -$(RMDIR) $(DESTDIR)$(INSTALLTOP)/bin
794 uninstall_runtime_libs:
795 @$(ECHO) "*** Uninstalling runtime libraries"
796 @ : {- output_off() unless windowsdll(); "" -}
797 @set -e; for s in dummy $(INSTALL_SHLIBS); do \
798 if [ "$$s" = "dummy" ]; then continue; fi; \
800 $(ECHO) "$(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$fn"; \
801 $(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$fn; \
803 @ : {- output_on() unless windowsdll(); "" -}
806 install_man_docs: build_man_docs
807 @[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
808 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(MANDIR)/man1
809 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(MANDIR)/man3
810 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(MANDIR)/man5
811 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(MANDIR)/man7
812 @$(ECHO) "*** Installing manpages"
813 @set -e; for x in dummy $(MANDOCS1); do \
814 if [ "$$x" = "dummy" ]; then continue; fi; \
816 $(ECHO) "install $$x -> $(DESTDIR)$(MANDIR)/man1/$$fn"; \
817 cp $$x $(DESTDIR)$(MANDIR)/man1/$$fn$(MANSUFFIX); \
818 chmod 755 $(DESTDIR)$(MANDIR)/man1/$$fn$(MANSUFFIX); \
820 @set -e; for x in dummy $(MANDOCS3); do \
821 if [ "$$x" = "dummy" ]; then continue; fi; \
823 $(ECHO) "install $$x -> $(DESTDIR)$(MANDIR)/man3/$$fn"; \
824 cp $$x $(DESTDIR)$(MANDIR)/man3/$$fn$(MANSUFFIX); \
825 chmod 755 $(DESTDIR)$(MANDIR)/man3/$$fn$(MANSUFFIX); \
827 @set -e; for x in dummy $(MANDOCS5); do \
828 if [ "$$x" = "dummy" ]; then continue; fi; \
830 $(ECHO) "install $$x -> $(DESTDIR)$(MANDIR)/man5/$$fn"; \
831 cp $$x $(DESTDIR)$(MANDIR)/man5/$$fn$(MANSUFFIX); \
832 chmod 755 $(DESTDIR)$(MANDIR)/man5/$$fn$(MANSUFFIX); \
834 @set -e; for x in dummy $(MANDOCS7); do \
835 if [ "$$x" = "dummy" ]; then continue; fi; \
837 $(ECHO) "install $$x -> $(DESTDIR)$(MANDIR)/man7/$$fn"; \
838 cp $$x $(DESTDIR)$(MANDIR)/man7/$$fn$(MANSUFFIX); \
839 chmod 755 $(DESTDIR)$(MANDIR)/man7/$$fn$(MANSUFFIX); \
843 @$(ECHO) "*** Uninstalling manpages"
844 @set -e; for x in dummy $(MANDOCS1); do \
845 if [ "$$x" = "dummy" ]; then continue; fi; \
847 $(ECHO) "$(RM) $(DESTDIR)$(MANDIR)/man1/$$fn"; \
848 $(RM) $(DESTDIR)$(MANDIR)/man1/$$fn$(MANSUFFIX); \
850 @set -e; for x in dummy $(MANDOCS3); do \
851 if [ "$$x" = "dummy" ]; then continue; fi; \
853 $(ECHO) "$(RM) $(DESTDIR)$(MANDIR)/man3/$$fn"; \
854 $(RM) $(DESTDIR)$(MANDIR)/man3/$$fn$(MANSUFFIX); \
856 @set -e; for x in dummy $(MANDOCS5); do \
857 if [ "$$x" = "dummy" ]; then continue; fi; \
859 $(ECHO) "$(RM) $(DESTDIR)$(MANDIR)/man5/$$fn"; \
860 $(RM) $(DESTDIR)$(MANDIR)/man5/$$fn$(MANSUFFIX); \
862 @set -e; for x in dummy $(MANDOCS7); do \
863 if [ "$$x" = "dummy" ]; then continue; fi; \
865 $(ECHO) "$(RM) $(DESTDIR)$(MANDIR)/man7/$$fn"; \
866 $(RM) $(DESTDIR)$(MANDIR)/man7/$$fn$(MANSUFFIX); \
869 install_html_docs: build_html_docs
870 @[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
871 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(HTMLDIR)/man1
872 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(HTMLDIR)/man3
873 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(HTMLDIR)/man5
874 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(HTMLDIR)/man7
875 @$(ECHO) "*** Installing HTML manpages"
876 @set -e; for x in dummy $(HTMLDOCS1); do \
877 if [ "$$x" = "dummy" ]; then continue; fi; \
879 $(ECHO) "install $$x -> $(DESTDIR)$(HTMLDIR)/man1/$$fn"; \
880 cp $$x $(DESTDIR)$(HTMLDIR)/man1/$$fn; \
881 chmod 755 $(DESTDIR)$(HTMLDIR)/man1/$$fn; \
883 @set -e; for x in dummy $(HTMLDOCS3); do \
884 if [ "$$x" = "dummy" ]; then continue; fi; \
886 $(ECHO) "install $$x -> $(DESTDIR)$(HTMLDIR)/man3/$$fn"; \
887 cp $$x $(DESTDIR)$(HTMLDIR)/man3/$$fn; \
888 chmod 755 $(DESTDIR)$(HTMLDIR)/man3/$$fn; \
890 @set -e; for x in dummy $(HTMLDOCS5); do \
891 if [ "$$x" = "dummy" ]; then continue; fi; \
893 $(ECHO) "install $$x -> $(DESTDIR)$(HTMLDIR)/man5/$$fn"; \
894 cp $$x $(DESTDIR)$(HTMLDIR)/man5/$$fn; \
895 chmod 755 $(DESTDIR)$(HTMLDIR)/man5/$$fn; \
897 @set -e; for x in dummy $(HTMLDOCS7); do \
898 if [ "$$x" = "dummy" ]; then continue; fi; \
900 $(ECHO) "install $$x -> $(DESTDIR)$(HTMLDIR)/man7/$$fn"; \
901 cp $$x $(DESTDIR)$(HTMLDIR)/man7/$$fn; \
902 chmod 755 $(DESTDIR)$(HTMLDIR)/man7/$$fn; \
906 @$(ECHO) "*** Uninstalling HTML manpages"
907 @set -e; for x in dummy $(HTMLDOCS1); do \
908 if [ "$$x" = "dummy" ]; then continue; fi; \
910 $(ECHO) "$(RM) $(DESTDIR)$(HTMLDIR)/man1/$$fn"; \
911 $(RM) $(DESTDIR)$(HTMLDIR)/man1/$$fn; \
913 @set -e; for x in dummy $(HTMLDOCS3); do \
914 if [ "$$x" = "dummy" ]; then continue; fi; \
916 $(ECHO) "$(RM) $(DESTDIR)$(HTMLDIR)/man3/$$fn"; \
917 $(RM) $(DESTDIR)$(HTMLDIR)/man3/$$fn; \
919 @set -e; for x in dummy $(HTMLDOCS5); do \
920 if [ "$$x" = "dummy" ]; then continue; fi; \
922 $(ECHO) "$(RM) $(DESTDIR)$(HTMLDIR)/man5/$$fn"; \
923 $(RM) $(DESTDIR)$(HTMLDIR)/man5/$$fn; \
925 @set -e; for x in dummy $(HTMLDOCS7); do \
926 if [ "$$x" = "dummy" ]; then continue; fi; \
928 $(ECHO) "$(RM) $(DESTDIR)$(HTMLDIR)/man7/$$fn"; \
929 $(RM) $(DESTDIR)$(HTMLDIR)/man7/$$fn; \
932 # Developer targets (note: these are only available on Unix) #########
934 update: generate errors ordinals
936 generate: generate_apps generate_crypto_bn generate_crypto_objects \
937 generate_crypto_conf generate_crypto_asn1 generate_fuzz_oids
940 doc-nits: build_generated
941 (cd $(SRCDIR); $(PERL) util/find-doc-nits -n -e )
943 # Test coverage is a good idea for the future
944 #coverage: $(PROGRAMS) $(TESTPROGRAMS)
948 lint -DLINT $(INCLUDES) $(SRCS)
951 ( cd $(SRCDIR); $(PERL) VMS/VMSify-conf.pl \
952 < apps/openssl.cnf > apps/openssl-vms.cnf )
953 @ : {- output_off() if $disabled{apps}; "" -}
954 ( b=`pwd`; cd $(SRCDIR); \
955 $(PERL) -I$$b apps/progs.pl -H $(APPS_OPENSSL) > apps/progs.h )
956 ( b=`pwd`; cd $(SRCDIR); \
957 $(PERL) -I$$b apps/progs.pl -C $(APPS_OPENSSL) > apps/progs.c )
958 @ : {- output_on() if $disabled{apps}; "" -}
961 ( cd $(SRCDIR); $(PERL) crypto/bn/bn_prime.pl > crypto/bn/bn_prime.h )
963 generate_crypto_objects:
964 ( cd $(SRCDIR); $(PERL) crypto/objects/objects.pl -n \
965 crypto/objects/objects.txt \
966 crypto/objects/obj_mac.num \
967 > crypto/objects/obj_mac.new && \
968 mv crypto/objects/obj_mac.new crypto/objects/obj_mac.num )
969 ( cd $(SRCDIR); $(PERL) crypto/objects/objects.pl \
970 crypto/objects/objects.txt \
971 crypto/objects/obj_mac.num \
972 > include/openssl/obj_mac.h )
973 ( cd $(SRCDIR); $(PERL) crypto/objects/obj_dat.pl \
974 include/openssl/obj_mac.h \
975 > crypto/objects/obj_dat.h )
976 ( cd $(SRCDIR); $(PERL) crypto/objects/objxref.pl \
977 crypto/objects/obj_mac.num \
978 crypto/objects/obj_xref.txt \
979 > crypto/objects/obj_xref.h )
981 generate_crypto_conf:
982 ( cd $(SRCDIR); $(PERL) crypto/conf/keysets.pl \
983 > crypto/conf/conf_def.h )
985 generate_crypto_asn1:
986 ( cd $(SRCDIR); $(PERL) crypto/asn1/charmap.pl \
987 > crypto/asn1/charmap.h )
990 ( cd $(SRCDIR); $(PERL) fuzz/mkfuzzoids.pl \
991 crypto/objects/obj_dat.h \
994 # Set to -force to force a rebuild
997 ( b=`pwd`; set -e; cd $(SRCDIR); \
998 $(PERL) util/ck_errf.pl -strict -internal; \
999 $(PERL) -I$$b util/mkerr.pl $(ERROR_REBUILD) -internal )
1000 ( b=`pwd`; set -e; cd $(SRCDIR)/engines; \
1001 for E in *.ec ; do \
1002 $(PERL) ../util/ck_errf.pl -strict \
1003 -conf $$E `basename $$E .ec`.c; \
1004 $(PERL) -I$$b ../util/mkerr.pl $(ERROR_REBUILD) -static \
1005 -conf $$E `basename $$E .ec`.c ; \
1008 {- use File::Basename;
1011 qw( include/openssl/ssl.h
1012 include/openssl/ssl2.h
1013 include/openssl/ssl3.h
1014 include/openssl/sslerr.h
1015 include/openssl/tls1.h
1016 include/openssl/dtls1.h
1017 include/openssl/srtp.h );
1018 our @cryptoheaders =
1019 qw( include/internal/dso.h
1020 include/internal/o_dir.h
1021 include/internal/err.h
1022 include/internal/sslconf.h );
1023 our @cryptoskipheaders = ( @sslheaders,
1024 qw( include/openssl/conf_api.h
1025 include/openssl/ebcdic.h
1026 include/openssl/opensslconf.h
1027 include/openssl/symhacks.h ) );
1028 foreach my $f ( glob(catfile($config{sourcedir},
1029 'include','openssl','*.h')) ) {
1030 my $fn = "include/openssl/" . basename($f);
1031 push @cryptoheaders, $fn unless grep { $_ eq $fn } @cryptoskipheaders;
1035 CRYPTOHEADERS={- join(" \\\n" . ' ' x 14,
1036 fill_lines(" ", $COLUMNS - 14, sort @cryptoheaders)) -}
1037 SSLHEADERS={- join(" \\\n" . ' ' x 11,
1038 fill_lines(" ", $COLUMNS - 11, sort @sslheaders)) -}
1041 $(PERL) util/mknum.pl --version $(VERSION) --no-warnings \
1042 --ordinals util/libcrypto.num \
1043 --symhacks include/openssl/symhacks.h \
1046 $(PERL) util/mknum.pl --version $(VERSION) --no-warnings \
1047 --ordinals util/libssl.num \
1048 --symhacks include/openssl/symhacks.h \
1053 SRCTOP=../$(SRCDIR) \
1054 BLDTOP=../$(BLDDIR) \
1055 $(PERL) ../$(SRCDIR)/test/run_tests.pl test_ordinals )
1060 -etags `find . -name '*.[ch]' -o -name '*.pm'`
1062 # Release targets (note: only available on Unix) #####################
1065 (cd $(SRCDIR); ./util/mktar.sh --name='$(NAME)' --tarfile='$(TARFILE)')
1067 # Helper targets #####################################################
1069 link-utils: $(BLDDIR)/util/opensslwrap.sh
1071 $(BLDDIR)/util/opensslwrap.sh: configdata.pm
1072 @if [ "$(SRCDIR)" != "$(BLDDIR)" ]; then \
1073 mkdir -p "$(BLDDIR)/util"; \
1074 ln -sf "../$(SRCDIR)/util/opensslwrap.sh" "$(BLDDIR)/util"; \
1079 # Building targets ###################################################
1081 libcrypto.pc libssl.pc openssl.pc: configdata.pm $(LIBS) {- join(" ",map { platform->sharedlib_simple($_) // () } @{$unified_info{libraries}}) -}
1083 @ ( echo 'prefix=$(INSTALLTOP)'; \
1084 echo 'exec_prefix=$${prefix}'; \
1085 if [ -n "$(LIBDIR)" ]; then \
1086 echo 'libdir=$${exec_prefix}/$(LIBDIR)'; \
1088 echo 'libdir=$(libdir)'; \
1090 echo 'includedir=$${prefix}/include'; \
1091 echo 'enginesdir=$${libdir}/engines-{- $sover_dirname -}'; \
1093 echo 'Name: OpenSSL-libcrypto'; \
1094 echo 'Description: OpenSSL cryptography library'; \
1095 echo 'Version: '$(VERSION); \
1096 echo 'Libs: -L$${libdir} -lcrypto'; \
1097 echo 'Libs.private: $(LIB_EX_LIBS)'; \
1098 echo 'Cflags: -I$${includedir}' ) > libcrypto.pc
1101 @ ( echo 'prefix=$(INSTALLTOP)'; \
1102 echo 'exec_prefix=$${prefix}'; \
1103 if [ -n "$(LIBDIR)" ]; then \
1104 echo 'libdir=$${exec_prefix}/$(LIBDIR)'; \
1106 echo 'libdir=$(libdir)'; \
1108 echo 'includedir=$${prefix}/include'; \
1110 echo 'Name: OpenSSL-libssl'; \
1111 echo 'Description: Secure Sockets Layer and cryptography libraries'; \
1112 echo 'Version: '$(VERSION); \
1113 echo 'Requires.private: libcrypto'; \
1114 echo 'Libs: -L$${libdir} -lssl'; \
1115 echo 'Cflags: -I$${includedir}' ) > libssl.pc
1118 @ ( echo 'prefix=$(INSTALLTOP)'; \
1119 echo 'exec_prefix=$${prefix}'; \
1120 if [ -n "$(LIBDIR)" ]; then \
1121 echo 'libdir=$${exec_prefix}/$(LIBDIR)'; \
1123 echo 'libdir=$(libdir)'; \
1125 echo 'includedir=$${prefix}/include'; \
1127 echo 'Name: OpenSSL'; \
1128 echo 'Description: Secure Sockets Layer and cryptography libraries and tools'; \
1129 echo 'Version: '$(VERSION); \
1130 echo 'Requires: libssl libcrypto' ) > openssl.pc
1132 configdata.pm: $(SRCDIR)/Configure $(SRCDIR)/config \
1133 {- join(" \\\n" . ' ' x 15,
1134 fill_lines(" ", $COLUMNS - 15,
1135 @{$config{build_file_templates}},
1136 @{$config{build_infos}},
1137 @{$config{conf_files}})) -}
1138 @echo "Detected changed: $?"
1139 $(PERL) configdata.pm -r
1140 @echo "**************************************************"
1142 @echo "*** Please run the same make command again ***"
1144 @echo "**************************************************"
1148 $(PERL) configdata.pm -r
1152 use File::Spec::Functions qw/:DEFAULT abs2rel rel2abs/;
1154 # Helper function to figure out dependencies on libraries
1155 # It takes a list of library names and outputs a list of dependencies
1156 sub compute_lib_depends {
1157 # Depending on shared libraries:
1158 # On Windows POSIX layers, we depend on {libname}.dll.a
1159 # On Unix platforms, we depend on {shlibname}.so
1160 return map { platform->sharedlib_simple($_) // platform->staticlib($_) } @_;
1165 my $generator = join(" ", @{$args{generator}});
1166 my $generator_incs = join("", map { " -I".$_ } @{$args{generator_incs}});
1167 my $incs = join("", map { " -I".$_ } @{$args{incs}});
1168 my $defs = join("", map { " -D".$_ } @{$args{defs}});
1169 my $deps = join(" ", @{$args{generator_deps}}, @{$args{deps}});
1171 if ($args{src} =~ /\.html$/) {
1172 my $title = basename($args{src}, ".html");
1174 $args{src}: $args{generator}->[0]
1175 pod2html "--podroot=\$(SRCDIR)/doc" --htmldir=.. \\
1176 --podpath=man1:man3:man5:man7 "--infile=\$<" "--title=$title" \\
1177 | \$(PERL) -pe 's|href="http://man\\.he\\.net/(man\\d/[^"]+)(?:\\.html)?"|href="../\$1.html|g;' \\
1180 } elsif ($args{src} =~ /\.(\d)$/) {
1182 my $name = uc basename($args{src}, ".$section");
1184 $args{src}: $args{generator}->[0]
1185 pod2man --name=$name --section=$section --center=OpenSSL \\
1186 --release=\$(VERSION) \$< \\
1189 } elsif (platform->isdef($args{src})) {
1190 my $target = platform->def($args{src});
1191 (my $mkdef_os = $target{shared_target}) =~ s|-shared$||;
1192 my $ord_ver = $args{intent} eq 'lib' ? ' --version $(VERSION)' : '';
1193 my $ord_name = $args{generator}->[1] || $args{product};
1195 $target: $args{generator}->[0] $deps \$(SRCDIR)/util/mkdef.pl
1196 \$(PERL) \$(SRCDIR)/util/mkdef.pl$ord_ver --ordinals $args{generator}->[0] --name $ord_name --OS $mkdef_os > $target
1198 } elsif (!platform->isasm($args{src})) {
1199 if ($args{generator}->[0] =~ m|^.*\.in$|) {
1200 my $dofile = abs2rel(rel2abs(catfile($config{sourcedir},
1201 "util", "dofile.pl")),
1202 rel2abs($config{builddir}));
1203 my @modules = ( 'configdata.pm',
1204 grep { $_ =~ m|\.pm$| } @{$args{deps}} );
1205 my %moduleincs = map { '"-I'.dirname($_).'"' => 1 } @modules;
1206 @modules = map { "-M".basename($_, '.pm') } @modules;
1207 my $modules = join(' ', '', sort keys %moduleincs, @modules);
1209 $args{src}: $args{generator}->[0] $deps \$(BLDDIR)/configdata.pm
1210 \$(PERL)$modules "$dofile" "-o$target{build_file}" $generator > \$@
1214 $args{src}: $args{generator}->[0] $deps
1215 \$(PERL)$generator_incs $generator > \$@
1220 shlib => '$(LIB_CFLAGS) $(LIB_CPPFLAGS)',
1221 lib => '$(LIB_CFLAGS) $(LIB_CPPFLAGS)',
1222 dso => '$(DSO_CFLAGS) $(DSO_CPPFLAGS)',
1223 bin => '$(BIN_CFLAGS) $(BIN_CPPFLAGS)'
1224 } -> {$args{intent}};
1226 if ($args{generator}->[0] =~ /\.pl$/) {
1227 $generator = 'CC="$(CC)" $(PERL)'.$generator_incs.' '.$generator
1228 .' "$(PERLASM_SCHEME)"'.$incs.' '.$cppflags.$defs.' $(PROCESSSOR)';
1229 } elsif ($args{generator}->[0] =~ /\.m4$/) {
1230 $generator = 'm4 -B 8192'.$generator_incs.' '.$generator.' >'
1231 } elsif ($args{generator}->[0] =~ /\.S$/) {
1234 die "Generator type for $args{src} unknown: $generator\n";
1237 if (defined($generator)) {
1239 $args{src}: $args{generator}->[0] $deps
1244 $args{src}: $args{generator}->[0] $deps
1245 \$(CC) $incs $cppflags $defs -E $args{generator}->[0] | \\
1246 \$(PERL) -ne '/^#(line)?\\s*[0-9]+/ or print' > \$@
1251 # Should one wonder about the end of the Perl snippet, it's because this
1252 # second regexp eats up line endings as well, if the removed path is the
1253 # last in the line. We may therefore need to put back a line ending.
1256 my $obj = platform->convertext($args{obj});
1257 my $dep = platform->dep($args{obj});
1258 my @srcs = @{$args{srcs}};
1259 my $srcs = join(" ", @srcs);
1260 my $deps = join(" ", @srcs, @{$args{deps}});
1261 my $incs = join("", map { " -I".$_ } @{$args{incs}});
1262 my $defs = join("", map { " -D".$_ } @{$args{defs}});
1266 if (grep /\.rc$/, @srcs) {
1268 $cmdflags = '$(RCFLAGS)';
1270 } elsif (grep /\.(cc|cpp)$/, @srcs) {
1272 $cmdcompile = ' -c';
1274 shlib => '$(LIB_CXXFLAGS) $(LIB_CPPFLAGS)',
1275 lib => '$(LIB_CXXFLAGS) $(LIB_CPPFLAGS)',
1276 dso => '$(DSO_CXXFLAGS) $(DSO_CPPFLAGS)',
1277 bin => '$(BIN_CXXFLAGS) $(BIN_CPPFLAGS)'
1278 } -> {$args{intent}};
1281 $cmdcompile = ' -c';
1283 shlib => '$(LIB_CFLAGS) $(LIB_CPPFLAGS)',
1284 lib => '$(LIB_CFLAGS) $(LIB_CPPFLAGS)',
1285 dso => '$(DSO_CFLAGS) $(DSO_CPPFLAGS)',
1286 bin => '$(BIN_CFLAGS) $(BIN_CPPFLAGS)'
1287 } -> {$args{intent}};
1290 # extension-specific rules
1291 if (grep /\.s$/, @srcs) {
1294 $cmd $cmdflags -c -o \$\@ $srcs
1296 } elsif (grep /\.S$/, @srcs) {
1297 # Originally there was mutli-step rule with $(CC) -E file.S
1298 # followed by $(CC) -c file.s. It compensated for one of
1299 # legacy platform compiler's inability to handle .S files.
1300 # The platform is long discontinued by vendor so there is
1301 # hardly a point to drag it along...
1304 $cmd $incs $defs $cmdflags -c -o \$\@ $srcs
1306 } elsif (defined $makedepprog && $makedepprog !~ /\/makedepend/
1307 && !grep /\.rc$/, @srcs) {
1310 $cmd $incs $defs $cmdflags -MMD -MF $dep.tmp -MT \$\@ -c -o \$\@ $srcs
1312 \@if cmp $dep.tmp $dep > /dev/null 2> /dev/null; then \\
1315 mv $dep.tmp $dep; \\
1321 $cmd $incs $defs $cmdflags $cmdcompile -o \$\@ $srcs
1323 if (defined $makedepprog && $makedepprog =~ /\/makedepend/) {
1325 \$(MAKEDEPEND) -f- -Y -- $incs $cmdflags -- $srcs 2>/dev/null \\
1332 # We *know* this routine is only called when we've configure 'shared'.
1337 foreach (@{$args{deps}}) {
1338 if (platform->isstaticlib($_)) {
1339 push @linklibs, platform->convertext($_);
1341 my $d = "-L" . dirname($_);
1342 my $l = basename($_);
1346 push @linkdirs, $d unless grep { $d eq $_ } @linkdirs;
1349 my $linkflags = join("", map { $_." " } @linkdirs);
1350 my $linklibs = join("", map { $_." " } @linklibs);
1351 my @objs = map { platform->convertext($_) }
1352 grep { !platform->isdef($_) }
1354 my @defs = map { platform->def($_) }
1355 grep { platform->isdef($_) }
1357 my @deps = compute_lib_depends(@{$args{deps}});
1358 die "More than one exported symbol map" if scalar @defs > 1;
1360 my $simple = platform->sharedlib_simple($args{lib});
1361 my $full = platform->sharedlib($args{lib});
1362 my $shared_soname = "";
1363 $shared_soname .= ' '.$target{shared_sonameflag}.basename($full)
1364 if defined $target{shared_sonameflag};
1365 my $shared_imp = "";
1366 $shared_imp .= ' '.$target{shared_impflag}.basename($simple)
1367 if defined $target{shared_impflag};
1368 my $shared_def = join("", map { ' '.$target{shared_defflag}.$_ } @defs);
1370 my $objs = join(" \\\n\t\t", fill_lines(' ', $COLUMNS - 16, @objs));
1371 my $deps = join(" \\\n" . ' ' x (length($full) + 2),
1372 fill_lines(' ', $COLUMNS - length($full) - 2,
1373 @objs, @defs, @deps));
1375 my $recipe = <<"EOF";
1381 \$(AR) r $simple $full
1383 } elsif ($simple ne $full) {
1391 \$(CC) \$(LIB_CFLAGS) $linkflags\$(LIB_LDFLAGS)$shared_soname$shared_imp \\
1392 -o $full$shared_def \\
1394 $linklibs \$(LIB_EX_LIBS)
1410 my $dso = platform->dso($args{module});
1413 foreach (@{$args{deps}}) {
1414 next unless defined $_;
1415 if (platform->isstaticlib($_)) {
1416 push @linklibs, platform->convertext($_);
1418 my $d = "-L" . dirname($_);
1419 my $l = basename($_);
1423 push @linkdirs, $d unless grep { $d eq $_ } @linkdirs;
1426 my $linkflags = join("", map { $_." " } @linkdirs);
1427 my $linklibs = join("", map { $_." " } @linklibs);
1428 my @objs = map { platform->convertext($_) }
1429 grep { !platform->isdef($_) }
1431 my @defs = map { platform->def($_) }
1432 grep { platform->isdef($_) }
1434 my @deps = compute_lib_depends(@{$args{deps}});
1435 my $shared_def = join("", map { ' '.$target{shared_defflag}.$_ } @defs);
1437 my $objs = join(" \\\n\t\t", fill_lines(' ', $COLUMNS - 16, @objs));
1438 my $deps = join(" \\\n" . ' ' x (length($dso) + 2),
1439 fill_lines(' ', $COLUMNS - length($dso) - 2,
1440 @objs, @defs, @deps));
1444 \$(CC) \$(DSO_CFLAGS) $linkflags\$(DSO_LDFLAGS) \\
1445 -o $dso$shared_def \\
1447 $linklibs\$(DSO_EX_LIBS)
1452 my $lib = platform->staticlib($args{lib});
1453 my @objs = map { platform->obj($_) } @{$args{objs}};
1454 my $objs = join(" \\\n" . ' ' x (length($lib) + 2),
1455 fill_lines(' ', $COLUMNS - length($lib) - 2, @objs));
1458 \$(AR) \$(ARFLAGS) \$\@ \$\?
1459 \$(RANLIB) \$\@ || echo Never mind.
1464 my $bin = platform->bin($args{bin});
1465 my @objs = map { platform->obj($_) } @{$args{objs}};
1466 my @deps = compute_lib_depends(@{$args{deps}});
1467 my $objs = join(" \\\n" . ' ' x (length($bin) + 2),
1468 fill_lines(' ', $COLUMNS - length($bin) - 2, @objs));
1471 foreach (@{$args{deps}}) {
1472 next unless defined $_;
1473 if (platform->isstaticlib($_)) {
1474 push @linklibs, platform->convertext($_);
1476 my $d = "-L" . dirname($_);
1477 my $l = basename($_);
1481 push @linkdirs, $d unless grep { $d eq $_ } @linkdirs;
1484 my $linkflags = join("", map { $_." " } @linkdirs);
1485 my $linklibs = join("", map { $_." " } @linklibs);
1487 my $cmdflags = '$(BIN_CFLAGS)';
1488 if (grep /_cc\.o$/, @{$args{objs}}) {
1490 $cmdflags = '$(BIN_CXXFLAGS)';
1493 my $objs = join(" \\\n\t\t", fill_lines(' ', $COLUMNS - 16, @objs));
1494 my $deps = join(" \\\n" . ' ' x (length($bin) + 2),
1495 fill_lines(' ', $COLUMNS - length($bin) - 2,
1501 \$\${LDCMD:-$cmd} $cmdflags $linkflags\$(BIN_LDFLAGS) \\
1504 $linklibs\$(BIN_EX_LIBS)
1509 my $script = $args{script};
1510 my $sources = join(" ", @{$args{sources}});
1511 my $dofile = abs2rel(rel2abs(catfile($config{sourcedir},
1512 "util", "dofile.pl")),
1513 rel2abs($config{builddir}));
1516 \$(PERL) "-I\$(BLDDIR)" -Mconfigdata "$dofile" \\
1517 "-o$target{build_file}" $sources > "$script"
1523 my $dir = $args{dir};
1524 my @deps = map { platform->convertext($_) } @{$args{deps}};
1526 my %extinfo = ( dso => platform->dsoext(),
1527 lib => platform->libext(),
1528 bin => platform->binext() );
1530 # We already have a 'test' target, and the top directory is just plain
1532 return if $dir eq "test" || $dir eq ".";
1534 foreach my $type (("dso", "lib", "bin", "script")) {
1535 next unless defined($unified_info{dirinfo}->{$dir}->{products}->{$type});
1536 # For lib object files, we could update the library. However, it
1537 # was decided that it's enough to build the directory local object
1538 # files, so we don't need to add any actions, and the dependencies
1539 # are already taken care of.
1540 if ($type ne "lib") {
1541 foreach my $prod (@{$unified_info{dirinfo}->{$dir}->{products}->{$type}}) {
1542 if (dirname($prod) eq $dir) {
1543 push @deps, $prod.$extinfo{$type};
1545 push @comments, "# No support to produce $type ".join(", ", @{$unified_info{dirinfo}->{$dir}->{products}->{$type}});
1551 my $target = "$dir $dir/";
1552 my $deps = join(" \\\n\t",
1553 fill_lines(' ', $COLUMNS - 8, @deps));
1554 my $comments = join("\n", "", @comments);
1560 "" # Important! This becomes part of the template result.