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,
144 map { platform->dso($_) }
145 grep { !$unified_info{attributes}->{modules}->{$_}->{noinst}
146 && !$unified_info{attributes}->{modules}->{$_}->{engine} }
147 @{$unified_info{modules}}))
150 join(" \\\n" . ' ' x 16,
151 fill_lines(" ", $COLUMNS - 16, map { platform->bin($_) }
152 grep { !$unified_info{attributes}->{programs}->{$_}->{noinst} }
153 @{$unified_info{programs}}))
156 join(" \\\n" . ' ' x 12,
157 fill_lines(" ", $COLUMNS - 12,
158 map { my $x = $unified_info{attributes}->{scripts}->{$_}->{linkname};
160 grep { !$unified_info{attributes}->{scripts}->{$_}->{noinst}
161 && !$unified_info{attributes}->{scripts}->{$_}->{misc} }
162 @{$unified_info{scripts}}))
165 join(" \\\n" . ' ' x 13,
166 fill_lines(" ", $COLUMNS - 13,
167 map { my $x = $unified_info{attributes}->{scripts}->{$_}->{linkname};
169 grep { !$unified_info{attributes}->{scripts}->{$_}->{noinst}
170 && $unified_info{attributes}->{scripts}->{$_}->{misc} }
171 @{$unified_info{scripts}}))
174 join(" \\\n" . ' ' x 10,
175 fill_lines(" ", $COLUMNS - 10, map { platform->bin($_) }
176 @{$unified_info{htmldocs}->{man1}})) -}
178 join(" \\\n" . ' ' x 10,
179 fill_lines(" ", $COLUMNS - 10, map { platform->bin($_) }
180 @{$unified_info{htmldocs}->{man3}})) -}
182 join(" \\\n" . ' ' x 10,
183 fill_lines(" ", $COLUMNS - 10, map { platform->bin($_) }
184 @{$unified_info{htmldocs}->{man5}})) -}
186 join(" \\\n" . ' ' x 10,
187 fill_lines(" ", $COLUMNS - 10, map { platform->bin($_) }
188 @{$unified_info{htmldocs}->{man7}})) -}
190 join(" \\\n" . ' ' x 9,
191 fill_lines(" ", $COLUMNS - 9, map { platform->bin($_) }
192 @{$unified_info{mandocs}->{man1}})) -}
194 join(" \\\n" . ' ' x 9,
195 fill_lines(" ", $COLUMNS - 9, map { platform->bin($_) }
196 @{$unified_info{mandocs}->{man3}})) -}
198 join(" \\\n" . ' ' x 9,
199 fill_lines(" ", $COLUMNS - 9, map { platform->bin($_) }
200 @{$unified_info{mandocs}->{man5}})) -}
202 join(" \\\n" . ' ' x 9,
203 fill_lines(" ", $COLUMNS - 9, map { platform->bin($_) }
204 @{$unified_info{mandocs}->{man7}})) -}
206 APPS_OPENSSL="{- use File::Spec::Functions;
207 catfile("apps","openssl") -}"
209 # DESTDIR is for package builders so that they can configure for, say,
210 # /usr/ and yet have everything installed to /tmp/somedir/usr/.
211 # Normally it is left empty.
214 # Do not edit these manually. Use Configure with --prefix or --openssldir
215 # to change this! Short explanation in the top comment in Configure
216 INSTALLTOP={- # $prefix is used in the OPENSSLDIR perl snippet
218 our $prefix = $config{prefix} || "/usr/local";
221 # The logic here is that if no --openssldir was given,
222 # OPENSSLDIR will get the value from $prefix plus "/ssl".
223 # If --openssldir was given and the value is an absolute
224 # path, OPENSSLDIR will get its value without change.
225 # If the value from --openssldir is a relative path,
226 # OPENSSLDIR will get $prefix with the --openssldir
227 # value appended as a subdirectory.
229 use File::Spec::Functions;
231 $config{openssldir} ?
232 (file_name_is_absolute($config{openssldir}) ?
234 : catdir($prefix, $config{openssldir}))
235 : catdir($prefix, "ssl");
237 LIBDIR={- our $libdir = $config{libdir};
240 # if $prefix/lib$target{multilib} is not an existing
241 # directory, then assume that it's not searched by linker
242 # automatically, in which case adding $target{multilib} suffix
243 # causes more grief than we're ready to tolerate, so don't...
245 -d "$prefix/lib$target{multilib}" ? $target{multilib} : "";
246 $libdir = "lib$multilib";
248 file_name_is_absolute($libdir) ? "" : $libdir -}
249 # $(libdir) is chosen to be compatible with the GNU coding standards
250 libdir={- file_name_is_absolute($libdir)
251 ? $libdir : '$(INSTALLTOP)/$(LIBDIR)' -}
252 ENGINESDIR=$(libdir)/engines-{- $sover_dirname -}
253 MODULESDIR=$(libdir)/ossl-modules
255 # Convenience variable for those who want to set the rpath in shared
256 # libraries and applications
259 MANDIR=$(INSTALLTOP)/share/man
260 DOCDIR=$(INSTALLTOP)/share/doc/$(BASENAME)
261 HTMLDIR=$(DOCDIR)/html
263 # MANSUFFIX is for the benefit of anyone who may want to have a suffix
264 # appended after the manpage file section number. "ssl" is popular,
265 # resulting in files such as config.5ssl rather than config.5.
269 # For "optional" echo messages, to get "real" silence
272 ##### User defined commands and flags ################################
274 # We let the C compiler driver to take care of .s files. This is done in
275 # order to be excused from maintaining a separate set of architecture
276 # dependent assembler flags. E.g. if you throw -mcpu=ultrasparc at SPARC
277 # gcc, then the driver will automatically translate it to -xarch=v8plus
278 # and pass it down to assembler. In any case, we do not define AS or
279 # ASFLAGS for this reason.
281 CROSS_COMPILE={- $config{CROSS_COMPILE} -}
282 CC=$(CROSS_COMPILE){- $config{CC} -}
283 CXX={- $config{CXX} ? "\$(CROSS_COMPILE)$config{CXX}" : '' -}
284 CPPFLAGS={- our $cppflags1 = join(" ",
285 (map { "-D".$_} @{$config{CPPDEFINES}}),
286 (map { "-I".$_} @{$config{CPPINCLUDES}}),
287 @{$config{CPPFLAGS}}) -}
288 CFLAGS={- join(' ', @{$config{CFLAGS}}) -}
289 CXXFLAGS={- join(' ', @{$config{CXXFLAGS}}) -}
290 LDFLAGS= {- join(' ', @{$config{LDFLAGS}}) -}
291 EX_LIBS= {- join(' ', @{$config{LDLIBS}}) -}
293 MAKEDEPEND={- $config{makedepprog} -}
295 PERL={- $config{PERL} -}
297 AR=$(CROSS_COMPILE){- $config{AR} -}
298 ARFLAGS= {- join(' ', @{$config{ARFLAGS}}) -}
299 RANLIB={- $config{RANLIB} ? "\$(CROSS_COMPILE)$config{RANLIB}" : "true"; -}
300 RC= $(CROSS_COMPILE){- $config{RC} -}
301 RCFLAGS={- join(' ', @{$config{RCFLAGS}}) -} {- $target{shared_rcflag} -}
305 TAR= {- $target{TAR} || "tar" -}
306 TARFLAGS= {- $target{TARFLAGS} -}
309 NAME= $(BASENAME)-$(VERSION)
310 # Relative to $(SRCDIR)
311 TARFILE= ../$(NAME).tar
313 ##### Project flags ##################################################
315 # Variables starting with CNF_ are common variables for all product types
317 CNF_CPPFLAGS={- our $cppflags2 =
318 join(' ', $target{cppflags} || (),
319 (map { "-D".$_} @{$target{defines}},
320 @{$config{defines}}),
321 (map { "-I".$_} @{$target{includes}},
322 @{$config{includes}}),
323 @{$config{cppflags}}) -}
324 CNF_CFLAGS={- join(' ', $target{cflags} || (),
325 @{$config{cflags}}) -}
326 CNF_CXXFLAGS={- join(' ', $target{cxxflags} || (),
327 @{$config{cxxflags}}) -}
328 CNF_LDFLAGS={- join(' ', $target{lflags} || (),
329 @{$config{lflags}}) -}
330 CNF_EX_LIBS={- join(' ', $target{ex_libs} || (),
331 @{$config{ex_libs}}) -}
333 # Variables starting with LIB_ are used to build library object files
334 # and shared libraries.
335 # Variables starting with DSO_ are used to build DSOs and their object files.
336 # Variables starting with BIN_ are used to build programs and their object
339 LIB_CPPFLAGS={- our $lib_cppflags =
340 join(' ', $target{lib_cppflags} || (),
341 $target{shared_cppflag} || (),
343 @{$target{lib_defines} || ()},
344 @{$target{shared_defines} || ()},
345 @{$config{lib_defines} || ()},
346 @{$config{shared_defines} || ()}),
347 (map { '-I'.quotify1($_) }
348 @{$target{lib_includes}},
349 @{$target{shared_includes}},
350 @{$config{lib_includes}},
351 @{$config{shared_includes}}),
352 @{$config{lib_cppflags}},
353 @{$config{shared_cppflag}});
354 join(' ', $lib_cppflags,
356 'OPENSSLDIR="\"$(OPENSSLDIR)\""',
357 'ENGINESDIR="\"$(ENGINESDIR)\""',
358 'MODULESDIR="\"$(MODULESDIR)\""'),
359 '$(CNF_CPPFLAGS)', '$(CPPFLAGS)') -}
360 LIB_CFLAGS={- join(' ', $target{lib_cflags} || (),
361 $target{shared_cflag} || (),
362 @{$config{lib_cflags}},
363 @{$config{shared_cflag}},
364 '$(CNF_CFLAGS)', '$(CFLAGS)') -}
365 LIB_CXXFLAGS={- join(' ', $target{lib_cxxflags} || (),
366 $target{shared_cxxflag} || (),
367 @{$config{lib_cxxflags}},
368 @{$config{shared_cxxflag}},
369 '$(CNF_CXXFLAGS)', '$(CXXFLAGS)') -}
370 LIB_LDFLAGS={- join(' ', $target{shared_ldflag} || (),
371 $config{shared_ldflag} || (),
372 '$(CNF_LDFLAGS)', '$(LDFLAGS)') -}
373 LIB_EX_LIBS=$(CNF_EX_LIBS) $(EX_LIBS)
374 DSO_CPPFLAGS={- join(' ', $target{dso_cppflags} || (),
375 $target{module_cppflags} || (),
377 @{$target{dso_defines}},
378 @{$target{module_defines}},
379 @{$config{dso_defines} || ()},
380 @{$config{module_defines} || ()}),
381 (map { '-I'.quotify1($_) }
382 @{$target{dso_includes}},
383 @{$target{module_includes}},
384 @{$config{dso_includes}},
385 @{$config{module_includes}}),
386 @{$config{dso_cppflags}},
387 @{$config{module_cppflags}},
388 '$(CNF_CPPFLAGS)', '$(CPPFLAGS)') -}
389 DSO_CFLAGS={- join(' ', $target{dso_cflags} || (),
390 $target{module_cflags} || (),
391 @{$config{dso_cflags}},
392 @{$config{module_cflags}},
393 '$(CNF_CFLAGS)', '$(CFLAGS)') -}
394 DSO_CXXFLAGS={- join(' ', $target{dso_cxxflags} || (),
395 $target{module_cxxflags} || (),
396 @{$config{dso_cxxflags}},
397 @{$config{module_cxxflag}},
398 '$(CNF_CXXFLAGS)', '$(CXXFLAGS)') -}
399 DSO_LDFLAGS={- join(' ', $target{dso_ldflags} || (),
400 $target{module_ldflags} || (),
401 @{$config{dso_ldflags}},
402 @{$config{module_ldflags}},
403 '$(CNF_LDFLAGS)', '$(LDFLAGS)') -}
404 DSO_EX_LIBS=$(CNF_EX_LIBS) $(EX_LIBS)
405 BIN_CPPFLAGS={- join(' ', $target{bin_cppflags} || (),
406 (map { '-D'.$_ } @{$config{bin_defines} || ()}),
407 @{$config{bin_cppflags}},
408 '$(CNF_CPPFLAGS)', '$(CPPFLAGS)') -}
409 BIN_CFLAGS={- join(' ', $target{bin_cflags} || (),
410 @{$config{bin_cflags}},
411 '$(CNF_CFLAGS)', '$(CFLAGS)') -}
412 BIN_CXXFLAGS={- join(' ', $target{bin_cxxflags} || (),
413 @{$config{bin_cxxflags}},
414 '$(CNF_CXXFLAGS)', '$(CXXFLAGS)') -}
415 BIN_LDFLAGS={- join(' ', $target{bin_lflags} || (),
416 @{$config{bin_lflags}},
417 '$(CNF_LDFLAGS)', '$(LDFLAGS)') -}
418 BIN_EX_LIBS=$(CNF_EX_LIBS) $(EX_LIBS)
420 # CPPFLAGS_Q is used for one thing only: to build up buildinf.h
421 CPPFLAGS_Q={- $cppflags1 =~ s|([\\"])|\\$1|g;
422 $cppflags2 =~ s|([\\"])|\\$1|g;
423 $lib_cppflags =~ s|([\\"])|\\$1|g;
424 join(' ', $lib_cppflags || (), $cppflags2 || (),
427 PERLASM_SCHEME= {- $target{perlasm_scheme} -}
429 # For x86 assembler: Set PROCESSOR to 386 if you want to support
431 PROCESSOR= {- $config{processor} -}
433 # We want error [and other] messages in English. Trouble is that make(1)
434 # doesn't pass macros down as environment variables unless there already
435 # was corresponding variable originally set. In other words we can only
436 # reassign environment variables, but not set new ones, not in portable
437 # manner that is. That's why we reassign several, just to be sure...
442 # The main targets ###################################################
444 {- dependmagic('build_sw'); -}: build_libs_nodep build_modules_nodep build_programs_nodep link-utils
445 {- dependmagic('build_libs'); -}: build_libs_nodep
446 {- dependmagic('build_modules'); -}: build_modules_nodep
447 {- dependmagic('build_programs'); -}: build_programs_nodep
449 build_docs: build_man_docs build_html_docs
450 build_man_docs: $(MANDOCS1) $(MANDOCS3) $(MANDOCS5) $(MANDOCS7)
451 build_html_docs: $(HTMLDOCS1) $(HTMLDOCS3) $(HTMLDOCS5) $(HTMLDOCS7)
453 build_generated: $(GENERATED_MANDATORY)
454 build_libs_nodep: libcrypto.pc libssl.pc openssl.pc
455 build_modules_nodep: $(MODULES)
456 build_programs_nodep: $(PROGRAMS) $(SCRIPTS)
458 # Kept around for backward compatibility
459 build_apps build_tests: build_programs
461 # Convenience target to prebuild all generated files, not just the mandatory
463 build_all_generated: $(GENERATED_MANDATORY) $(GENERATED) build_docs
464 @ : {- output_off() if $disabled{makedepend}; "" -}
465 @echo "Warning: consider configuring with no-makedepend, because if"
466 @echo " target system doesn't have $(PERL),"
467 @echo " then make will fail..."
468 @ : {- output_on() if $disabled{makedepend}; "" -}
470 all: build_sw build_docs
473 {- dependmagic('tests'); -}: build_programs_nodep build_modules_nodep link-utils
474 @ : {- output_off() if $disabled{tests}; "" -}
478 EXE_EXT={- platform->binext() -} \
479 $(PERL) $(SRCDIR)/test/run_tests.pl $(TESTS) )
480 @ : {- if ($disabled{tests}) { output_on(); } else { output_off(); } "" -}
481 @echo "Tests are not supported with your chosen Configure options"
482 @ : {- output_on() if !$disabled{tests}; "" -}
485 @ : {- output_off() if $disabled{tests}; "" -}
486 @SRCTOP="$(SRCDIR)" \
487 $(PERL) $(SRCDIR)/test/run_tests.pl list
488 @ : {- if ($disabled{tests}) { output_on(); } else { output_off(); } "" -}
489 @echo "Tests are not supported with your chosen Configure options"
490 @ : {- output_on() if !$disabled{tests}; "" -}
492 install: install_sw install_ssldirs install_docs
494 uninstall: uninstall_docs uninstall_sw
497 @set -e; for s in $(SHLIB_INFO); do \
498 if [ "$$s" = ";" ]; then continue; fi; \
499 s1=`echo "$$s" | cut -f1 -d";"`; \
500 s2=`echo "$$s" | cut -f2 -d";"`; \
501 $(ECHO) $(RM) $$s1; {- output_off() unless windowsdll(); "" -}\
504 $(RM) fuzz/$$s1; {- output_on() unless windowsdll(); "" -}\
506 if [ "$$s1" != "$$s2" ]; then \
507 $(ECHO) $(RM) $$s2; \
512 $(RM) *{- platform->defext() -}
515 $(RM) $(HTMLDOCS1) $(HTMLDOCS3) $(HTMLDOCS5) $(HTMLDOCS7)
516 $(RM) $(MANDOCS1) $(MANDOCS3) $(MANDOCS5) $(MANDOCS7)
517 $(RM) $(PROGRAMS) $(TESTPROGS) $(MODULES) $(SCRIPTS)
518 $(RM) $(GENERATED_MANDATORY) $(GENERATED)
519 -$(RM) `find . -name '*{- platform->depext() -}' \! -name '.*' \! -type d -print`
520 -$(RM) `find . -name '*{- platform->objext() -}' \! -name '.*' \! -type d -print`
522 $(RM) tags TAGS doc-nits cmd-nits
523 $(RM) -r test/test-runs
524 $(RM) openssl.pc libcrypto.pc libssl.pc
525 -$(RM) `find . -type l \! -name '.*' -print`
532 # We check if any depfile is newer than Makefile and decide to
533 # concatenate only if that is true.
535 @: {- output_off() if $disabled{makedepend}; "" -}
536 @$(PERL) $(SRCDIR)/util/add-depends.pl {-
537 defined $makedepprog && $makedepprog =~ /\/makedepend/
538 ? 'makedepend' : 'gcc' -}
539 @: {- output_on() if $disabled{makedepend}; "" -}
541 # Install helper targets #############################################
543 install_sw: install_dev install_engines install_modules install_runtime
545 uninstall_sw: uninstall_runtime uninstall_modules uninstall_engines uninstall_dev
547 install_docs: install_man_docs install_html_docs
549 uninstall_docs: uninstall_man_docs uninstall_html_docs
550 $(RM) -r $(DESTDIR)$(DOCDIR)
553 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(OPENSSLDIR)/certs
554 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(OPENSSLDIR)/private
555 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(OPENSSLDIR)/misc
556 @set -e; for x in dummy $(MISC_SCRIPTS); do \
557 if [ "$$x" = "dummy" ]; then continue; fi; \
558 x1=`echo "$$x" | cut -f1 -d:`; \
559 x2=`echo "$$x" | cut -f2 -d:`; \
560 fn=`basename $$x1`; \
561 $(ECHO) "install $$x1 -> $(DESTDIR)$(OPENSSLDIR)/misc/$$fn"; \
562 cp $$x1 $(DESTDIR)$(OPENSSLDIR)/misc/$$fn.new; \
563 chmod 755 $(DESTDIR)$(OPENSSLDIR)/misc/$$fn.new; \
564 mv -f $(DESTDIR)$(OPENSSLDIR)/misc/$$fn.new \
565 $(DESTDIR)$(OPENSSLDIR)/misc/$$fn; \
566 if [ "$$x1" != "$$x2" ]; then \
567 ln=`basename "$$x2"`; \
568 : {- output_off() unless windowsdll(); "" -}; \
569 $(ECHO) "copy $(DESTDIR)$(OPENSSLDIR)/misc/$$ln -> $(DESTDIR)$(OPENSSLDIR)/misc/$$fn"; \
570 cp $(DESTDIR)$(OPENSSLDIR)/misc/$$fn $(DESTDIR)$(OPENSSLDIR)/misc/$$ln; \
571 : {- output_on() unless windowsdll();
572 output_off() if windowsdll(); "" -}; \
573 $(ECHO) "link $(DESTDIR)$(OPENSSLDIR)/misc/$$ln -> $(DESTDIR)$(OPENSSLDIR)/misc/$$fn"; \
574 ln -sf $$fn $(DESTDIR)$(OPENSSLDIR)/misc/$$ln; \
575 : {- output_on() if windowsdll(); "" -}; \
578 @$(ECHO) "install $(SRCDIR)/apps/openssl.cnf -> $(DESTDIR)$(OPENSSLDIR)/openssl.cnf.dist"
579 @cp $(SRCDIR)/apps/openssl.cnf $(DESTDIR)$(OPENSSLDIR)/openssl.cnf.new
580 @chmod 644 $(DESTDIR)$(OPENSSLDIR)/openssl.cnf.new
581 @mv -f $(DESTDIR)$(OPENSSLDIR)/openssl.cnf.new $(DESTDIR)$(OPENSSLDIR)/openssl.cnf.dist
582 @if [ ! -f "$(DESTDIR)$(OPENSSLDIR)/openssl.cnf" ]; then \
583 $(ECHO) "install $(SRCDIR)/apps/openssl.cnf -> $(DESTDIR)$(OPENSSLDIR)/openssl.cnf"; \
584 cp $(SRCDIR)/apps/openssl.cnf $(DESTDIR)$(OPENSSLDIR)/openssl.cnf; \
585 chmod 644 $(DESTDIR)$(OPENSSLDIR)/openssl.cnf; \
587 @$(ECHO) "install $(SRCDIR)/apps/ct_log_list.cnf -> $(DESTDIR)$(OPENSSLDIR)/ct_log_list.cnf.dist"
588 @cp $(SRCDIR)/apps/ct_log_list.cnf $(DESTDIR)$(OPENSSLDIR)/ct_log_list.cnf.new
589 @chmod 644 $(DESTDIR)$(OPENSSLDIR)/ct_log_list.cnf.new
590 @mv -f $(DESTDIR)$(OPENSSLDIR)/ct_log_list.cnf.new $(DESTDIR)$(OPENSSLDIR)/ct_log_list.cnf.dist
591 @if [ ! -f "$(DESTDIR)$(OPENSSLDIR)/ct_log_list.cnf" ]; then \
592 $(ECHO) "install $(SRCDIR)/apps/ct_log_list.cnf -> $(DESTDIR)$(OPENSSLDIR)/ct_log_list.cnf"; \
593 cp $(SRCDIR)/apps/ct_log_list.cnf $(DESTDIR)$(OPENSSLDIR)/ct_log_list.cnf; \
594 chmod 644 $(DESTDIR)$(OPENSSLDIR)/ct_log_list.cnf; \
597 install_dev: install_runtime_libs
598 @[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
599 @$(ECHO) "*** Installing development files"
600 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(INSTALLTOP)/include/openssl
601 @ : {- output_off() unless grep { $_ eq "OPENSSL_USE_APPLINK" } (@{$target{defines}}, @{$config{defines}}); "" -}
602 @$(ECHO) "install $(SRCDIR)/ms/applink.c -> $(DESTDIR)$(INSTALLTOP)/include/openssl/applink.c"
603 @cp $(SRCDIR)/ms/applink.c $(DESTDIR)$(INSTALLTOP)/include/openssl/applink.c
604 @chmod 644 $(DESTDIR)$(INSTALLTOP)/include/openssl/applink.c
605 @ : {- output_on() unless grep { $_ eq "OPENSSL_USE_APPLINK" } (@{$target{defines}}, @{$config{defines}}); "" -}
606 @set -e; for i in $(SRCDIR)/include/openssl/*.h \
607 $(BLDDIR)/include/openssl/*.h; do \
609 $(ECHO) "install $$i -> $(DESTDIR)$(INSTALLTOP)/include/openssl/$$fn"; \
610 cp $$i $(DESTDIR)$(INSTALLTOP)/include/openssl/$$fn; \
611 chmod 644 $(DESTDIR)$(INSTALLTOP)/include/openssl/$$fn; \
613 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(libdir)
614 @set -e; for l in $(INSTALL_LIBS); do \
616 $(ECHO) "install $$l -> $(DESTDIR)$(libdir)/$$fn"; \
617 cp $$l $(DESTDIR)$(libdir)/$$fn.new; \
618 $(RANLIB) $(DESTDIR)$(libdir)/$$fn.new; \
619 chmod 644 $(DESTDIR)$(libdir)/$$fn.new; \
620 mv -f $(DESTDIR)$(libdir)/$$fn.new \
621 $(DESTDIR)$(libdir)/$$fn; \
623 @ : {- output_off() if $disabled{shared}; "" -}
624 @set -e; for s in $(INSTALL_SHLIB_INFO); do \
625 s1=`echo "$$s" | cut -f1 -d";"`; \
626 s2=`echo "$$s" | cut -f2 -d";"`; \
627 fn1=`basename $$s1`; \
628 fn2=`basename $$s2`; \
629 : {- output_off(); output_on() unless windowsdll() or sharedaix(); "" -}; \
630 if [ "$$fn1" != "$$fn2" ]; then \
631 $(ECHO) "link $(DESTDIR)$(libdir)/$$fn2 -> $(DESTDIR)$(libdir)/$$fn1"; \
632 ln -sf $$fn1 $(DESTDIR)$(libdir)/$$fn2; \
634 : {- output_off() unless windowsdll() or sharedaix(); output_on() if windowsdll(); "" -}; \
635 $(ECHO) "install $$s2 -> $(DESTDIR)$(libdir)/$$fn2"; \
636 cp $$s2 $(DESTDIR)$(libdir)/$$fn2.new; \
637 chmod 755 $(DESTDIR)$(libdir)/$$fn2.new; \
638 mv -f $(DESTDIR)$(libdir)/$$fn2.new \
639 $(DESTDIR)$(libdir)/$$fn2; \
640 : {- output_off() if windowsdll(); output_on() if sharedaix(); "" -}; \
641 a=$(DESTDIR)$(libdir)/$$fn2; \
642 $(ECHO) "install $$s1 -> $$a"; \
643 if [ -f $$a ]; then ( trap "rm -rf /tmp/ar.$$$$" INT 0; \
644 mkdir /tmp/ar.$$$$; ( cd /tmp/ar.$$$$; \
646 for so in `$(AR) t $$a`; do \
649 strip -X32_64 -e $$so; \
650 $(AR) r $$a.new $$so; \
653 $(AR) r $$a.new $$s1; \
655 : {- output_off() if sharedaix(); output_on(); "" -}; \
657 @ : {- output_on() if $disabled{shared}; "" -}
658 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(libdir)/pkgconfig
659 @$(ECHO) "install libcrypto.pc -> $(DESTDIR)$(libdir)/pkgconfig/libcrypto.pc"
660 @cp libcrypto.pc $(DESTDIR)$(libdir)/pkgconfig
661 @chmod 644 $(DESTDIR)$(libdir)/pkgconfig/libcrypto.pc
662 @$(ECHO) "install libssl.pc -> $(DESTDIR)$(libdir)/pkgconfig/libssl.pc"
663 @cp libssl.pc $(DESTDIR)$(libdir)/pkgconfig
664 @chmod 644 $(DESTDIR)$(libdir)/pkgconfig/libssl.pc
665 @$(ECHO) "install openssl.pc -> $(DESTDIR)$(libdir)/pkgconfig/openssl.pc"
666 @cp openssl.pc $(DESTDIR)$(libdir)/pkgconfig
667 @chmod 644 $(DESTDIR)$(libdir)/pkgconfig/openssl.pc
669 uninstall_dev: uninstall_runtime_libs
670 @$(ECHO) "*** Uninstalling development files"
671 @ : {- output_off() unless grep { $_ eq "OPENSSL_USE_APPLINK" } (@{$target{defines}}, @{$config{defines}}); "" -}
672 @$(ECHO) "$(RM) $(DESTDIR)$(INSTALLTOP)/include/openssl/applink.c"
673 @$(RM) $(DESTDIR)$(INSTALLTOP)/include/openssl/applink.c
674 @ : {- output_on() unless grep { $_ eq "OPENSSL_USE_APPLINK" } (@{$target{defines}}, @{$config{defines}}); "" -}
675 @set -e; for i in $(SRCDIR)/include/openssl/*.h \
676 $(BLDDIR)/include/openssl/*.h; do \
678 $(ECHO) "$(RM) $(DESTDIR)$(INSTALLTOP)/include/openssl/$$fn"; \
679 $(RM) $(DESTDIR)$(INSTALLTOP)/include/openssl/$$fn; \
681 -$(RMDIR) $(DESTDIR)$(INSTALLTOP)/include/openssl
682 -$(RMDIR) $(DESTDIR)$(INSTALLTOP)/include
683 @set -e; for l in $(INSTALL_LIBS); do \
685 $(ECHO) "$(RM) $(DESTDIR)$(libdir)/$$fn"; \
686 $(RM) $(DESTDIR)$(libdir)/$$fn; \
688 @ : {- output_off() if $disabled{shared}; "" -}
689 @set -e; for s in $(INSTALL_SHLIB_INFO); do \
690 s1=`echo "$$s" | cut -f1 -d";"`; \
691 s2=`echo "$$s" | cut -f2 -d";"`; \
692 fn1=`basename $$s1`; \
693 fn2=`basename $$s2`; \
694 : {- output_off() if windowsdll(); "" -}; \
695 $(ECHO) "$(RM) $(DESTDIR)$(libdir)/$$fn2"; \
696 $(RM) $(DESTDIR)$(libdir)/$$fn2; \
697 if [ "$$fn1" != "$$fn2" -a -f "$(DESTDIR)$(libdir)/$$fn1" ]; then \
698 $(ECHO) "$(RM) $(DESTDIR)$(libdir)/$$fn1"; \
699 $(RM) $(DESTDIR)$(libdir)/$$fn1; \
701 : {- output_on() if windowsdll(); "" -}{- output_off() unless windowsdll(); "" -}; \
702 $(ECHO) "$(RM) $(DESTDIR)$(libdir)/$$fn2"; \
703 $(RM) $(DESTDIR)$(libdir)/$$fn2; \
704 : {- output_on() unless windowsdll(); "" -}; \
706 @ : {- output_on() if $disabled{shared}; "" -}
707 $(RM) $(DESTDIR)$(libdir)/pkgconfig/libcrypto.pc
708 $(RM) $(DESTDIR)$(libdir)/pkgconfig/libssl.pc
709 $(RM) $(DESTDIR)$(libdir)/pkgconfig/openssl.pc
710 -$(RMDIR) $(DESTDIR)$(libdir)/pkgconfig
711 -$(RMDIR) $(DESTDIR)$(libdir)
713 _install_modules_deps: install_runtime_libs build_modules
715 install_engines: _install_modules_deps
716 @[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
717 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(ENGINESDIR)/
718 @$(ECHO) "*** Installing engines"
719 @set -e; for e in dummy $(INSTALL_ENGINES); do \
720 if [ "$$e" = "dummy" ]; then continue; fi; \
722 $(ECHO) "install $$e -> $(DESTDIR)$(ENGINESDIR)/$$fn"; \
723 cp $$e $(DESTDIR)$(ENGINESDIR)/$$fn.new; \
724 chmod 755 $(DESTDIR)$(ENGINESDIR)/$$fn.new; \
725 mv -f $(DESTDIR)$(ENGINESDIR)/$$fn.new \
726 $(DESTDIR)$(ENGINESDIR)/$$fn; \
730 @$(ECHO) "*** Uninstalling engines"
731 @set -e; for e in dummy $(INSTALL_ENGINES); do \
732 if [ "$$e" = "dummy" ]; then continue; fi; \
734 if [ "$$fn" = '{- platform->dso("ossltest") -}' ]; then \
737 $(ECHO) "$(RM) $(DESTDIR)$(ENGINESDIR)/$$fn"; \
738 $(RM) $(DESTDIR)$(ENGINESDIR)/$$fn; \
740 -$(RMDIR) $(DESTDIR)$(ENGINESDIR)
742 install_modules: _install_modules_deps
743 @[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
744 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(MODULESDIR)/
745 @$(ECHO) "*** Installing modules"
746 @set -e; for e in dummy $(INSTALL_MODULES); do \
747 if [ "$$e" = "dummy" ]; then continue; fi; \
749 $(ECHO) "install $$e -> $(DESTDIR)$(MODULESDIR)/$$fn"; \
750 cp $$e $(DESTDIR)$(MODULESDIR)/$$fn.new; \
751 chmod 755 $(DESTDIR)$(MODULESDIR)/$$fn.new; \
752 mv -f $(DESTDIR)$(MODULESDIR)/$$fn.new \
753 $(DESTDIR)$(MODULESDIR)/$$fn; \
757 @$(ECHO) "*** Uninstalling modules"
758 @set -e; for e in dummy $(INSTALL_MODULES); do \
759 if [ "$$e" = "dummy" ]; then continue; fi; \
761 if [ "$$fn" = '{- platform->dso("ossltest") -}' ]; then \
764 $(ECHO) "$(RM) $(DESTDIR)$(MODULESDIR)/$$fn"; \
765 $(RM) $(DESTDIR)$(MODULESDIR)/$$fn; \
767 -$(RMDIR) $(DESTDIR)$(MODULESDIR)
769 install_runtime: install_programs
771 install_runtime_libs: build_libs
772 @[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
773 @ : {- output_off() if windowsdll(); "" -}
774 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(libdir)
775 @ : {- output_on() if windowsdll(); output_off() unless windowsdll(); "" -}
776 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(INSTALLTOP)/bin
777 @ : {- output_on() unless windowsdll(); "" -}
778 @$(ECHO) "*** Installing runtime libraries"
779 @set -e; for s in dummy $(INSTALL_SHLIBS); do \
780 if [ "$$s" = "dummy" ]; then continue; fi; \
782 : {- output_off() unless windowsdll(); "" -}; \
783 $(ECHO) "install $$s -> $(DESTDIR)$(INSTALLTOP)/bin/$$fn"; \
784 cp $$s $(DESTDIR)$(INSTALLTOP)/bin/$$fn.new; \
785 chmod 755 $(DESTDIR)$(INSTALLTOP)/bin/$$fn.new; \
786 mv -f $(DESTDIR)$(INSTALLTOP)/bin/$$fn.new \
787 $(DESTDIR)$(INSTALLTOP)/bin/$$fn; \
788 : {- output_on() unless windowsdll(); "" -}{- output_off() if windowsdll(); "" -}; \
789 $(ECHO) "install $$s -> $(DESTDIR)$(libdir)/$$fn"; \
790 cp $$s $(DESTDIR)$(libdir)/$$fn.new; \
791 chmod 755 $(DESTDIR)$(libdir)/$$fn.new; \
792 mv -f $(DESTDIR)$(libdir)/$$fn.new \
793 $(DESTDIR)$(libdir)/$$fn; \
794 : {- output_on() if windowsdll(); "" -}; \
797 install_programs: install_runtime_libs build_programs
798 @[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
799 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(INSTALLTOP)/bin
800 @$(ECHO) "*** Installing runtime programs"
801 @set -e; for x in dummy $(INSTALL_PROGRAMS); do \
802 if [ "$$x" = "dummy" ]; then continue; fi; \
804 $(ECHO) "install $$x -> $(DESTDIR)$(INSTALLTOP)/bin/$$fn"; \
805 cp $$x $(DESTDIR)$(INSTALLTOP)/bin/$$fn.new; \
806 chmod 755 $(DESTDIR)$(INSTALLTOP)/bin/$$fn.new; \
807 mv -f $(DESTDIR)$(INSTALLTOP)/bin/$$fn.new \
808 $(DESTDIR)$(INSTALLTOP)/bin/$$fn; \
810 @set -e; for x in dummy $(BIN_SCRIPTS); do \
811 if [ "$$x" = "dummy" ]; then continue; fi; \
813 $(ECHO) "install $$x -> $(DESTDIR)$(INSTALLTOP)/bin/$$fn"; \
814 cp $$x $(DESTDIR)$(INSTALLTOP)/bin/$$fn.new; \
815 chmod 755 $(DESTDIR)$(INSTALLTOP)/bin/$$fn.new; \
816 mv -f $(DESTDIR)$(INSTALLTOP)/bin/$$fn.new \
817 $(DESTDIR)$(INSTALLTOP)/bin/$$fn; \
820 uninstall_runtime: uninstall_programs uninstall_runtime_libs
823 @$(ECHO) "*** Uninstalling runtime programs"
824 @set -e; for x in dummy $(INSTALL_PROGRAMS); \
826 if [ "$$x" = "dummy" ]; then continue; fi; \
828 $(ECHO) "$(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$fn"; \
829 $(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$fn; \
831 @set -e; for x in dummy $(BIN_SCRIPTS); \
833 if [ "$$x" = "dummy" ]; then continue; fi; \
835 $(ECHO) "$(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$fn"; \
836 $(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$fn; \
838 -$(RMDIR) $(DESTDIR)$(INSTALLTOP)/bin
840 uninstall_runtime_libs:
841 @$(ECHO) "*** Uninstalling runtime libraries"
842 @ : {- output_off() unless windowsdll(); "" -}
843 @set -e; for s in dummy $(INSTALL_SHLIBS); do \
844 if [ "$$s" = "dummy" ]; then continue; fi; \
846 $(ECHO) "$(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$fn"; \
847 $(RM) $(DESTDIR)$(INSTALLTOP)/bin/$$fn; \
849 @ : {- output_on() unless windowsdll(); "" -}
852 install_man_docs: build_man_docs
853 @[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
854 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(MANDIR)/man1
855 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(MANDIR)/man3
856 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(MANDIR)/man5
857 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(MANDIR)/man7
858 @$(ECHO) "*** Installing manpages"
859 @set -e; for x in dummy $(MANDOCS1); do \
860 if [ "$$x" = "dummy" ]; then continue; fi; \
862 $(ECHO) "install $$x -> $(DESTDIR)$(MANDIR)/man1/$$fn"; \
863 cp $$x $(DESTDIR)$(MANDIR)/man1/$$fn$(MANSUFFIX); \
864 chmod 755 $(DESTDIR)$(MANDIR)/man1/$$fn$(MANSUFFIX); \
866 @set -e; for x in dummy $(MANDOCS3); do \
867 if [ "$$x" = "dummy" ]; then continue; fi; \
869 $(ECHO) "install $$x -> $(DESTDIR)$(MANDIR)/man3/$$fn"; \
870 cp $$x $(DESTDIR)$(MANDIR)/man3/$$fn$(MANSUFFIX); \
871 chmod 755 $(DESTDIR)$(MANDIR)/man3/$$fn$(MANSUFFIX); \
873 @set -e; for x in dummy $(MANDOCS5); do \
874 if [ "$$x" = "dummy" ]; then continue; fi; \
876 $(ECHO) "install $$x -> $(DESTDIR)$(MANDIR)/man5/$$fn"; \
877 cp $$x $(DESTDIR)$(MANDIR)/man5/$$fn$(MANSUFFIX); \
878 chmod 755 $(DESTDIR)$(MANDIR)/man5/$$fn$(MANSUFFIX); \
880 @set -e; for x in dummy $(MANDOCS7); do \
881 if [ "$$x" = "dummy" ]; then continue; fi; \
883 $(ECHO) "install $$x -> $(DESTDIR)$(MANDIR)/man7/$$fn"; \
884 cp $$x $(DESTDIR)$(MANDIR)/man7/$$fn$(MANSUFFIX); \
885 chmod 755 $(DESTDIR)$(MANDIR)/man7/$$fn$(MANSUFFIX); \
889 @$(ECHO) "*** Uninstalling manpages"
890 @set -e; for x in dummy $(MANDOCS1); do \
891 if [ "$$x" = "dummy" ]; then continue; fi; \
893 $(ECHO) "$(RM) $(DESTDIR)$(MANDIR)/man1/$$fn"; \
894 $(RM) $(DESTDIR)$(MANDIR)/man1/$$fn$(MANSUFFIX); \
896 @set -e; for x in dummy $(MANDOCS3); do \
897 if [ "$$x" = "dummy" ]; then continue; fi; \
899 $(ECHO) "$(RM) $(DESTDIR)$(MANDIR)/man3/$$fn"; \
900 $(RM) $(DESTDIR)$(MANDIR)/man3/$$fn$(MANSUFFIX); \
902 @set -e; for x in dummy $(MANDOCS5); do \
903 if [ "$$x" = "dummy" ]; then continue; fi; \
905 $(ECHO) "$(RM) $(DESTDIR)$(MANDIR)/man5/$$fn"; \
906 $(RM) $(DESTDIR)$(MANDIR)/man5/$$fn$(MANSUFFIX); \
908 @set -e; for x in dummy $(MANDOCS7); do \
909 if [ "$$x" = "dummy" ]; then continue; fi; \
911 $(ECHO) "$(RM) $(DESTDIR)$(MANDIR)/man7/$$fn"; \
912 $(RM) $(DESTDIR)$(MANDIR)/man7/$$fn$(MANSUFFIX); \
915 install_html_docs: build_html_docs
916 @[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
917 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(HTMLDIR)/man1
918 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(HTMLDIR)/man3
919 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(HTMLDIR)/man5
920 @$(PERL) $(SRCDIR)/util/mkdir-p.pl $(DESTDIR)$(HTMLDIR)/man7
921 @$(ECHO) "*** Installing HTML manpages"
922 @set -e; for x in dummy $(HTMLDOCS1); do \
923 if [ "$$x" = "dummy" ]; then continue; fi; \
925 $(ECHO) "install $$x -> $(DESTDIR)$(HTMLDIR)/man1/$$fn"; \
926 cp $$x $(DESTDIR)$(HTMLDIR)/man1/$$fn; \
927 chmod 755 $(DESTDIR)$(HTMLDIR)/man1/$$fn; \
929 @set -e; for x in dummy $(HTMLDOCS3); do \
930 if [ "$$x" = "dummy" ]; then continue; fi; \
932 $(ECHO) "install $$x -> $(DESTDIR)$(HTMLDIR)/man3/$$fn"; \
933 cp $$x $(DESTDIR)$(HTMLDIR)/man3/$$fn; \
934 chmod 755 $(DESTDIR)$(HTMLDIR)/man3/$$fn; \
936 @set -e; for x in dummy $(HTMLDOCS5); do \
937 if [ "$$x" = "dummy" ]; then continue; fi; \
939 $(ECHO) "install $$x -> $(DESTDIR)$(HTMLDIR)/man5/$$fn"; \
940 cp $$x $(DESTDIR)$(HTMLDIR)/man5/$$fn; \
941 chmod 755 $(DESTDIR)$(HTMLDIR)/man5/$$fn; \
943 @set -e; for x in dummy $(HTMLDOCS7); do \
944 if [ "$$x" = "dummy" ]; then continue; fi; \
946 $(ECHO) "install $$x -> $(DESTDIR)$(HTMLDIR)/man7/$$fn"; \
947 cp $$x $(DESTDIR)$(HTMLDIR)/man7/$$fn; \
948 chmod 755 $(DESTDIR)$(HTMLDIR)/man7/$$fn; \
952 @$(ECHO) "*** Uninstalling HTML manpages"
953 @set -e; for x in dummy $(HTMLDOCS1); do \
954 if [ "$$x" = "dummy" ]; then continue; fi; \
956 $(ECHO) "$(RM) $(DESTDIR)$(HTMLDIR)/man1/$$fn"; \
957 $(RM) $(DESTDIR)$(HTMLDIR)/man1/$$fn; \
959 @set -e; for x in dummy $(HTMLDOCS3); do \
960 if [ "$$x" = "dummy" ]; then continue; fi; \
962 $(ECHO) "$(RM) $(DESTDIR)$(HTMLDIR)/man3/$$fn"; \
963 $(RM) $(DESTDIR)$(HTMLDIR)/man3/$$fn; \
965 @set -e; for x in dummy $(HTMLDOCS5); do \
966 if [ "$$x" = "dummy" ]; then continue; fi; \
968 $(ECHO) "$(RM) $(DESTDIR)$(HTMLDIR)/man5/$$fn"; \
969 $(RM) $(DESTDIR)$(HTMLDIR)/man5/$$fn; \
971 @set -e; for x in dummy $(HTMLDOCS7); do \
972 if [ "$$x" = "dummy" ]; then continue; fi; \
974 $(ECHO) "$(RM) $(DESTDIR)$(HTMLDIR)/man7/$$fn"; \
975 $(RM) $(DESTDIR)$(HTMLDIR)/man7/$$fn; \
978 # Developer targets (note: these are only available on Unix) #########
980 update: generate errors ordinals
982 generate: generate_apps generate_crypto_bn generate_crypto_objects \
983 generate_crypto_conf generate_crypto_asn1 generate_fuzz_oids
985 .PHONY: doc-nits cmd-nits
986 doc-nits: build_generated
987 $(PERL) $(SRCDIR)/util/find-doc-nits -n -l -e
989 cmd-nits: build_generated apps/openssl
990 $(PERL) $(SRCDIR)/util/find-doc-nits -c
992 # Test coverage is a good idea for the future
993 #coverage: $(PROGRAMS) $(TESTPROGRAMS)
997 lint -DLINT $(INCLUDES) $(SRCS)
1000 ( cd $(SRCDIR); $(PERL) VMS/VMSify-conf.pl \
1001 < apps/openssl.cnf > apps/openssl-vms.cnf )
1004 ( cd $(SRCDIR); $(PERL) crypto/bn/bn_prime.pl > crypto/bn/bn_prime.h )
1006 generate_crypto_objects:
1007 ( cd $(SRCDIR); $(PERL) crypto/objects/objects.pl -n \
1008 crypto/objects/objects.txt \
1009 crypto/objects/obj_mac.num \
1010 > crypto/objects/obj_mac.new && \
1011 mv crypto/objects/obj_mac.new crypto/objects/obj_mac.num )
1012 ( cd $(SRCDIR); $(PERL) crypto/objects/objects.pl \
1013 crypto/objects/objects.txt \
1014 crypto/objects/obj_mac.num \
1015 > include/openssl/obj_mac.h )
1016 ( cd $(SRCDIR); $(PERL) crypto/objects/obj_dat.pl \
1017 include/openssl/obj_mac.h \
1018 > crypto/objects/obj_dat.h )
1019 ( cd $(SRCDIR); $(PERL) crypto/objects/objxref.pl \
1020 crypto/objects/obj_mac.num \
1021 crypto/objects/obj_xref.txt \
1022 > crypto/objects/obj_xref.h )
1023 ( cd $(SRCDIR); cat crypto/objects/obj_compat.h >> include/openssl/obj_mac.h )
1025 generate_crypto_conf:
1026 ( cd $(SRCDIR); $(PERL) crypto/conf/keysets.pl \
1027 > crypto/conf/conf_def.h )
1029 generate_crypto_asn1:
1030 ( cd $(SRCDIR); $(PERL) crypto/asn1/charmap.pl \
1031 > crypto/asn1/charmap.h )
1034 ( cd $(SRCDIR); $(PERL) fuzz/mkfuzzoids.pl \
1035 crypto/objects/obj_dat.h \
1038 # Set to -force to force a rebuild
1041 ( b=`pwd`; set -e; cd $(SRCDIR); \
1042 $(PERL) util/ck_errf.pl -strict -internal; \
1043 $(PERL) -I$$b util/mkerr.pl $(ERROR_REBUILD) -internal )
1044 ( b=`pwd`; set -e; cd $(SRCDIR)/engines; \
1045 for E in *.ec ; do \
1046 $(PERL) ../util/ck_errf.pl -strict \
1047 -conf $$E `basename $$E .ec`.c; \
1048 $(PERL) -I$$b ../util/mkerr.pl $(ERROR_REBUILD) -static \
1049 -conf $$E `basename $$E .ec`.c ; \
1052 {- use File::Basename;
1055 qw( include/openssl/ssl.h
1056 include/openssl/ssl2.h
1057 include/openssl/ssl3.h
1058 include/openssl/sslerr.h
1059 include/openssl/tls1.h
1060 include/openssl/dtls1.h
1061 include/openssl/srtp.h );
1062 our @cryptoheaders =
1063 qw( include/internal/dso.h
1064 include/internal/o_dir.h
1065 include/internal/err.h
1066 include/internal/evp.h
1067 include/internal/sslconf.h );
1068 our @cryptoskipheaders = ( @sslheaders,
1069 qw( include/openssl/conf_api.h
1070 include/openssl/ebcdic.h
1071 include/openssl/opensslconf.h
1072 include/openssl/symhacks.h ) );
1073 foreach my $f ( glob(catfile($config{sourcedir},
1074 'include','openssl','*.h')) ) {
1075 my $fn = "include/openssl/" . basename($f);
1076 push @cryptoheaders, $fn unless grep { $_ eq $fn } @cryptoskipheaders;
1080 CRYPTOHEADERS={- join(" \\\n" . ' ' x 14,
1081 fill_lines(" ", $COLUMNS - 14, sort @cryptoheaders)) -}
1082 SSLHEADERS={- join(" \\\n" . ' ' x 11,
1083 fill_lines(" ", $COLUMNS - 11, sort @sslheaders)) -}
1086 $(PERL) util/mknum.pl --version $(VERSION) --no-warnings \
1087 --ordinals util/libcrypto.num \
1088 --symhacks include/openssl/symhacks.h \
1091 $(PERL) util/mknum.pl --version $(VERSION) --no-warnings \
1092 --ordinals util/libssl.num \
1093 --symhacks include/openssl/symhacks.h \
1098 SRCTOP=../$(SRCDIR) \
1099 BLDTOP=../$(BLDDIR) \
1100 $(PERL) ../$(SRCDIR)/test/run_tests.pl test_ordinals )
1105 -etags `find . -name '*.[ch]' -o -name '*.pm'`
1107 # Release targets (note: only available on Unix) #####################
1110 (cd $(SRCDIR); ./util/mktar.sh --name='$(NAME)' --tarfile='$(TARFILE)')
1112 # Helper targets #####################################################
1114 link-utils: $(BLDDIR)/util/opensslwrap.sh $(BLDDIR)/util/wrap.pl
1116 $(BLDDIR)/util/opensslwrap.sh $(BLDDIR)/util/wrap.pl: configdata.pm
1117 @if [ "$(SRCDIR)" != "$(BLDDIR)" ]; then \
1118 mkdir -p "$(BLDDIR)/util"; \
1119 ln -sf "../$(SRCDIR)/util/`basename "$@"`" "$(BLDDIR)/util"; \
1124 # Building targets ###################################################
1126 libcrypto.pc libssl.pc openssl.pc: configdata.pm $(LIBS) {- join(" ",map { platform->sharedlib_simple($_) // () } @{$unified_info{libraries}}) -}
1128 @ ( echo 'prefix=$(INSTALLTOP)'; \
1129 echo 'exec_prefix=$${prefix}'; \
1130 if [ -n "$(LIBDIR)" ]; then \
1131 echo 'libdir=$${exec_prefix}/$(LIBDIR)'; \
1133 echo 'libdir=$(libdir)'; \
1135 echo 'includedir=$${prefix}/include'; \
1136 echo 'enginesdir=$${libdir}/engines-{- $sover_dirname -}'; \
1138 echo 'Name: OpenSSL-libcrypto'; \
1139 echo 'Description: OpenSSL cryptography library'; \
1140 echo 'Version: '$(VERSION); \
1141 echo 'Libs: -L$${libdir} -lcrypto'; \
1142 echo 'Libs.private: $(LIB_EX_LIBS)'; \
1143 echo 'Cflags: -I$${includedir}' ) > libcrypto.pc
1146 @ ( echo 'prefix=$(INSTALLTOP)'; \
1147 echo 'exec_prefix=$${prefix}'; \
1148 if [ -n "$(LIBDIR)" ]; then \
1149 echo 'libdir=$${exec_prefix}/$(LIBDIR)'; \
1151 echo 'libdir=$(libdir)'; \
1153 echo 'includedir=$${prefix}/include'; \
1155 echo 'Name: OpenSSL-libssl'; \
1156 echo 'Description: Secure Sockets Layer and cryptography libraries'; \
1157 echo 'Version: '$(VERSION); \
1158 echo 'Requires.private: libcrypto'; \
1159 echo 'Libs: -L$${libdir} -lssl'; \
1160 echo 'Cflags: -I$${includedir}' ) > libssl.pc
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'; \
1172 echo 'Name: OpenSSL'; \
1173 echo 'Description: Secure Sockets Layer and cryptography libraries and tools'; \
1174 echo 'Version: '$(VERSION); \
1175 echo 'Requires: libssl libcrypto' ) > openssl.pc
1177 configdata.pm: $(SRCDIR)/Configure $(SRCDIR)/config \
1178 {- join(" \\\n" . ' ' x 15,
1179 fill_lines(" ", $COLUMNS - 15,
1180 @{$config{build_file_templates}},
1181 @{$config{build_infos}},
1182 @{$config{conf_files}})) -}
1183 @echo "Detected changed: $?"
1184 $(PERL) configdata.pm -r
1185 @echo "**************************************************"
1187 @echo "*** Please run the same make command again ***"
1189 @echo "**************************************************"
1193 $(PERL) configdata.pm -r
1197 use File::Spec::Functions qw/:DEFAULT abs2rel rel2abs/;
1199 # Helper function to figure out dependencies on libraries
1200 # It takes a list of library names and outputs a list of dependencies
1201 sub compute_lib_depends {
1202 # Depending on shared libraries:
1203 # On Windows POSIX layers, we depend on {libname}.dll.a
1204 # On Unix platforms, we depend on {shlibname}.so
1205 return map { platform->sharedlib_simple($_) // platform->staticlib($_) } @_;
1210 my $generator = join(" ", @{$args{generator}});
1211 my $generator_incs = join("", map { " -I".$_ } @{$args{generator_incs}});
1212 my $incs = join("", map { " -I".$_ } @{$args{incs}});
1213 my $defs = join("", map { " -D".$_ } @{$args{defs}});
1214 my $deps = join(" ", @{$args{generator_deps}}, @{$args{deps}});
1216 if ($args{src} =~ /\.html$/) {
1217 my $title = basename($args{src}, ".html");
1218 my $pod = $args{generator}->[0];
1221 \$(PERL) \$(SRCDIR)/util/mkpod2html.pl -i "$pod" -o \$\@ -t "$title" -r "\$(SRCDIR)/doc"
1223 } elsif ($args{src} =~ /\.(\d)$/) {
1225 my $name = uc basename($args{src}, ".$section");
1226 my $pod = $args{generator}->[0];
1229 pod2man --name=$name --section=$section --center=OpenSSL \\
1230 --release=\$(VERSION) $pod >\$\@
1232 } elsif (platform->isdef($args{src})) {
1233 my $target = platform->def($args{src});
1234 (my $mkdef_os = $target{shared_target}) =~ s|-shared$||;
1235 my $ord_ver = $args{intent} eq 'lib' ? ' --version $(VERSION)' : '';
1236 my $ord_name = $args{generator}->[1] || $args{product};
1238 $target: $args{generator}->[0] $deps \$(SRCDIR)/util/mkdef.pl
1239 \$(PERL) \$(SRCDIR)/util/mkdef.pl$ord_ver --ordinals $args{generator}->[0] --name $ord_name --OS $mkdef_os > $target
1241 } elsif (!platform->isasm($args{src})) {
1242 if ($args{generator}->[0] =~ m|^.*\.in$|) {
1243 my $dofile = abs2rel(rel2abs(catfile($config{sourcedir},
1244 "util", "dofile.pl")),
1245 rel2abs($config{builddir}));
1246 my @modules = ( 'configdata.pm',
1247 grep { $_ =~ m|\.pm$| } @{$args{deps}} );
1248 my %moduleincs = map { '"-I'.dirname($_).'"' => 1 } @modules;
1249 @modules = map { "-M".basename($_, '.pm') } @modules;
1250 my $modules = join(' ', '', sort keys %moduleincs, @modules);
1252 $args{src}: $args{generator}->[0] $deps \$(BLDDIR)/configdata.pm
1253 \$(PERL)$modules "$dofile" "-o$target{build_file}" $generator > \$@
1257 $args{src}: $args{generator}->[0] $deps
1258 \$(PERL)$generator_incs $generator > \$@
1263 shlib => '$(LIB_CFLAGS) $(LIB_CPPFLAGS)',
1264 lib => '$(LIB_CFLAGS) $(LIB_CPPFLAGS)',
1265 dso => '$(DSO_CFLAGS) $(DSO_CPPFLAGS)',
1266 bin => '$(BIN_CFLAGS) $(BIN_CPPFLAGS)'
1267 } -> {$args{intent}};
1269 if ($args{generator}->[0] =~ /\.pl$/) {
1270 $generator = 'CC="$(CC)" $(PERL)'.$generator_incs.' '.$generator
1271 .' "$(PERLASM_SCHEME)"'.$incs.' '.$cppflags.$defs.' $(PROCESSOR)';
1272 } elsif ($args{generator}->[0] =~ /\.m4$/) {
1273 $generator = 'm4 -B 8192'.$generator_incs.' '.$generator.' >'
1274 } elsif ($args{generator}->[0] =~ /\.S$/) {
1277 die "Generator type for $args{src} unknown: $generator\n";
1280 if (defined($generator)) {
1282 $args{src}: $args{generator}->[0] $deps
1287 $args{src}: $args{generator}->[0] $deps
1288 \$(CC) $incs $cppflags $defs -E $args{generator}->[0] | \\
1289 \$(PERL) -ne '/^#(line)?\\s*[0-9]+/ or print' > \$@
1294 # Should one wonder about the end of the Perl snippet, it's because this
1295 # second regexp eats up line endings as well, if the removed path is the
1296 # last in the line. We may therefore need to put back a line ending.
1299 my $obj = platform->convertext($args{obj});
1300 my $dep = platform->dep($args{obj});
1301 my @srcs = @{$args{srcs}};
1302 my $srcs = join(" ", @srcs);
1303 my $deps = join(" ", @srcs, @{$args{deps}});
1304 my $incs = join("", map { " -I".$_ } @{$args{incs}});
1305 my $defs = join("", map { " -D".$_ } @{$args{defs}});
1309 if (grep /\.rc$/, @srcs) {
1311 $cmdflags = '$(RCFLAGS)';
1313 } elsif (grep /\.(cc|cpp)$/, @srcs) {
1315 $cmdcompile = ' -c';
1317 shlib => '$(LIB_CXXFLAGS) $(LIB_CPPFLAGS)',
1318 lib => '$(LIB_CXXFLAGS) $(LIB_CPPFLAGS)',
1319 dso => '$(DSO_CXXFLAGS) $(DSO_CPPFLAGS)',
1320 bin => '$(BIN_CXXFLAGS) $(BIN_CPPFLAGS)'
1321 } -> {$args{intent}};
1324 $cmdcompile = ' -c';
1326 shlib => '$(LIB_CFLAGS) $(LIB_CPPFLAGS)',
1327 lib => '$(LIB_CFLAGS) $(LIB_CPPFLAGS)',
1328 dso => '$(DSO_CFLAGS) $(DSO_CPPFLAGS)',
1329 bin => '$(BIN_CFLAGS) $(BIN_CPPFLAGS)'
1330 } -> {$args{intent}};
1333 # extension-specific rules
1334 if (grep /\.s$/, @srcs) {
1337 $cmd $cmdflags -c -o \$\@ $srcs
1339 } elsif (grep /\.S$/, @srcs) {
1340 # Originally there was mutli-step rule with $(CC) -E file.S
1341 # followed by $(CC) -c file.s. It compensated for one of
1342 # legacy platform compiler's inability to handle .S files.
1343 # The platform is long discontinued by vendor so there is
1344 # hardly a point to drag it along...
1347 $cmd $incs $defs $cmdflags -c -o \$\@ $srcs
1349 } elsif (defined $makedepprog && $makedepprog !~ /\/makedepend/
1350 && !grep /\.rc$/, @srcs) {
1353 $cmd $incs $defs $cmdflags -MMD -MF $dep.tmp -MT \$\@ -c -o \$\@ $srcs
1355 \@if cmp $dep.tmp $dep > /dev/null 2> /dev/null; then \\
1358 mv $dep.tmp $dep; \\
1364 $cmd $incs $defs $cmdflags $cmdcompile -o \$\@ $srcs
1366 if (defined $makedepprog && $makedepprog =~ /\/makedepend/) {
1368 \$(MAKEDEPEND) -f- -Y -- $incs $cmdflags -- $srcs 2>/dev/null \\
1375 # We *know* this routine is only called when we've configure 'shared'.
1380 foreach (@{$args{deps}}) {
1381 if (platform->isstaticlib($_)) {
1382 push @linklibs, platform->convertext($_);
1384 my $d = "-L" . dirname($_);
1385 my $l = basename($_);
1389 push @linkdirs, $d unless grep { $d eq $_ } @linkdirs;
1392 my $linkflags = join("", map { $_." " } @linkdirs);
1393 my $linklibs = join("", map { $_." " } @linklibs);
1394 my @objs = map { platform->convertext($_) }
1395 grep { !platform->isdef($_) }
1397 my @defs = map { platform->def($_) }
1398 grep { platform->isdef($_) }
1400 my @deps = compute_lib_depends(@{$args{deps}});
1401 die "More than one exported symbol map" if scalar @defs > 1;
1403 my $simple = platform->sharedlib_simple($args{lib});
1404 my $full = platform->sharedlib($args{lib});
1405 my $shared_soname = "";
1406 $shared_soname .= ' '.$target{shared_sonameflag}.basename($full)
1407 if defined $target{shared_sonameflag};
1408 my $shared_imp = "";
1409 $shared_imp .= ' '.$target{shared_impflag}.basename($simple)
1410 if defined $target{shared_impflag};
1411 my $shared_def = join("", map { ' '.$target{shared_defflag}.$_ } @defs);
1413 my $objs = join(" \\\n\t\t", fill_lines(' ', $COLUMNS - 16, @objs));
1414 my $deps = join(" \\\n" . ' ' x (length($full) + 2),
1415 fill_lines(' ', $COLUMNS - length($full) - 2,
1416 @objs, @defs, @deps));
1418 my $recipe = <<"EOF";
1424 \$(AR) r $simple $full
1426 } elsif ($simple ne $full) {
1434 \$(CC) \$(LIB_CFLAGS) $linkflags\$(LIB_LDFLAGS)$shared_soname$shared_imp \\
1435 -o $full$shared_def \\
1437 $linklibs \$(LIB_EX_LIBS)
1453 my $dso = platform->dso($args{module});
1456 foreach (@{$args{deps}}) {
1457 next unless defined $_;
1458 if (platform->isstaticlib($_)) {
1459 push @linklibs, platform->convertext($_);
1461 my $d = "-L" . dirname($_);
1462 my $l = basename($_);
1466 push @linkdirs, $d unless grep { $d eq $_ } @linkdirs;
1469 my $linkflags = join("", map { $_." " } @linkdirs);
1470 my $linklibs = join("", map { $_." " } @linklibs);
1471 my @objs = map { platform->convertext($_) }
1472 grep { !platform->isdef($_) }
1474 my @defs = map { platform->def($_) }
1475 grep { platform->isdef($_) }
1477 my @deps = compute_lib_depends(@{$args{deps}});
1478 my $shared_def = join("", map { ' '.$target{shared_defflag}.$_ } @defs);
1480 my $objs = join(" \\\n\t\t", fill_lines(' ', $COLUMNS - 16, @objs));
1481 my $deps = join(" \\\n" . ' ' x (length($dso) + 2),
1482 fill_lines(' ', $COLUMNS - length($dso) - 2,
1483 @objs, @defs, @deps));
1487 \$(CC) \$(DSO_CFLAGS) $linkflags\$(DSO_LDFLAGS) \\
1488 -o $dso$shared_def \\
1490 $linklibs\$(DSO_EX_LIBS)
1495 my $lib = platform->staticlib($args{lib});
1496 my @objs = map { platform->obj($_) } @{$args{objs}};
1497 my $objs = join(" \\\n" . ' ' x (length($lib) + 2),
1498 fill_lines(' ', $COLUMNS - length($lib) - 2, @objs));
1501 \$(AR) \$(ARFLAGS) \$\@ \$\?
1502 \$(RANLIB) \$\@ || echo Never mind.
1507 my $bin = platform->bin($args{bin});
1508 my @objs = map { platform->obj($_) } @{$args{objs}};
1509 my @deps = compute_lib_depends(@{$args{deps}});
1510 my $objs = join(" \\\n" . ' ' x (length($bin) + 2),
1511 fill_lines(' ', $COLUMNS - length($bin) - 2, @objs));
1514 foreach (@{$args{deps}}) {
1515 next unless defined $_;
1516 if (platform->isstaticlib($_)) {
1517 push @linklibs, platform->convertext($_);
1519 my $d = "-L" . dirname($_);
1520 my $l = basename($_);
1524 push @linkdirs, $d unless grep { $d eq $_ } @linkdirs;
1527 my $linkflags = join("", map { $_." " } @linkdirs);
1528 my $linklibs = join("", map { $_." " } @linklibs);
1530 my $cmdflags = '$(BIN_CFLAGS)';
1531 if (grep /_cc\.o$/, @{$args{objs}}) {
1533 $cmdflags = '$(BIN_CXXFLAGS)';
1536 my $objs = join(" \\\n\t\t", fill_lines(' ', $COLUMNS - 16, @objs));
1537 my $deps = join(" \\\n" . ' ' x (length($bin) + 2),
1538 fill_lines(' ', $COLUMNS - length($bin) - 2,
1544 \$\${LDCMD:-$cmd} $cmdflags $linkflags\$(BIN_LDFLAGS) \\
1547 $linklibs\$(BIN_EX_LIBS)
1552 my $script = $args{script};
1553 my $sources = join(" ", @{$args{sources}});
1554 my $dofile = abs2rel(rel2abs(catfile($config{sourcedir},
1555 "util", "dofile.pl")),
1556 rel2abs($config{builddir}));
1559 \$(PERL) "-I\$(BLDDIR)" -Mconfigdata "$dofile" \\
1560 "-o$target{build_file}" $sources > "$script"
1566 my $dir = $args{dir};
1567 my @deps = map { platform->convertext($_) } @{$args{deps}};
1569 my %extinfo = ( dso => platform->dsoext(),
1570 lib => platform->libext(),
1571 bin => platform->binext() );
1573 # We already have a 'test' target, and the top directory is just plain
1575 return if $dir eq "test" || $dir eq ".";
1577 foreach my $type (("dso", "lib", "bin", "script")) {
1578 next unless defined($unified_info{dirinfo}->{$dir}->{products}->{$type});
1579 # For lib object files, we could update the library. However, it
1580 # was decided that it's enough to build the directory local object
1581 # files, so we don't need to add any actions, and the dependencies
1582 # are already taken care of.
1583 if ($type ne "lib") {
1584 foreach my $prod (@{$unified_info{dirinfo}->{$dir}->{products}->{$type}}) {
1585 if (dirname($prod) eq $dir) {
1586 push @deps, $prod.$extinfo{$type};
1588 push @comments, "# No support to produce $type ".join(", ", @{$unified_info{dirinfo}->{$dir}->{products}->{$type}});
1594 my $target = "$dir $dir/";
1595 my $deps = join(" \\\n\t",
1596 fill_lines(' ', $COLUMNS - 8, @deps));
1597 my $comments = join("\n", "", @comments);
1603 "" # Important! This becomes part of the template result.