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} -}
64 FIPSKEY={- $config{FIPSKEY} -}
66 VERSION={- "$config{full_version}" -}
67 MAJOR={- $config{major} -}
68 MINOR={- $config{minor} -}
69 SHLIB_VERSION_NUMBER={- $config{shlib_version} -}
70 SHLIB_TARGET={- $target{shared_target} -}
72 LIBS={- join(" \\\n" . ' ' x 5,
73 fill_lines(" ", $COLUMNS - 5,
74 map { platform->staticlib($_) // () }
75 @{$unified_info{libraries}})) -}
76 SHLIBS={- join(" \\\n" . ' ' x 7,
77 fill_lines(" ", $COLUMNS - 7,
78 map { platform->sharedlib($_) // () }
79 @{$unified_info{libraries}})) -}
80 SHLIB_INFO={- join(" \\\n" . ' ' x 11,
81 fill_lines(" ", $COLUMNS - 11,
82 map { my $x = platform->sharedlib($_);
83 my $y = platform->sharedlib_simple($_);
84 $x ? "\"$x;$y\"" : () }
85 @{$unified_info{libraries}})) -}
86 MODULES={- join(" \\\n" . ' ' x 8,
87 fill_lines(" ", $COLUMNS - 8,
88 map { platform->dso($_) }
89 @{$unified_info{modules}})) -}
90 PROGRAMS={- join(" \\\n" . ' ' x 9,
91 fill_lines(" ", $COLUMNS - 9,
92 map { platform->bin($_) }
93 @{$unified_info{programs}})) -}
94 SCRIPTS={- join(" \\\n" . ' ' x 8,
95 fill_lines(" ", $COLUMNS - 8, @{$unified_info{scripts}})) -}
96 {- output_off() if $disabled{makedepend}; "" -}
97 DEPS={- join(" \\\n" . ' ' x 5,
98 fill_lines(" ", $COLUMNS - 5,
99 map { platform->isobj($_) ? platform->dep($_) : () }
100 grep { $unified_info{sources}->{$_}->[0] =~ /\.c$/ }
101 keys %{$unified_info{sources}})); -}
102 {- output_on() if $disabled{makedepend}; "" -}
103 GENERATED_MANDATORY={- join(" \\\n" . ' ' x 20,
104 fill_lines(" ", $COLUMNS - 20,
105 @{$unified_info{depends}->{""}})) -}
106 GENERATED={- # common0.tmpl provides @generated
107 join(" \\\n" . ' ' x 5,
108 fill_lines(" ", $COLUMNS - 5,
109 map { platform->convertext($_) } @generated )) -}
112 join(" \\\n" . ' ' x 13,
113 fill_lines(" ", $COLUMNS - 13,
114 map { platform->staticlib($_) // () }
115 grep { !$unified_info{attributes}->{libraries}->{$_}->{noinst} }
116 @{$unified_info{libraries}}))
119 join(" \\\n" . ' ' x 15,
120 fill_lines(" ", $COLUMNS - 15,
121 map { platform->sharedlib($_) // () }
122 grep { !$unified_info{attributes}->{libraries}->{$_}->{noinst} }
123 @{$unified_info{libraries}}))
125 INSTALL_SHLIB_INFO={-
126 join(" \\\n" . ' ' x 19,
127 fill_lines(" ", $COLUMNS - 19,
128 map { my $x = platform->sharedlib($_);
129 my $y = platform->sharedlib_simple($_);
130 $x ? "\"$x;$y\"" : () }
131 grep { !$unified_info{attributes}->{libraries}->{$_}->{noinst} }
132 @{$unified_info{libraries}}))
135 join(" \\\n" . ' ' x 16,
136 fill_lines(" ", $COLUMNS - 16,
137 map { platform->dso($_) }
138 grep { !$unified_info{attributes}->{modules}->{$_}->{noinst}
139 && $unified_info{attributes}->{modules}->{$_}->{engine} }
140 @{$unified_info{modules}}))
143 join(" \\\n" . ' ' x 16,
144 fill_lines(" ", $COLUMNS - 16,
145 map { platform->dso($_) }
146 grep { !$unified_info{attributes}->{modules}->{$_}->{noinst}
147 && !$unified_info{attributes}->{modules}->{$_}->{engine} }
148 @{$unified_info{modules}}))
151 join(" \\\n" . ' ' x 16,
152 fill_lines(" ", $COLUMNS - 16, map { platform->bin($_) }
153 grep { !$unified_info{attributes}->{programs}->{$_}->{noinst} }
154 @{$unified_info{programs}}))
157 join(" \\\n" . ' ' x 12,
158 fill_lines(" ", $COLUMNS - 12,
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 13,
167 fill_lines(" ", $COLUMNS - 13,
168 map { my $x = $unified_info{attributes}->{scripts}->{$_}->{linkname};
170 grep { !$unified_info{attributes}->{scripts}->{$_}->{noinst}
171 && $unified_info{attributes}->{scripts}->{$_}->{misc} }
172 @{$unified_info{scripts}}))
175 join(" \\\n" . ' ' x 10,
176 fill_lines(" ", $COLUMNS - 10,
177 @{$unified_info{htmldocs}->{man1}})) -}
179 join(" \\\n" . ' ' x 10,
180 fill_lines(" ", $COLUMNS - 10,
181 @{$unified_info{htmldocs}->{man3}})) -}
183 join(" \\\n" . ' ' x 10,
184 fill_lines(" ", $COLUMNS - 10,
185 @{$unified_info{htmldocs}->{man5}})) -}
187 join(" \\\n" . ' ' x 10,
188 fill_lines(" ", $COLUMNS - 10,
189 @{$unified_info{htmldocs}->{man7}})) -}
191 join(" \\\n" . ' ' x 9,
192 fill_lines(" ", $COLUMNS - 9,
193 @{$unified_info{mandocs}->{man1}})) -}
195 join(" \\\n" . ' ' x 9,
196 fill_lines(" ", $COLUMNS - 9,
197 @{$unified_info{mandocs}->{man3}})) -}
199 join(" \\\n" . ' ' x 9,
200 fill_lines(" ", $COLUMNS - 9,
201 @{$unified_info{mandocs}->{man5}})) -}
203 join(" \\\n" . ' ' x 9,
204 fill_lines(" ", $COLUMNS - 9,
205 @{$unified_info{mandocs}->{man7}})) -}
207 APPS_OPENSSL="{- use File::Spec::Functions;
208 catfile("apps","openssl") -}"
210 # DESTDIR is for package builders so that they can configure for, say,
211 # /usr/ and yet have everything installed to /tmp/somedir/usr/.
212 # Normally it is left empty.
215 # Do not edit these manually. Use Configure with --prefix or --openssldir
216 # to change this! Short explanation in the top comment in Configure
217 INSTALLTOP={- # $prefix is used in the OPENSSLDIR perl snippet
219 our $prefix = $config{prefix} || "/usr/local";
222 # The logic here is that if no --openssldir was given,
223 # OPENSSLDIR will get the value from $prefix plus "/ssl".
224 # If --openssldir was given and the value is an absolute
225 # path, OPENSSLDIR will get its value without change.
226 # If the value from --openssldir is a relative path,
227 # OPENSSLDIR will get $prefix with the --openssldir
228 # value appended as a subdirectory.
230 use File::Spec::Functions;
232 $config{openssldir} ?
233 (file_name_is_absolute($config{openssldir}) ?
235 : catdir($prefix, $config{openssldir}))
236 : catdir($prefix, "ssl");
238 LIBDIR={- our $libdir = $config{libdir};
241 # if $prefix/lib$target{multilib} is not an existing
242 # directory, then assume that it's not searched by linker
243 # automatically, in which case adding $target{multilib} suffix
244 # causes more grief than we're ready to tolerate, so don't...
246 -d "$prefix/lib$target{multilib}" ? $target{multilib} : "";
247 $libdir = "lib$multilib";
249 file_name_is_absolute($libdir) ? "" : $libdir -}
250 # $(libdir) is chosen to be compatible with the GNU coding standards
251 libdir={- file_name_is_absolute($libdir)
252 ? $libdir : '$(INSTALLTOP)/$(LIBDIR)' -}
253 ENGINESDIR=$(libdir)/engines-{- $sover_dirname -}
254 MODULESDIR=$(libdir)/ossl-modules
256 # Convenience variable for those who want to set the rpath in shared
257 # libraries and applications
260 MANDIR=$(INSTALLTOP)/share/man
261 DOCDIR=$(INSTALLTOP)/share/doc/$(BASENAME)
262 HTMLDIR=$(DOCDIR)/html
264 # MANSUFFIX is for the benefit of anyone who may want to have a suffix
265 # appended after the manpage file section number. "ssl" is popular,
266 # resulting in files such as config.5ssl rather than config.5.
270 # For "optional" echo messages, to get "real" silence
273 ##### User defined commands and flags ################################
275 # We let the C compiler driver to take care of .s files. This is done in
276 # order to be excused from maintaining a separate set of architecture
277 # dependent assembler flags. E.g. if you throw -mcpu=ultrasparc at SPARC
278 # gcc, then the driver will automatically translate it to -xarch=v8plus
279 # and pass it down to assembler. In any case, we do not define AS or
280 # ASFLAGS for this reason.
282 CROSS_COMPILE={- $config{CROSS_COMPILE} -}
283 CC=$(CROSS_COMPILE){- $config{CC} -}
284 CXX={- $config{CXX} ? "\$(CROSS_COMPILE)$config{CXX}" : '' -}
285 CPPFLAGS={- our $cppflags1 = join(" ",
286 (map { "-D".$_} @{$config{CPPDEFINES}}),
287 (map { "-I".$_} @{$config{CPPINCLUDES}}),
288 @{$config{CPPFLAGS}}) -}
289 CFLAGS={- join(' ', @{$config{CFLAGS}}) -}
290 CXXFLAGS={- join(' ', @{$config{CXXFLAGS}}) -}
291 LDFLAGS= {- join(' ', @{$config{LDFLAGS}}) -}
292 EX_LIBS= {- join(' ', @{$config{LDLIBS}}) -}
294 MAKEDEPEND={- $config{makedepprog} -}
296 PERL={- $config{PERL} -}
298 AR=$(CROSS_COMPILE){- $config{AR} -}
299 ARFLAGS= {- join(' ', @{$config{ARFLAGS}}) -}
300 RANLIB={- $config{RANLIB} ? "\$(CROSS_COMPILE)$config{RANLIB}" : "true"; -}
301 RC= $(CROSS_COMPILE){- $config{RC} -}
302 RCFLAGS={- join(' ', @{$config{RCFLAGS}}) -} {- $target{shared_rcflag} -}
306 TAR= {- $target{TAR} || "tar" -}
307 TARFLAGS= {- $target{TARFLAGS} -}
310 NAME= $(BASENAME)-$(VERSION)
311 # Relative to $(SRCDIR)
312 TARFILE= ../$(NAME).tar
314 ##### Project flags ##################################################
316 # Variables starting with CNF_ are common variables for all product types
318 CNF_CPPFLAGS={- our $cppflags2 =
319 join(' ', $target{cppflags} || (),
320 (map { "-D".$_} @{$target{defines}},
321 @{$config{defines}}),
322 (map { "-I".$_} @{$target{includes}},
323 @{$config{includes}}),
324 @{$config{cppflags}}) -}
325 CNF_CFLAGS={- join(' ', $target{cflags} || (),
326 @{$config{cflags}}) -}
327 CNF_CXXFLAGS={- join(' ', $target{cxxflags} || (),
328 @{$config{cxxflags}}) -}
329 CNF_LDFLAGS={- join(' ', $target{lflags} || (),
330 @{$config{lflags}}) -}
331 CNF_EX_LIBS={- join(' ', $target{ex_libs} || (),
332 @{$config{ex_libs}}) -}
334 # Variables starting with LIB_ are used to build library object files
335 # and shared libraries.
336 # Variables starting with DSO_ are used to build DSOs and their object files.
337 # Variables starting with BIN_ are used to build programs and their object
340 LIB_CPPFLAGS={- our $lib_cppflags =
341 join(' ', $target{lib_cppflags} || (),
342 $target{shared_cppflag} || (),
344 @{$target{lib_defines} || ()},
345 @{$target{shared_defines} || ()},
346 @{$config{lib_defines} || ()},
347 @{$config{shared_defines} || ()}),
348 (map { '-I'.quotify1($_) }
349 @{$target{lib_includes}},
350 @{$target{shared_includes}},
351 @{$config{lib_includes}},
352 @{$config{shared_includes}}),
353 @{$config{lib_cppflags}},
354 @{$config{shared_cppflag}});
355 join(' ', $lib_cppflags,
357 'OPENSSLDIR="\"$(OPENSSLDIR)\""',
358 'ENGINESDIR="\"$(ENGINESDIR)\""',
359 'MODULESDIR="\"$(MODULESDIR)\""'),
360 '$(CNF_CPPFLAGS)', '$(CPPFLAGS)') -}
361 LIB_CFLAGS={- join(' ', $target{lib_cflags} || (),
362 $target{shared_cflag} || (),
363 @{$config{lib_cflags}},
364 @{$config{shared_cflag}},
365 '$(CNF_CFLAGS)', '$(CFLAGS)') -}
366 LIB_CXXFLAGS={- join(' ', $target{lib_cxxflags} || (),
367 $target{shared_cxxflag} || (),
368 @{$config{lib_cxxflags}},
369 @{$config{shared_cxxflag}},
370 '$(CNF_CXXFLAGS)', '$(CXXFLAGS)') -}
371 LIB_LDFLAGS={- join(' ', $target{shared_ldflag} || (),
372 $config{shared_ldflag} || (),
373 '$(CNF_LDFLAGS)', '$(LDFLAGS)') -}
374 LIB_EX_LIBS=$(CNF_EX_LIBS) $(EX_LIBS)
375 DSO_CPPFLAGS={- join(' ', $target{dso_cppflags} || (),
376 $target{module_cppflags} || (),
378 @{$target{dso_defines}},
379 @{$target{module_defines}},
380 @{$config{dso_defines} || ()},
381 @{$config{module_defines} || ()}),
382 (map { '-I'.quotify1($_) }
383 @{$target{dso_includes}},
384 @{$target{module_includes}},
385 @{$config{dso_includes}},
386 @{$config{module_includes}}),
387 @{$config{dso_cppflags}},
388 @{$config{module_cppflags}},
389 '$(CNF_CPPFLAGS)', '$(CPPFLAGS)') -}
390 DSO_CFLAGS={- join(' ', $target{dso_cflags} || (),
391 $target{module_cflags} || (),
392 @{$config{dso_cflags}},
393 @{$config{module_cflags}},
394 '$(CNF_CFLAGS)', '$(CFLAGS)') -}
395 DSO_CXXFLAGS={- join(' ', $target{dso_cxxflags} || (),
396 $target{module_cxxflags} || (),
397 @{$config{dso_cxxflags}},
398 @{$config{module_cxxflag}},
399 '$(CNF_CXXFLAGS)', '$(CXXFLAGS)') -}
400 DSO_LDFLAGS={- join(' ', $target{dso_ldflags} || (),
401 $target{module_ldflags} || (),
402 @{$config{dso_ldflags}},
403 @{$config{module_ldflags}},
404 '$(CNF_LDFLAGS)', '$(LDFLAGS)') -}
405 DSO_EX_LIBS=$(CNF_EX_LIBS) $(EX_LIBS)
406 BIN_CPPFLAGS={- join(' ', $target{bin_cppflags} || (),
407 (map { '-D'.$_ } @{$config{bin_defines} || ()}),
408 @{$config{bin_cppflags}},
409 '$(CNF_CPPFLAGS)', '$(CPPFLAGS)') -}
410 BIN_CFLAGS={- join(' ', $target{bin_cflags} || (),
411 @{$config{bin_cflags}},
412 '$(CNF_CFLAGS)', '$(CFLAGS)') -}
413 BIN_CXXFLAGS={- join(' ', $target{bin_cxxflags} || (),
414 @{$config{bin_cxxflags}},
415 '$(CNF_CXXFLAGS)', '$(CXXFLAGS)') -}
416 BIN_LDFLAGS={- join(' ', $target{bin_lflags} || (),
417 @{$config{bin_lflags}},
418 '$(CNF_LDFLAGS)', '$(LDFLAGS)') -}
419 BIN_EX_LIBS=$(CNF_EX_LIBS) $(EX_LIBS)
421 # CPPFLAGS_Q is used for one thing only: to build up buildinf.h
422 CPPFLAGS_Q={- $cppflags1 =~ s|([\\"])|\\$1|g;
423 $cppflags2 =~ s|([\\"])|\\$1|g;
424 $lib_cppflags =~ s|([\\"])|\\$1|g;
425 join(' ', $lib_cppflags || (), $cppflags2 || (),
428 PERLASM_SCHEME= {- $target{perlasm_scheme} -}
430 # For x86 assembler: Set PROCESSOR to 386 if you want to support
432 PROCESSOR= {- $config{processor} -}
434 # We want error [and other] messages in English. Trouble is that make(1)
435 # doesn't pass macros down as environment variables unless there already
436 # was corresponding variable originally set. In other words we can only
437 # reassign environment variables, but not set new ones, not in portable
438 # manner that is. That's why we reassign several, just to be sure...
443 # The main targets ###################################################
445 {- dependmagic('build_sw'); -}: build_libs_nodep build_modules_nodep build_programs_nodep link-utils
446 {- dependmagic('build_libs'); -}: build_libs_nodep
447 {- dependmagic('build_modules'); -}: build_modules_nodep
448 {- dependmagic('build_programs'); -}: build_programs_nodep
450 build_docs: build_man_docs build_html_docs
451 build_man_docs: $(MANDOCS1) $(MANDOCS3) $(MANDOCS5) $(MANDOCS7)
452 build_html_docs: $(HTMLDOCS1) $(HTMLDOCS3) $(HTMLDOCS5) $(HTMLDOCS7)
454 build_generated: $(GENERATED_MANDATORY)
455 build_libs_nodep: libcrypto.pc libssl.pc openssl.pc
456 build_modules_nodep: $(MODULES)
457 build_programs_nodep: $(PROGRAMS) $(SCRIPTS)
459 # Kept around for backward compatibility
460 build_apps build_tests: build_programs
462 # Convenience target to prebuild all generated files, not just the mandatory
464 build_all_generated: $(GENERATED_MANDATORY) $(GENERATED) build_docs
465 @ : {- output_off() if $disabled{makedepend}; "" -}
466 @echo "Warning: consider configuring with no-makedepend, because if"
467 @echo " target system doesn't have $(PERL),"
468 @echo " then make will fail..."
469 @ : {- output_on() if $disabled{makedepend}; "" -}
471 all: build_sw build_docs
474 {- dependmagic('tests'); -}: build_programs_nodep build_modules_nodep link-utils
475 @ : {- output_off() if $disabled{tests}; "" -}
479 FIPSKEY="$(FIPSKEY)" \
480 EXE_EXT={- platform->binext() -} \
481 $(PERL) $(SRCDIR)/test/run_tests.pl $(TESTS) )
482 @ : {- if ($disabled{tests}) { output_on(); } else { output_off(); } "" -}
483 @echo "Tests are not supported with your chosen Configure options"
484 @ : {- output_on() if !$disabled{tests}; "" -}
487 @ : {- output_off() if $disabled{tests}; "" -}
488 @SRCTOP="$(SRCDIR)" \
489 $(PERL) $(SRCDIR)/test/run_tests.pl list
490 @ : {- if ($disabled{tests}) { output_on(); } else { output_off(); } "" -}
491 @echo "Tests are not supported with your chosen Configure options"
492 @ : {- output_on() if !$disabled{tests}; "" -}
494 install: install_sw install_ssldirs install_docs
496 uninstall: uninstall_docs uninstall_sw
499 @set -e; for s in $(SHLIB_INFO); do \
500 if [ "$$s" = ";" ]; then continue; fi; \
501 s1=`echo "$$s" | cut -f1 -d";"`; \
502 s2=`echo "$$s" | cut -f2 -d";"`; \
503 $(ECHO) $(RM) $$s1; {- output_off() unless windowsdll(); "" -}\
506 $(RM) fuzz/$$s1; {- output_on() unless windowsdll(); "" -}\
508 if [ "$$s1" != "$$s2" ]; then \
509 $(ECHO) $(RM) $$s2; \
514 $(RM) *{- platform->defext() -}
517 $(RM) $(HTMLDOCS1) $(HTMLDOCS3) $(HTMLDOCS5) $(HTMLDOCS7)
518 $(RM) $(MANDOCS1) $(MANDOCS3) $(MANDOCS5) $(MANDOCS7)
519 $(RM) $(PROGRAMS) $(TESTPROGS) $(MODULES) $(SCRIPTS)
520 $(RM) $(GENERATED_MANDATORY) $(GENERATED)
521 -$(RM) `find . -name '*{- platform->depext() -}' \! -name '.*' \! -type d -print`
522 -$(RM) `find . -name '*{- platform->objext() -}' \! -name '.*' \! -type d -print`
524 $(RM) tags TAGS doc-nits cmd-nits md-nits
525 $(RM) -r test/test-runs
526 $(RM) openssl.pc libcrypto.pc libssl.pc
527 -$(RM) `find . -type l \! -name '.*' -print`
534 # We check if any depfile is newer than Makefile and decide to
535 # concatenate only if that is true.
537 @: {- output_off() if $disabled{makedepend}; "" -}
538 @$(PERL) $(SRCDIR)/util/add-depends.pl {-
539 defined $makedepprog && $makedepprog =~ /\/makedepend/
540 ? 'makedepend' : 'gcc' -}
541 @: {- output_on() if $disabled{makedepend}; "" -}
543 # Install helper targets #############################################
545 install_sw: install_dev install_engines install_modules install_runtime
547 uninstall_sw: uninstall_runtime uninstall_modules uninstall_engines uninstall_dev
549 install_docs: install_man_docs install_html_docs
551 uninstall_docs: uninstall_man_docs uninstall_html_docs
552 $(RM) -r $(DESTDIR)$(DOCDIR)
555 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(OPENSSLDIR)/certs
556 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(OPENSSLDIR)/private
557 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(OPENSSLDIR)/misc
558 @set -e; for x in dummy $(MISC_SCRIPTS); do \
559 if [ "$$x" = "dummy" ]; then continue; fi; \
560 x1=`echo "$$x" | cut -f1 -d:`; \
561 x2=`echo "$$x" | cut -f2 -d:`; \
562 fn=`basename $$x1`; \
563 $(ECHO) "install $$x1 -> $(DESTDIR)$(OPENSSLDIR)/misc/$$fn"; \
564 cp $$x1 $(DESTDIR)$(OPENSSLDIR)/misc/$$fn.new; \
565 chmod 755 $(DESTDIR)$(OPENSSLDIR)/misc/$$fn.new; \
566 mv -f $(DESTDIR)$(OPENSSLDIR)/misc/$$fn.new \
567 $(DESTDIR)$(OPENSSLDIR)/misc/$$fn; \
568 if [ "$$x1" != "$$x2" ]; then \
569 ln=`basename "$$x2"`; \
570 : {- output_off() unless windowsdll(); "" -}; \
571 $(ECHO) "copy $(DESTDIR)$(OPENSSLDIR)/misc/$$ln -> $(DESTDIR)$(OPENSSLDIR)/misc/$$fn"; \
572 cp $(DESTDIR)$(OPENSSLDIR)/misc/$$fn $(DESTDIR)$(OPENSSLDIR)/misc/$$ln; \
573 : {- output_on() unless windowsdll();
574 output_off() if windowsdll(); "" -}; \
575 $(ECHO) "link $(DESTDIR)$(OPENSSLDIR)/misc/$$ln -> $(DESTDIR)$(OPENSSLDIR)/misc/$$fn"; \
576 ln -sf $$fn $(DESTDIR)$(OPENSSLDIR)/misc/$$ln; \
577 : {- output_on() if windowsdll(); "" -}; \
580 @$(ECHO) "install $(SRCDIR)/apps/openssl.cnf -> $(DESTDIR)$(OPENSSLDIR)/openssl.cnf.dist"
581 @cp $(SRCDIR)/apps/openssl.cnf $(DESTDIR)$(OPENSSLDIR)/openssl.cnf.new
582 @chmod 644 $(DESTDIR)$(OPENSSLDIR)/openssl.cnf.new
583 @mv -f $(DESTDIR)$(OPENSSLDIR)/openssl.cnf.new $(DESTDIR)$(OPENSSLDIR)/openssl.cnf.dist
584 @if [ ! -f "$(DESTDIR)$(OPENSSLDIR)/openssl.cnf" ]; then \
585 $(ECHO) "install $(SRCDIR)/apps/openssl.cnf -> $(DESTDIR)$(OPENSSLDIR)/openssl.cnf"; \
586 cp $(SRCDIR)/apps/openssl.cnf $(DESTDIR)$(OPENSSLDIR)/openssl.cnf; \
587 chmod 644 $(DESTDIR)$(OPENSSLDIR)/openssl.cnf; \
589 @$(ECHO) "install $(SRCDIR)/apps/ct_log_list.cnf -> $(DESTDIR)$(OPENSSLDIR)/ct_log_list.cnf.dist"
590 @cp $(SRCDIR)/apps/ct_log_list.cnf $(DESTDIR)$(OPENSSLDIR)/ct_log_list.cnf.new
591 @chmod 644 $(DESTDIR)$(OPENSSLDIR)/ct_log_list.cnf.new
592 @mv -f $(DESTDIR)$(OPENSSLDIR)/ct_log_list.cnf.new $(DESTDIR)$(OPENSSLDIR)/ct_log_list.cnf.dist
593 @if [ ! -f "$(DESTDIR)$(OPENSSLDIR)/ct_log_list.cnf" ]; then \
594 $(ECHO) "install $(SRCDIR)/apps/ct_log_list.cnf -> $(DESTDIR)$(OPENSSLDIR)/ct_log_list.cnf"; \
595 cp $(SRCDIR)/apps/ct_log_list.cnf $(DESTDIR)$(OPENSSLDIR)/ct_log_list.cnf; \
596 chmod 644 $(DESTDIR)$(OPENSSLDIR)/ct_log_list.cnf; \
599 install_dev: install_runtime_libs
600 @[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
601 @$(ECHO) "*** Installing development files"
602 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(INSTALLTOP)/include/openssl
603 @ : {- output_off() unless grep { $_ eq "OPENSSL_USE_APPLINK" } (@{$target{defines}}, @{$config{defines}}); "" -}
604 @$(ECHO) "install $(SRCDIR)/ms/applink.c -> $(DESTDIR)$(INSTALLTOP)/include/openssl/applink.c"
605 @cp $(SRCDIR)/ms/applink.c $(DESTDIR)$(INSTALLTOP)/include/openssl/applink.c
606 @chmod 644 $(DESTDIR)$(INSTALLTOP)/include/openssl/applink.c
607 @ : {- output_on() unless grep { $_ eq "OPENSSL_USE_APPLINK" } (@{$target{defines}}, @{$config{defines}}); "" -}
608 @set -e; for i in $(SRCDIR)/include/openssl/*.h \
609 $(BLDDIR)/include/openssl/*.h; do \
611 $(ECHO) "install $$i -> $(DESTDIR)$(INSTALLTOP)/include/openssl/$$fn"; \
612 cp $$i $(DESTDIR)$(INSTALLTOP)/include/openssl/$$fn; \
613 chmod 644 $(DESTDIR)$(INSTALLTOP)/include/openssl/$$fn; \
615 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(libdir)
616 @set -e; for l in $(INSTALL_LIBS); do \
618 $(ECHO) "install $$l -> $(DESTDIR)$(libdir)/$$fn"; \
619 cp $$l $(DESTDIR)$(libdir)/$$fn.new; \
620 $(RANLIB) $(DESTDIR)$(libdir)/$$fn.new; \
621 chmod 644 $(DESTDIR)$(libdir)/$$fn.new; \
622 mv -f $(DESTDIR)$(libdir)/$$fn.new \
623 $(DESTDIR)$(libdir)/$$fn; \
625 @ : {- output_off() if $disabled{shared}; "" -}
626 @set -e; for s in $(INSTALL_SHLIB_INFO); do \
627 s1=`echo "$$s" | cut -f1 -d";"`; \
628 s2=`echo "$$s" | cut -f2 -d";"`; \
629 fn1=`basename $$s1`; \
630 fn2=`basename $$s2`; \
631 : {- output_off(); output_on() unless windowsdll() or sharedaix(); "" -}; \
632 if [ "$$fn1" != "$$fn2" ]; then \
633 $(ECHO) "link $(DESTDIR)$(libdir)/$$fn2 -> $(DESTDIR)$(libdir)/$$fn1"; \
634 ln -sf $$fn1 $(DESTDIR)$(libdir)/$$fn2; \
636 : {- output_off() unless windowsdll() or sharedaix(); output_on() if windowsdll(); "" -}; \
637 $(ECHO) "install $$s2 -> $(DESTDIR)$(libdir)/$$fn2"; \
638 cp $$s2 $(DESTDIR)$(libdir)/$$fn2.new; \
639 chmod 755 $(DESTDIR)$(libdir)/$$fn2.new; \
640 mv -f $(DESTDIR)$(libdir)/$$fn2.new \
641 $(DESTDIR)$(libdir)/$$fn2; \
642 : {- output_off() if windowsdll(); output_on() if sharedaix(); "" -}; \
643 a=$(DESTDIR)$(libdir)/$$fn2; \
644 $(ECHO) "install $$s1 -> $$a"; \
645 if [ -f $$a ]; then ( trap "rm -rf /tmp/ar.$$$$" INT 0; \
646 mkdir /tmp/ar.$$$$; ( cd /tmp/ar.$$$$; \
648 for so in `$(AR) t $$a`; do \
651 strip -X32_64 -e $$so; \
652 $(AR) r $$a.new $$so; \
655 $(AR) r $$a.new $$s1; \
657 : {- output_off() if sharedaix(); output_on(); "" -}; \
659 @ : {- output_on() if $disabled{shared}; "" -}
660 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(libdir)/pkgconfig
661 @$(ECHO) "install libcrypto.pc -> $(DESTDIR)$(libdir)/pkgconfig/libcrypto.pc"
662 @cp libcrypto.pc $(DESTDIR)$(libdir)/pkgconfig
663 @chmod 644 $(DESTDIR)$(libdir)/pkgconfig/libcrypto.pc
664 @$(ECHO) "install libssl.pc -> $(DESTDIR)$(libdir)/pkgconfig/libssl.pc"
665 @cp libssl.pc $(DESTDIR)$(libdir)/pkgconfig
666 @chmod 644 $(DESTDIR)$(libdir)/pkgconfig/libssl.pc
667 @$(ECHO) "install openssl.pc -> $(DESTDIR)$(libdir)/pkgconfig/openssl.pc"
668 @cp openssl.pc $(DESTDIR)$(libdir)/pkgconfig
669 @chmod 644 $(DESTDIR)$(libdir)/pkgconfig/openssl.pc
671 uninstall_dev: uninstall_runtime_libs
672 @$(ECHO) "*** Uninstalling development files"
673 @ : {- output_off() unless grep { $_ eq "OPENSSL_USE_APPLINK" } (@{$target{defines}}, @{$config{defines}}); "" -}
674 @$(ECHO) "$(RM) $(DESTDIR)$(INSTALLTOP)/include/openssl/applink.c"
675 @$(RM) $(DESTDIR)$(INSTALLTOP)/include/openssl/applink.c
676 @ : {- output_on() unless grep { $_ eq "OPENSSL_USE_APPLINK" } (@{$target{defines}}, @{$config{defines}}); "" -}
677 @set -e; for i in $(SRCDIR)/include/openssl/*.h \
678 $(BLDDIR)/include/openssl/*.h; do \
680 $(ECHO) "$(RM) $(DESTDIR)$(INSTALLTOP)/include/openssl/$$fn"; \
681 $(RM) $(DESTDIR)$(INSTALLTOP)/include/openssl/$$fn; \
683 -$(RMDIR) $(DESTDIR)$(INSTALLTOP)/include/openssl
684 -$(RMDIR) $(DESTDIR)$(INSTALLTOP)/include
685 @set -e; for l in $(INSTALL_LIBS); do \
687 $(ECHO) "$(RM) $(DESTDIR)$(libdir)/$$fn"; \
688 $(RM) $(DESTDIR)$(libdir)/$$fn; \
690 @ : {- output_off() if $disabled{shared}; "" -}
691 @set -e; for s in $(INSTALL_SHLIB_INFO); do \
692 s1=`echo "$$s" | cut -f1 -d";"`; \
693 s2=`echo "$$s" | cut -f2 -d";"`; \
694 fn1=`basename $$s1`; \
695 fn2=`basename $$s2`; \
696 : {- output_off() if windowsdll(); "" -}; \
697 $(ECHO) "$(RM) $(DESTDIR)$(libdir)/$$fn2"; \
698 $(RM) $(DESTDIR)$(libdir)/$$fn2; \
699 if [ "$$fn1" != "$$fn2" -a -f "$(DESTDIR)$(libdir)/$$fn1" ]; then \
700 $(ECHO) "$(RM) $(DESTDIR)$(libdir)/$$fn1"; \
701 $(RM) $(DESTDIR)$(libdir)/$$fn1; \
703 : {- output_on() if windowsdll(); "" -}{- output_off() unless windowsdll(); "" -}; \
704 $(ECHO) "$(RM) $(DESTDIR)$(libdir)/$$fn2"; \
705 $(RM) $(DESTDIR)$(libdir)/$$fn2; \
706 : {- output_on() unless windowsdll(); "" -}; \
708 @ : {- output_on() if $disabled{shared}; "" -}
709 $(RM) $(DESTDIR)$(libdir)/pkgconfig/libcrypto.pc
710 $(RM) $(DESTDIR)$(libdir)/pkgconfig/libssl.pc
711 $(RM) $(DESTDIR)$(libdir)/pkgconfig/openssl.pc
712 -$(RMDIR) $(DESTDIR)$(libdir)/pkgconfig
713 -$(RMDIR) $(DESTDIR)$(libdir)
715 _install_modules_deps: install_runtime_libs build_modules
717 install_engines: _install_modules_deps
718 @[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
719 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(ENGINESDIR)/
720 @$(ECHO) "*** Installing engines"
721 @set -e; for e in dummy $(INSTALL_ENGINES); do \
722 if [ "$$e" = "dummy" ]; then continue; fi; \
724 $(ECHO) "install $$e -> $(DESTDIR)$(ENGINESDIR)/$$fn"; \
725 cp $$e $(DESTDIR)$(ENGINESDIR)/$$fn.new; \
726 chmod 755 $(DESTDIR)$(ENGINESDIR)/$$fn.new; \
727 mv -f $(DESTDIR)$(ENGINESDIR)/$$fn.new \
728 $(DESTDIR)$(ENGINESDIR)/$$fn; \
732 @$(ECHO) "*** Uninstalling engines"
733 @set -e; for e in dummy $(INSTALL_ENGINES); do \
734 if [ "$$e" = "dummy" ]; then continue; fi; \
736 if [ "$$fn" = '{- platform->dso("ossltest") -}' ]; then \
739 $(ECHO) "$(RM) $(DESTDIR)$(ENGINESDIR)/$$fn"; \
740 $(RM) $(DESTDIR)$(ENGINESDIR)/$$fn; \
742 -$(RMDIR) $(DESTDIR)$(ENGINESDIR)
744 install_modules: _install_modules_deps
745 @[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
746 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(MODULESDIR)/
747 @$(ECHO) "*** Installing modules"
748 @set -e; for e in dummy $(INSTALL_MODULES); do \
749 if [ "$$e" = "dummy" ]; then continue; fi; \
751 $(ECHO) "install $$e -> $(DESTDIR)$(MODULESDIR)/$$fn"; \
752 cp $$e $(DESTDIR)$(MODULESDIR)/$$fn.new; \
753 chmod 755 $(DESTDIR)$(MODULESDIR)/$$fn.new; \
754 mv -f $(DESTDIR)$(MODULESDIR)/$$fn.new \
755 $(DESTDIR)$(MODULESDIR)/$$fn; \
759 @$(ECHO) "*** Uninstalling modules"
760 @set -e; for e in dummy $(INSTALL_MODULES); do \
761 if [ "$$e" = "dummy" ]; then continue; fi; \
763 if [ "$$fn" = '{- platform->dso("ossltest") -}' ]; then \
766 $(ECHO) "$(RM) $(DESTDIR)$(MODULESDIR)/$$fn"; \
767 $(RM) $(DESTDIR)$(MODULESDIR)/$$fn; \
769 -$(RMDIR) $(DESTDIR)$(MODULESDIR)
771 install_runtime: install_programs
773 install_runtime_libs: build_libs
774 @[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
775 @ : {- output_off() if windowsdll(); "" -}
776 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(libdir)
777 @ : {- output_on() if windowsdll(); output_off() unless windowsdll(); "" -}
778 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(INSTALLTOP)/bin
779 @ : {- output_on() unless windowsdll(); "" -}
780 @$(ECHO) "*** Installing runtime libraries"
781 @set -e; for s in dummy $(INSTALL_SHLIBS); do \
782 if [ "$$s" = "dummy" ]; then continue; fi; \
784 : {- output_off() unless windowsdll(); "" -}; \
785 $(ECHO) "install $$s -> $(DESTDIR)$(INSTALLTOP)/bin/$$fn"; \
786 cp $$s $(DESTDIR)$(INSTALLTOP)/bin/$$fn.new; \
787 chmod 755 $(DESTDIR)$(INSTALLTOP)/bin/$$fn.new; \
788 mv -f $(DESTDIR)$(INSTALLTOP)/bin/$$fn.new \
789 $(DESTDIR)$(INSTALLTOP)/bin/$$fn; \
790 : {- output_on() unless windowsdll(); "" -}{- output_off() if windowsdll(); "" -}; \
791 $(ECHO) "install $$s -> $(DESTDIR)$(libdir)/$$fn"; \
792 cp $$s $(DESTDIR)$(libdir)/$$fn.new; \
793 chmod 755 $(DESTDIR)$(libdir)/$$fn.new; \
794 mv -f $(DESTDIR)$(libdir)/$$fn.new \
795 $(DESTDIR)$(libdir)/$$fn; \
796 : {- output_on() if windowsdll(); "" -}; \
799 install_programs: install_runtime_libs build_programs
800 @[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
801 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(INSTALLTOP)/bin
802 @$(ECHO) "*** Installing runtime programs"
803 @set -e; for x in dummy $(INSTALL_PROGRAMS); do \
804 if [ "$$x" = "dummy" ]; then continue; fi; \
806 $(ECHO) "install $$x -> $(DESTDIR)$(INSTALLTOP)/bin/$$fn"; \
807 cp $$x $(DESTDIR)$(INSTALLTOP)/bin/$$fn.new; \
808 chmod 755 $(DESTDIR)$(INSTALLTOP)/bin/$$fn.new; \
809 mv -f $(DESTDIR)$(INSTALLTOP)/bin/$$fn.new \
810 $(DESTDIR)$(INSTALLTOP)/bin/$$fn; \
812 @set -e; for x in dummy $(BIN_SCRIPTS); do \
813 if [ "$$x" = "dummy" ]; then continue; fi; \
815 $(ECHO) "install $$x -> $(DESTDIR)$(INSTALLTOP)/bin/$$fn"; \
816 cp $$x $(DESTDIR)$(INSTALLTOP)/bin/$$fn.new; \
817 chmod 755 $(DESTDIR)$(INSTALLTOP)/bin/$$fn.new; \
818 mv -f $(DESTDIR)$(INSTALLTOP)/bin/$$fn.new \
819 $(DESTDIR)$(INSTALLTOP)/bin/$$fn; \
822 uninstall_runtime: uninstall_programs uninstall_runtime_libs
825 @$(ECHO) "*** Uninstalling runtime programs"
826 @set -e; for x in dummy $(INSTALL_PROGRAMS); \
828 if [ "$$x" = "dummy" ]; then continue; fi; \
830 $(ECHO) "$(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$fn"; \
831 $(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$fn; \
833 @set -e; for x in dummy $(BIN_SCRIPTS); \
835 if [ "$$x" = "dummy" ]; then continue; fi; \
837 $(ECHO) "$(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$fn"; \
838 $(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$fn; \
840 -$(RMDIR) $(DESTDIR)$(INSTALLTOP)/bin
842 uninstall_runtime_libs:
843 @$(ECHO) "*** Uninstalling runtime libraries"
844 @ : {- output_off() unless windowsdll(); "" -}
845 @set -e; for s in dummy $(INSTALL_SHLIBS); do \
846 if [ "$$s" = "dummy" ]; then continue; fi; \
848 $(ECHO) "$(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$fn"; \
849 $(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$fn; \
851 @ : {- output_on() unless windowsdll(); "" -}
854 install_man_docs: build_man_docs
855 @[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
856 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(MANDIR)/man1
857 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(MANDIR)/man3
858 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(MANDIR)/man5
859 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(MANDIR)/man7
860 @$(ECHO) "*** Installing manpages"
861 @set -e; for x in dummy $(MANDOCS1); do \
862 if [ "$$x" = "dummy" ]; then continue; fi; \
864 $(ECHO) "install $$x -> $(DESTDIR)$(MANDIR)/man1/$${fn}$(MANSUFFIX)"; \
865 cp $$x $(DESTDIR)$(MANDIR)/man1/$${fn}$(MANSUFFIX); \
866 chmod 644 $(DESTDIR)$(MANDIR)/man1/$${fn}$(MANSUFFIX); \
868 @set -e; for x in dummy $(MANDOCS3); do \
869 if [ "$$x" = "dummy" ]; then continue; fi; \
871 $(ECHO) "install $$x -> $(DESTDIR)$(MANDIR)/man3/$${fn}$(MANSUFFIX)"; \
872 cp $$x $(DESTDIR)$(MANDIR)/man3/$${fn}$(MANSUFFIX); \
873 chmod 644 $(DESTDIR)$(MANDIR)/man3/$${fn}$(MANSUFFIX); \
875 @set -e; for x in dummy $(MANDOCS5); do \
876 if [ "$$x" = "dummy" ]; then continue; fi; \
878 $(ECHO) "install $$x -> $(DESTDIR)$(MANDIR)/man5/$${fn}$(MANSUFFIX)"; \
879 cp $$x $(DESTDIR)$(MANDIR)/man5/$${fn}$(MANSUFFIX); \
880 chmod 644 $(DESTDIR)$(MANDIR)/man5/$${fn}$(MANSUFFIX); \
882 @set -e; for x in dummy $(MANDOCS7); do \
883 if [ "$$x" = "dummy" ]; then continue; fi; \
885 $(ECHO) "install $$x -> $(DESTDIR)$(MANDIR)/man7/$${fn}$(MANSUFFIX)"; \
886 cp $$x $(DESTDIR)$(MANDIR)/man7/$${fn}$(MANSUFFIX); \
887 chmod 644 $(DESTDIR)$(MANDIR)/man7/$${fn}$(MANSUFFIX); \
891 @$(ECHO) "*** Uninstalling manpages"
892 @set -e; for x in dummy $(MANDOCS1); do \
893 if [ "$$x" = "dummy" ]; then continue; fi; \
895 $(ECHO) "$(RM) $(DESTDIR)$(MANDIR)/man1/$${fn}$(MANSUFFIX)"; \
896 $(RM) $(DESTDIR)$(MANDIR)/man1/$${fn}$(MANSUFFIX); \
898 @set -e; for x in dummy $(MANDOCS3); do \
899 if [ "$$x" = "dummy" ]; then continue; fi; \
901 $(ECHO) "$(RM) $(DESTDIR)$(MANDIR)/man3/$${fn}$(MANSUFFIX)"; \
902 $(RM) $(DESTDIR)$(MANDIR)/man3/$${fn}$(MANSUFFIX); \
904 @set -e; for x in dummy $(MANDOCS5); do \
905 if [ "$$x" = "dummy" ]; then continue; fi; \
907 $(ECHO) "$(RM) $(DESTDIR)$(MANDIR)/man5/$${fn}$(MANSUFFIX)"; \
908 $(RM) $(DESTDIR)$(MANDIR)/man5/$${fn}$(MANSUFFIX); \
910 @set -e; for x in dummy $(MANDOCS7); do \
911 if [ "$$x" = "dummy" ]; then continue; fi; \
913 $(ECHO) "$(RM) $(DESTDIR)$(MANDIR)/man7/$${fn}$(MANSUFFIX)"; \
914 $(RM) $(DESTDIR)$(MANDIR)/man7/$${fn}$(MANSUFFIX); \
917 install_html_docs: build_html_docs
918 @[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
919 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(HTMLDIR)/man1
920 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(HTMLDIR)/man3
921 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(HTMLDIR)/man5
922 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(HTMLDIR)/man7
923 @$(ECHO) "*** Installing HTML manpages"
924 @set -e; for x in dummy $(HTMLDOCS1); do \
925 if [ "$$x" = "dummy" ]; then continue; fi; \
927 $(ECHO) "install $$x -> $(DESTDIR)$(HTMLDIR)/man1/$$fn"; \
928 cp $$x $(DESTDIR)$(HTMLDIR)/man1/$$fn; \
929 chmod 644 $(DESTDIR)$(HTMLDIR)/man1/$$fn; \
931 @set -e; for x in dummy $(HTMLDOCS3); do \
932 if [ "$$x" = "dummy" ]; then continue; fi; \
934 $(ECHO) "install $$x -> $(DESTDIR)$(HTMLDIR)/man3/$$fn"; \
935 cp $$x $(DESTDIR)$(HTMLDIR)/man3/$$fn; \
936 chmod 644 $(DESTDIR)$(HTMLDIR)/man3/$$fn; \
938 @set -e; for x in dummy $(HTMLDOCS5); do \
939 if [ "$$x" = "dummy" ]; then continue; fi; \
941 $(ECHO) "install $$x -> $(DESTDIR)$(HTMLDIR)/man5/$$fn"; \
942 cp $$x $(DESTDIR)$(HTMLDIR)/man5/$$fn; \
943 chmod 644 $(DESTDIR)$(HTMLDIR)/man5/$$fn; \
945 @set -e; for x in dummy $(HTMLDOCS7); do \
946 if [ "$$x" = "dummy" ]; then continue; fi; \
948 $(ECHO) "install $$x -> $(DESTDIR)$(HTMLDIR)/man7/$$fn"; \
949 cp $$x $(DESTDIR)$(HTMLDIR)/man7/$$fn; \
950 chmod 644 $(DESTDIR)$(HTMLDIR)/man7/$$fn; \
954 @$(ECHO) "*** Uninstalling HTML manpages"
955 @set -e; for x in dummy $(HTMLDOCS1); do \
956 if [ "$$x" = "dummy" ]; then continue; fi; \
958 $(ECHO) "$(RM) $(DESTDIR)$(HTMLDIR)/man1/$$fn"; \
959 $(RM) $(DESTDIR)$(HTMLDIR)/man1/$$fn; \
961 @set -e; for x in dummy $(HTMLDOCS3); do \
962 if [ "$$x" = "dummy" ]; then continue; fi; \
964 $(ECHO) "$(RM) $(DESTDIR)$(HTMLDIR)/man3/$$fn"; \
965 $(RM) $(DESTDIR)$(HTMLDIR)/man3/$$fn; \
967 @set -e; for x in dummy $(HTMLDOCS5); do \
968 if [ "$$x" = "dummy" ]; then continue; fi; \
970 $(ECHO) "$(RM) $(DESTDIR)$(HTMLDIR)/man5/$$fn"; \
971 $(RM) $(DESTDIR)$(HTMLDIR)/man5/$$fn; \
973 @set -e; for x in dummy $(HTMLDOCS7); do \
974 if [ "$$x" = "dummy" ]; then continue; fi; \
976 $(ECHO) "$(RM) $(DESTDIR)$(HTMLDIR)/man7/$$fn"; \
977 $(RM) $(DESTDIR)$(HTMLDIR)/man7/$$fn; \
980 # Developer targets (note: these are only available on Unix) #########
982 update: generate errors ordinals
984 generate: generate_apps generate_crypto_bn generate_crypto_objects \
985 generate_crypto_conf generate_crypto_asn1 generate_fuzz_oids
987 .PHONY: doc-nits cmd-nits md-nits
988 doc-nits: build_generated
989 $(PERL) $(SRCDIR)/util/find-doc-nits -n -l -e
991 cmd-nits: build_generated apps/openssl
992 $(PERL) $(SRCDIR)/util/find-doc-nits -c
994 # This uses "mdl", the markdownlint application, which is written in ruby.
995 # The source is at https://github.com/markdownlint/markdownlint
996 # If you have ruby installed, "gem install mdl" should work.
997 # Another option is at https://snapcraft.io/install/mdl/debian
998 # Finally, there's a Node.js version, which we haven't tried, that
999 # can be found at https://github.com/DavidAnson/markdownlint
1001 mdl -s util/markdownlint.rb . NOTES-Windows.txt
1003 # Test coverage is a good idea for the future
1004 #coverage: $(PROGRAMS) $(TESTPROGRAMS)
1008 lint -DLINT $(INCLUDES) $(SRCS)
1011 ( cd $(SRCDIR); $(PERL) VMS/VMSify-conf.pl \
1012 < apps/openssl.cnf > apps/openssl-vms.cnf )
1015 ( cd $(SRCDIR); $(PERL) crypto/bn/bn_prime.pl > crypto/bn/bn_prime.h )
1017 generate_crypto_objects:
1018 ( cd $(SRCDIR); $(PERL) crypto/objects/objects.pl -n \
1019 crypto/objects/objects.txt \
1020 crypto/objects/obj_mac.num \
1021 > crypto/objects/obj_mac.new && \
1022 mv crypto/objects/obj_mac.new crypto/objects/obj_mac.num )
1023 ( cd $(SRCDIR); $(PERL) crypto/objects/objects.pl \
1024 crypto/objects/objects.txt \
1025 crypto/objects/obj_mac.num \
1026 > include/openssl/obj_mac.h )
1027 ( cd $(SRCDIR); $(PERL) crypto/objects/obj_dat.pl \
1028 include/openssl/obj_mac.h \
1029 > crypto/objects/obj_dat.h )
1030 ( cd $(SRCDIR); $(PERL) crypto/objects/objxref.pl \
1031 crypto/objects/obj_mac.num \
1032 crypto/objects/obj_xref.txt \
1033 > crypto/objects/obj_xref.h )
1034 ( cd $(SRCDIR); cat crypto/objects/obj_compat.h >> include/openssl/obj_mac.h )
1036 generate_crypto_conf:
1037 ( cd $(SRCDIR); $(PERL) crypto/conf/keysets.pl \
1038 > crypto/conf/conf_def.h )
1040 generate_crypto_asn1:
1041 ( cd $(SRCDIR); $(PERL) crypto/asn1/charmap.pl \
1042 > crypto/asn1/charmap.h )
1045 ( cd $(SRCDIR); $(PERL) fuzz/mkfuzzoids.pl \
1046 crypto/objects/obj_dat.h \
1049 # Set to -force to force a rebuild
1052 ( b=`pwd`; set -e; cd $(SRCDIR); \
1053 $(PERL) util/ck_errf.pl -strict -internal; \
1054 $(PERL) -I$$b util/mkerr.pl $(ERROR_REBUILD) -internal )
1055 ( b=`pwd`; set -e; cd $(SRCDIR)/engines; \
1056 for E in *.ec ; do \
1057 $(PERL) ../util/ck_errf.pl -strict \
1058 -conf $$E `basename $$E .ec`.c; \
1059 $(PERL) -I$$b ../util/mkerr.pl $(ERROR_REBUILD) -static \
1060 -conf $$E `basename $$E .ec`.c ; \
1063 {- use File::Basename;
1065 my @sslheaders_tmpl =
1066 qw( include/openssl/ssl.h
1067 include/openssl/ssl2.h
1068 include/openssl/ssl3.h
1069 include/openssl/sslerr.h
1070 include/openssl/tls1.h
1071 include/openssl/dtls1.h
1072 include/openssl/srtp.h );
1073 my @cryptoheaders_tmpl =
1074 qw( include/internal/dso.h
1075 include/internal/o_dir.h
1076 include/internal/err.h
1077 include/internal/evp.h
1078 include/internal/pem.h
1079 include/internal/asn1.h
1080 include/internal/sslconf.h );
1081 my @cryptoskipheaders = ( @sslheaders_tmpl,
1082 qw( include/openssl/conf_api.h
1083 include/openssl/ebcdic.h
1084 include/openssl/opensslconf.h
1085 include/openssl/symhacks.h ) );
1086 our %cryptoheaders = ();
1087 our %sslheaders = ();
1088 foreach my $d ( qw( include/openssl include/internal ) ) {
1089 my @header_patterns =
1090 map { catfile($config{sourcedir}, $d, $_) } ( '*.h', '*.h.in' );
1091 foreach my $f ( map { glob($_) } @header_patterns ) {
1092 my $base = basename($f);
1093 my $base_in = basename($f, '.in');
1094 my $dir = catfile($config{sourcedir}, $d);
1095 if ($base ne $base_in) {
1096 # We have a .h.in file, which means the header file is in the
1099 $dir = catfile($config{builddir}, $d);
1101 my $new_f = catfile($dir, $base);
1102 my $fn = "$d/$base";
1103 # The logic to add files to @cryptoheaders is a bit complex. The
1104 # file to be added must be either in the public header directory
1105 # or one of the pre-declared internal headers, and must under no
1106 # circumstances be one of those that must be skipped.
1107 $cryptoheaders{$new_f} = 1
1108 if (($d eq 'include/openssl'
1109 || ( grep { $_ eq $fn } @cryptoheaders_tmpl ))
1110 && !( grep { $_ eq $fn } @cryptoskipheaders ));
1111 # The logic to add files to @sslheaders is much simpler...
1112 $sslheaders{$new_f} = 1 if grep { $_ eq $fn } @sslheaders_tmpl;
1117 CRYPTOHEADERS={- join(" \\\n" . ' ' x 14,
1118 fill_lines(" ", $COLUMNS - 14, sort keys %cryptoheaders)) -}
1119 SSLHEADERS={- join(" \\\n" . ' ' x 11,
1120 fill_lines(" ", $COLUMNS - 11, sort keys %sslheaders)) -}
1121 ordinals: build_generated
1122 $(PERL) $(SRCDIR)/util/mknum.pl --version $(VERSION) --no-warnings \
1123 --ordinals $(SRCDIR)/util/libcrypto.num \
1124 --symhacks $(SRCDIR)/include/openssl/symhacks.h \
1126 $(PERL) $(SRCDIR)/util/mknum.pl --version $(VERSION) --no-warnings \
1127 --ordinals $(SRCDIR)/util/libssl.num \
1128 --symhacks $(SRCDIR)/include/openssl/symhacks.h \
1133 SRCTOP=../$(SRCDIR) \
1134 BLDTOP=../$(BLDDIR) \
1135 $(PERL) ../$(SRCDIR)/test/run_tests.pl test_ordinals )
1140 -etags `find . -name '*.[ch]' -o -name '*.pm'`
1142 # Release targets (note: only available on Unix) #####################
1145 (cd $(SRCDIR); ./util/mktar.sh --name='$(NAME)' --tarfile='$(TARFILE)')
1147 # Helper targets #####################################################
1149 link-utils: $(BLDDIR)/util/opensslwrap.sh $(BLDDIR)/util/wrap.pl
1151 $(BLDDIR)/util/opensslwrap.sh $(BLDDIR)/util/wrap.pl: configdata.pm
1152 @if [ "$(SRCDIR)" != "$(BLDDIR)" ]; then \
1153 mkdir -p "$(BLDDIR)/util"; \
1154 ln -sf "../$(SRCDIR)/util/`basename "$@"`" "$(BLDDIR)/util"; \
1159 # Building targets ###################################################
1161 libcrypto.pc libssl.pc openssl.pc: configdata.pm $(LIBS) {- join(" ",map { platform->sharedlib_simple($_) // () } @{$unified_info{libraries}}) -}
1163 @ ( echo 'prefix=$(INSTALLTOP)'; \
1164 echo 'exec_prefix=$${prefix}'; \
1165 if [ -n "$(LIBDIR)" ]; then \
1166 echo 'libdir=$${exec_prefix}/$(LIBDIR)'; \
1168 echo 'libdir=$(libdir)'; \
1170 echo 'includedir=$${prefix}/include'; \
1171 echo 'enginesdir=$${libdir}/engines-{- $sover_dirname -}'; \
1173 echo 'Name: OpenSSL-libcrypto'; \
1174 echo 'Description: OpenSSL cryptography library'; \
1175 echo 'Version: '$(VERSION); \
1176 echo 'Libs: -L$${libdir} -lcrypto'; \
1177 echo 'Libs.private: $(LIB_EX_LIBS)'; \
1178 echo 'Cflags: -I$${includedir}' ) > libcrypto.pc
1181 @ ( echo 'prefix=$(INSTALLTOP)'; \
1182 echo 'exec_prefix=$${prefix}'; \
1183 if [ -n "$(LIBDIR)" ]; then \
1184 echo 'libdir=$${exec_prefix}/$(LIBDIR)'; \
1186 echo 'libdir=$(libdir)'; \
1188 echo 'includedir=$${prefix}/include'; \
1190 echo 'Name: OpenSSL-libssl'; \
1191 echo 'Description: Secure Sockets Layer and cryptography libraries'; \
1192 echo 'Version: '$(VERSION); \
1193 echo 'Requires.private: libcrypto'; \
1194 echo 'Libs: -L$${libdir} -lssl'; \
1195 echo 'Cflags: -I$${includedir}' ) > libssl.pc
1198 @ ( echo 'prefix=$(INSTALLTOP)'; \
1199 echo 'exec_prefix=$${prefix}'; \
1200 if [ -n "$(LIBDIR)" ]; then \
1201 echo 'libdir=$${exec_prefix}/$(LIBDIR)'; \
1203 echo 'libdir=$(libdir)'; \
1205 echo 'includedir=$${prefix}/include'; \
1207 echo 'Name: OpenSSL'; \
1208 echo 'Description: Secure Sockets Layer and cryptography libraries and tools'; \
1209 echo 'Version: '$(VERSION); \
1210 echo 'Requires: libssl libcrypto' ) > openssl.pc
1212 configdata.pm: $(SRCDIR)/Configure $(SRCDIR)/config \
1213 {- join(" \\\n" . ' ' x 15,
1214 fill_lines(" ", $COLUMNS - 15,
1215 @{$config{build_file_templates}},
1216 @{$config{build_infos}},
1217 @{$config{conf_files}})) -}
1218 @echo "Detected changed: $?"
1219 $(PERL) configdata.pm -r
1220 @echo "**************************************************"
1222 @echo "*** Please run the same make command again ***"
1224 @echo "**************************************************"
1228 $(PERL) configdata.pm -r
1232 use File::Spec::Functions qw/:DEFAULT abs2rel rel2abs/;
1234 # Helper function to figure out dependencies on libraries
1235 # It takes a list of library names and outputs a list of dependencies
1236 sub compute_lib_depends {
1237 # Depending on shared libraries:
1238 # On Windows POSIX layers, we depend on {libname}.dll.a
1239 # On Unix platforms, we depend on {shlibname}.so
1240 return map { platform->sharedlib_simple($_) // platform->staticlib($_) } @_;
1245 my $generator = join(" ", @{$args{generator}});
1246 my $generator_incs = join("", map { " -I".$_ } @{$args{generator_incs}});
1247 my $incs = join("", map { " -I".$_ } @{$args{incs}});
1248 my $defs = join("", map { " -D".$_ } @{$args{defs}});
1249 my $deps = join(" ", @{$args{generator_deps}}, @{$args{deps}});
1251 if ($args{src} =~ /\.html$/) {
1252 my $title = basename($args{src}, ".html");
1253 my $pod = $args{generator}->[0];
1256 \$(PERL) \$(SRCDIR)/util/mkpod2html.pl -i "$pod" -o \$\@ -t "$title" -r "\$(SRCDIR)/doc"
1258 } elsif ($args{src} =~ /\.(\d)$/) {
1260 my $name = uc basename($args{src}, ".$section");
1261 my $pod = $args{generator}->[0];
1264 pod2man --name=$name --section=$section --center=OpenSSL \\
1265 --release=\$(VERSION) $pod >\$\@
1267 } elsif (platform->isdef($args{src})) {
1268 my $target = platform->def($args{src});
1269 (my $mkdef_os = $target{shared_target}) =~ s|-shared$||;
1270 my $ord_ver = $args{intent} eq 'lib' ? ' --version $(VERSION)' : '';
1271 my $ord_name = $args{generator}->[1] || $args{product};
1273 $target: $args{generator}->[0] $deps \$(SRCDIR)/util/mkdef.pl
1274 \$(PERL) \$(SRCDIR)/util/mkdef.pl$ord_ver --ordinals $args{generator}->[0] --name $ord_name --OS $mkdef_os > $target
1276 } elsif (!platform->isasm($args{src})) {
1277 if ($args{generator}->[0] =~ m|^.*\.in$|) {
1278 my $dofile = abs2rel(rel2abs(catfile($config{sourcedir},
1279 "util", "dofile.pl")),
1280 rel2abs($config{builddir}));
1281 my @modules = ( 'configdata.pm',
1282 grep { $_ =~ m|\.pm$| } @{$args{deps}} );
1283 my %moduleincs = map { '"-I'.dirname($_).'"' => 1 } @modules;
1284 @modules = map { "-M".basename($_, '.pm') } @modules;
1285 my $modules = join(' ', '', sort keys %moduleincs, @modules);
1287 $args{src}: $args{generator}->[0] $deps \$(BLDDIR)/configdata.pm
1288 \$(PERL)$modules "$dofile" "-o$target{build_file}" $generator > \$@
1292 $args{src}: $args{generator}->[0] $deps
1293 \$(PERL)$generator_incs $generator > \$@
1298 shlib => '$(LIB_CFLAGS) $(LIB_CPPFLAGS)',
1299 lib => '$(LIB_CFLAGS) $(LIB_CPPFLAGS)',
1300 dso => '$(DSO_CFLAGS) $(DSO_CPPFLAGS)',
1301 bin => '$(BIN_CFLAGS) $(BIN_CPPFLAGS)'
1302 } -> {$args{intent}};
1304 if ($args{generator}->[0] =~ /\.pl$/) {
1305 $generator = 'CC="$(CC)" $(PERL)'.$generator_incs.' '.$generator
1306 .' "$(PERLASM_SCHEME)"'.$incs.' '.$cppflags.$defs.' $(PROCESSOR)';
1307 } elsif ($args{generator}->[0] =~ /\.m4$/) {
1308 $generator = 'm4 -B 8192'.$generator_incs.' '.$generator.' >'
1309 } elsif ($args{generator}->[0] =~ /\.S$/) {
1312 die "Generator type for $args{src} unknown: $generator\n";
1315 if (defined($generator)) {
1317 $args{src}: $args{generator}->[0] $deps
1322 $args{src}: $args{generator}->[0] $deps
1323 \$(CC) $incs $cppflags $defs -E $args{generator}->[0] | \\
1324 \$(PERL) -ne '/^#(line)?\\s*[0-9]+/ or print' > \$@
1329 # Should one wonder about the end of the Perl snippet, it's because this
1330 # second regexp eats up line endings as well, if the removed path is the
1331 # last in the line. We may therefore need to put back a line ending.
1334 my $obj = platform->convertext($args{obj});
1335 my $dep = platform->dep($args{obj});
1336 my @srcs = @{$args{srcs}};
1337 my $srcs = join(" ", @srcs);
1338 my $deps = join(" ", @srcs, @{$args{deps}});
1339 my $incs = join("", map { " -I".$_ } @{$args{incs}});
1340 my $defs = join("", map { " -D".$_ } @{$args{defs}});
1344 if (grep /\.rc$/, @srcs) {
1346 $cmdflags = '$(RCFLAGS)';
1348 } elsif (grep /\.(cc|cpp)$/, @srcs) {
1350 $cmdcompile = ' -c';
1352 shlib => '$(LIB_CXXFLAGS) $(LIB_CPPFLAGS)',
1353 lib => '$(LIB_CXXFLAGS) $(LIB_CPPFLAGS)',
1354 dso => '$(DSO_CXXFLAGS) $(DSO_CPPFLAGS)',
1355 bin => '$(BIN_CXXFLAGS) $(BIN_CPPFLAGS)'
1356 } -> {$args{intent}};
1359 $cmdcompile = ' -c';
1361 shlib => '$(LIB_CFLAGS) $(LIB_CPPFLAGS)',
1362 lib => '$(LIB_CFLAGS) $(LIB_CPPFLAGS)',
1363 dso => '$(DSO_CFLAGS) $(DSO_CPPFLAGS)',
1364 bin => '$(BIN_CFLAGS) $(BIN_CPPFLAGS)'
1365 } -> {$args{intent}};
1368 # extension-specific rules
1369 if (grep /\.s$/, @srcs) {
1372 $cmd $cmdflags -c -o \$\@ $srcs
1374 } elsif (grep /\.S$/, @srcs) {
1375 # Originally there was mutli-step rule with $(CC) -E file.S
1376 # followed by $(CC) -c file.s. It compensated for one of
1377 # legacy platform compiler's inability to handle .S files.
1378 # The platform is long discontinued by vendor so there is
1379 # hardly a point to drag it along...
1382 $cmd $incs $defs $cmdflags -c -o \$\@ $srcs
1384 } elsif (defined $makedepprog && $makedepprog !~ /\/makedepend/
1385 && !grep /\.rc$/, @srcs) {
1388 $cmd $incs $defs $cmdflags -MMD -MF $dep.tmp -MT \$\@ -c -o \$\@ $srcs
1390 \@if cmp $dep.tmp $dep > /dev/null 2> /dev/null; then \\
1393 mv $dep.tmp $dep; \\
1399 $cmd $incs $defs $cmdflags $cmdcompile -o \$\@ $srcs
1401 if (defined $makedepprog && $makedepprog =~ /\/makedepend/) {
1403 \$(MAKEDEPEND) -f- -Y -- $incs $cmdflags -- $srcs 2>/dev/null \\
1410 # We *know* this routine is only called when we've configure 'shared'.
1415 foreach (@{$args{deps}}) {
1416 if (platform->isstaticlib($_)) {
1417 push @linklibs, platform->convertext($_);
1419 my $d = "-L" . dirname($_);
1420 my $l = basename($_);
1424 push @linkdirs, $d unless grep { $d eq $_ } @linkdirs;
1427 my $linkflags = join("", map { $_." " } @linkdirs);
1428 my $linklibs = join("", map { $_." " } @linklibs);
1429 my @objs = map { platform->convertext($_) }
1430 grep { !platform->isdef($_) }
1432 my @defs = map { platform->def($_) }
1433 grep { platform->isdef($_) }
1435 my @deps = compute_lib_depends(@{$args{deps}});
1436 die "More than one exported symbol map" if scalar @defs > 1;
1438 my $simple = platform->sharedlib_simple($args{lib});
1439 my $full = platform->sharedlib($args{lib});
1440 my $shared_soname = "";
1441 $shared_soname .= ' '.$target{shared_sonameflag}.basename($full)
1442 if defined $target{shared_sonameflag};
1443 my $shared_imp = "";
1444 $shared_imp .= ' '.$target{shared_impflag}.basename($simple)
1445 if defined $target{shared_impflag};
1446 my $shared_def = join("", map { ' '.$target{shared_defflag}.$_ } @defs);
1448 my $objs = join(" \\\n\t\t", fill_lines(' ', $COLUMNS - 16, @objs));
1449 my $deps = join(" \\\n" . ' ' x (length($full) + 2),
1450 fill_lines(' ', $COLUMNS - length($full) - 2,
1451 @objs, @defs, @deps));
1453 my $recipe = <<"EOF";
1459 \$(AR) r $simple $full
1461 } elsif ($simple ne $full) {
1469 \$(CC) \$(LIB_CFLAGS) $linkflags\$(LIB_LDFLAGS)$shared_soname$shared_imp \\
1470 -o $full$shared_def \\
1472 $linklibs \$(LIB_EX_LIBS)
1488 my $dso = platform->dso($args{module});
1491 foreach (@{$args{deps}}) {
1492 next unless defined $_;
1493 if (platform->isstaticlib($_)) {
1494 push @linklibs, platform->convertext($_);
1496 my $d = "-L" . dirname($_);
1497 my $l = basename($_);
1501 push @linkdirs, $d unless grep { $d eq $_ } @linkdirs;
1504 my $linkflags = join("", map { $_." " } @linkdirs);
1505 my $linklibs = join("", map { $_." " } @linklibs);
1506 my @objs = map { platform->convertext($_) }
1507 grep { !platform->isdef($_) }
1509 my @defs = map { platform->def($_) }
1510 grep { platform->isdef($_) }
1512 my @deps = compute_lib_depends(@{$args{deps}});
1513 my $shared_def = join("", map { ' '.$target{shared_defflag}.$_ } @defs);
1514 # TODO(3.0): next line needs to become "less magic" (see PR #11950)
1515 $shared_def .= ' '.$target{shared_fipsflag} if (m/providers\/fips/ && defined $target{shared_fipsflag});
1516 my $objs = join(" \\\n\t\t", fill_lines(' ', $COLUMNS - 16, @objs));
1517 my $deps = join(" \\\n" . ' ' x (length($dso) + 2),
1518 fill_lines(' ', $COLUMNS - length($dso) - 2,
1519 @objs, @defs, @deps));
1523 \$(CC) \$(DSO_CFLAGS) $linkflags\$(DSO_LDFLAGS) \\
1524 -o $dso$shared_def \\
1526 $linklibs\$(DSO_EX_LIBS)
1531 my $lib = platform->staticlib($args{lib});
1532 my @objs = map { platform->obj($_) } @{$args{objs}};
1533 my $deps = join(" \\\n" . ' ' x (length($lib) + 2),
1534 fill_lines(' ', $COLUMNS - length($lib) - 2, @objs));
1535 my $max_per_call = 500;
1537 push @objs_grouped, join(" ", splice @objs, 0, $max_per_call) while @objs;
1539 join("\n\t", (map { "\$(AR) \$(ARFLAGS) $lib $_" } @objs_grouped));
1544 \$(RANLIB) \$\@ || echo Never mind.
1549 my $bin = platform->bin($args{bin});
1550 my @objs = map { platform->obj($_) } @{$args{objs}};
1551 my @deps = compute_lib_depends(@{$args{deps}});
1552 my $objs = join(" \\\n" . ' ' x (length($bin) + 2),
1553 fill_lines(' ', $COLUMNS - length($bin) - 2, @objs));
1556 foreach (@{$args{deps}}) {
1557 next unless defined $_;
1558 if (platform->isstaticlib($_)) {
1559 push @linklibs, platform->convertext($_);
1561 my $d = "-L" . dirname($_);
1562 my $l = basename($_);
1566 push @linkdirs, $d unless grep { $d eq $_ } @linkdirs;
1569 my $linkflags = join("", map { $_." " } @linkdirs);
1570 my $linklibs = join("", map { $_." " } @linklibs);
1572 my $cmdflags = '$(BIN_CFLAGS)';
1573 if (grep /_cc\.o$/, @{$args{objs}}) {
1575 $cmdflags = '$(BIN_CXXFLAGS)';
1578 my $objs = join(" \\\n\t\t", fill_lines(' ', $COLUMNS - 16, @objs));
1579 my $deps = join(" \\\n" . ' ' x (length($bin) + 2),
1580 fill_lines(' ', $COLUMNS - length($bin) - 2,
1586 \$\${LDCMD:-$cmd} $cmdflags $linkflags\$(BIN_LDFLAGS) \\
1589 $linklibs\$(BIN_EX_LIBS)
1594 my $script = $args{script};
1595 my $sources = join(" ", @{$args{sources}});
1596 my $dofile = abs2rel(rel2abs(catfile($config{sourcedir},
1597 "util", "dofile.pl")),
1598 rel2abs($config{builddir}));
1601 \$(PERL) "-I\$(BLDDIR)" -Mconfigdata "$dofile" \\
1602 "-o$target{build_file}" $sources > "$script"
1608 my $dir = $args{dir};
1609 my @deps = map { platform->convertext($_) } @{$args{deps}};
1611 my %extinfo = ( dso => platform->dsoext(),
1612 lib => platform->libext(),
1613 bin => platform->binext() );
1615 # We already have a 'test' target, and the top directory is just plain
1617 return if $dir eq "test" || $dir eq ".";
1619 foreach my $type (("dso", "lib", "bin", "script")) {
1620 next unless defined($unified_info{dirinfo}->{$dir}->{products}->{$type});
1621 # For lib object files, we could update the library. However, it
1622 # was decided that it's enough to build the directory local object
1623 # files, so we don't need to add any actions, and the dependencies
1624 # are already taken care of.
1625 if ($type ne "lib") {
1626 foreach my $prod (@{$unified_info{dirinfo}->{$dir}->{products}->{$type}}) {
1627 if (dirname($prod) eq $dir) {
1628 push @deps, $prod.$extinfo{$type};
1630 push @comments, "# No support to produce $type ".join(", ", @{$unified_info{dirinfo}->{$dir}->{products}->{$type}});
1636 my $target = "$dir $dir/";
1637 my $deps = join(" \\\n\t",
1638 fill_lines(' ', $COLUMNS - 8, @deps));
1639 my $comments = join("\n", "", @comments);
1645 "" # Important! This becomes part of the template result.