2 ## Makefile for OpenSSL
4 ## {- join("\n## ", @autowarntext) -}
6 our $objext = $target{obj_extension} || ".obj";
7 our $depext = $target{dep_extension} || ".d";
8 our $exeext = $target{exe_extension} || ".exe";
9 our $libext = $target{lib_extension} || ".lib";
10 our $shlibext = $target{shared_extension} || ".dll";
11 our $shlibextimport = $target{shared_import_extension} || ".lib";
12 our $dsoext = $target{dso_extension} || ".dll";
14 our $sover = $config{shlib_major}."_".$config{shlib_minor};
17 $target{build_scheme}->[2] eq "VC-W32" ?
18 "ProgramFiles(x86)" : "ProgramW6432";
20 $target{build_scheme}->[2] eq "VC-W32"
21 ? "CommonProgramFiles(x86)" : "CommonProgramW6432";
22 our $win_installroot =
23 defined($ENV{$win_installenv})
24 ? $win_installenv : 'ProgramFiles';
26 defined($ENV{$win_commonenv})
27 ? $win_commonenv : 'CommonProgramFiles';
29 # expand variables early
30 $win_installroot = $ENV{$win_installroot};
31 $win_commonroot = $ENV{$win_commonroot};
34 return () if $disabled{shared};
36 return $unified_info{sharednames}->{$lib} . $shlibext;
40 return () if $disabled{shared};
42 return $lib . $shlibextimport;
48 return $dso . $dsoext;
50 # This makes sure things get built in the order they need
55 return "$target: build_generated\n\t\$(MAKE) depend && \$(MAKE) _$target\n_$target";
60 PLATFORM={- $config{target} -}
61 SRCDIR={- $config{sourcedir} -}
62 BLDDIR={- $config{builddir} -}
64 VERSION={- $config{version} -}
65 MAJOR={- $config{major} -}
66 MINOR={- $config{minor} -}
68 SHLIB_VERSION_NUMBER={- $config{shlib_version_number} -}
70 LIBS={- join(" ", map { $_.$libext } @{$unified_info{libraries}}) -}
71 SHLIBS={- join(" ", map { shlib($_) } @{$unified_info{libraries}}) -}
72 SHLIBPDBS={- join(" ", map { local $shlibext = ".pdb"; shlib($_) } @{$unified_info{libraries}}) -}
73 ENGINES={- join(" ", map { dso($_) } @{$unified_info{engines}}) -}
74 ENGINEPDBS={- join(" ", map { local $dsoext = ".pdb"; dso($_) } @{$unified_info{engines}}) -}
75 PROGRAMS={- our @PROGRAMS = map { $_.$exeext } @{$unified_info{programs}}; join(" ", @PROGRAMS) -}
76 PROGRAMPDBS={- join(" ", map { $_.".pdb" } @{$unified_info{programs}}) -}
77 SCRIPTS={- join(" ", @{$unified_info{scripts}}) -}
78 {- output_off() if $disabled{makedepend}; "" -}
79 DEPS={- join(" ", map { (my $x = $_) =~ s|\.o$|$depext|; $x; }
80 grep { $unified_info{sources}->{$_}->[0] =~ /\.c$/ }
81 keys %{$unified_info{sources}}); -}
82 {- output_on() if $disabled{makedepend}; "" -}
83 GENERATED_MANDATORY={- join(" ", @{$unified_info{depends}->{""}} ) -}
84 GENERATED={- join(" ",
85 ( map { (my $x = $_) =~ s|\.[sS]$|\.asm|; $x }
86 grep { defined $unified_info{generate}->{$_} }
87 map { @{$unified_info{sources}->{$_}} }
88 grep { /\.o$/ } keys %{$unified_info{sources}} ),
89 ( grep { /\.h$/ } keys %{$unified_info{generate}} )) -}
91 INSTALL_LIBS={- join(" ", map { $_.$libext } @{$unified_info{install}->{libraries}}) -}
92 INSTALL_SHLIBS={- join(" ", map { shlib($_) } @{$unified_info{install}->{libraries}}) -}
93 INSTALL_SHLIBPDBS={- join(" ", map { local $shlibext = ".pdb"; shlib($_) } @{$unified_info{install}->{libraries}}) -}
94 INSTALL_ENGINES={- join(" ", map { dso($_) } @{$unified_info{install}->{engines}}) -}
95 INSTALL_ENGINEPDBS={- join(" ", map { local $dsoext = ".pdb"; dso($_) } @{$unified_info{install}->{engines}}) -}
96 INSTALL_PROGRAMS={- join(" ", map { $_.$exeext } grep { !m|^test\\| } @{$unified_info{install}->{programs}}) -}
97 INSTALL_PROGRAMPDBS={- join(" ", map { $_.".pdb" } grep { !m|^test\\| } @{$unified_info{install}->{programs}}) -}
98 {- output_off() if $disabled{apps}; "" -}
99 BIN_SCRIPTS=$(BLDDIR)\tools\c_rehash.pl
100 MISC_SCRIPTS=$(BLDDIR)\apps\CA.pl $(BLDDIR)\apps\tsget.pl
101 {- output_on() if $disabled{apps}; "" -}
103 APPS_OPENSSL={- use File::Spec::Functions;
104 catfile("apps","openssl") -}
106 # Do not edit these manually. Use Configure with --prefix or --openssldir
107 # to change this! Short explanation in the top comment in Configure
108 INSTALLTOP_dev={- # $prefix is used in the OPENSSLDIR perl snippet
110 use File::Spec::Functions qw(:DEFAULT splitpath);
111 our $prefix = $config{prefix} || "$win_installroot\\OpenSSL";
112 our ($prefix_dev, $prefix_dir, $prefix_file) =
113 splitpath($prefix, 1);
115 INSTALLTOP_dir={- $prefix_dir -}
117 # The logic here is that if no --openssldir was given,
118 # OPENSSLDIR will get the value from $prefix plus "/ssl".
119 # If --openssldir was given and the value is an absolute
120 # path, OPENSSLDIR will get its value without change.
121 # If the value from --openssldir is a relative path,
122 # OPENSSLDIR will get $prefix with the --openssldir
123 # value appended as a subdirectory.
125 use File::Spec::Functions qw(:DEFAULT splitpath);
127 $config{openssldir} ?
128 (file_name_is_absolute($config{openssldir}) ?
130 : catdir($prefix, $config{openssldir}))
131 : "$win_commonroot\\SSL";
132 our ($openssldir_dev, $openssldir_dir, $openssldir_file) =
133 splitpath($openssldir, 1);
135 OPENSSLDIR_dir={- $openssldir_dir -}
136 LIBDIR={- our $libdir = $config{libdir} || "lib";
138 ENGINESDIR_dev={- use File::Spec::Functions qw(:DEFAULT splitpath);
139 our $enginesdir = catdir($prefix,$libdir,"engines-$sover");
140 our ($enginesdir_dev, $enginesdir_dir, $enginesdir_file) =
141 splitpath($enginesdir, 1);
143 ENGINESDIR_dir={- $enginesdir_dir -}
144 !IF "$(DESTDIR)" != ""
145 INSTALLTOP=$(DESTDIR)$(INSTALLTOP_dir)
146 OPENSSLDIR=$(DESTDIR)$(OPENSSLDIR_dir)
147 ENGINESDIR=$(DESTDIR)$(ENGINESDIR_dir)
149 INSTALLTOP=$(INSTALLTOP_dev)$(INSTALLTOP_dir)
150 OPENSSLDIR=$(OPENSSLDIR_dev)$(OPENSSLDIR_dir)
151 ENGINESDIR=$(ENGINESDIR_dev)$(ENGINESDIR_dir)
155 CFLAGS={- join(" ",(map { "-D".$_} @{$target{defines}}, @{$config{defines}})) -} {- join(" ", quotify_l("-DENGINESDIR=\"$enginesdir\"", "-DOPENSSLDIR=\"$openssldir\"")) -} {- $target{cflags} -} {- $config{cflags} -}
156 COUTFLAG={- $target{coutflag} || "/Fo" -}$(OSSL_EMPTY)
157 RC={- $target{rc} || "rc" -}
158 RCOUTFLAG={- $target{rcoutflag} || "/fo" -}$(OSSL_EMPTY)
159 LD={- $target{ld} || "link" -}
160 LDFLAGS={- $target{lflags} -}
161 LDOUTFLAG={- $target{loutflag} || "/out:" -}$(OSSL_EMPTY)
162 EX_LIBS={- $target{ex_libs} -}
163 LIB_CFLAGS={- join(" ", $target{lib_cflags}, $target{shared_cflag}) || "" -}
164 LIB_LDFLAGS={- $target{shared_ldflag} || "" -}
165 DSO_CFLAGS={- join(" ", $target{dso_cflags}, $target{shared_cflag}) || "" -}
166 DSO_LDFLAGS={- join(" ", $target{dso_lflags}, $target{shared_ldflag}) || "" -}
167 BIN_CFLAGS={- $target{bin_cflags} -}
168 BIN_LDFLAGS={- $target{bin_lflags} -}
170 PERL={- $config{perl} -}
173 ARFLAGS= {- $target{arflags} -}
174 AROUTFLAG={- $target{aroutflag} || "/out:" -}$(OSSL_EMPTY)
177 MTFLAGS= {- $target{mtflags} -}
178 MTINFLAG={- $target{mtinflag} || "-manifest " -}$(OSSL_EMPTY)
179 MTOUTFLAG={- $target{mtoutflag} || "-outputresource:" -}$(OSSL_EMPTY)
182 ASFLAGS={- $target{asflags} -}
183 ASOUTFLAG={- $target{asoutflag} -}$(OSSL_EMPTY)
184 PERLASM_SCHEME= {- $target{perlasm_scheme} -}
186 PROCESSOR= {- $config{processor} -}
188 # The main targets ###################################################
190 {- dependmagic('all'); -}: build_libs_nodep build_engines_nodep build_programs_nodep
191 {- dependmagic('build_libs'); -}: build_libs_nodep
192 {- dependmagic('build_engines'); -}: build_engines_nodep
193 {- dependmagic('build_programs'); -}: build_programs_nodep
195 build_generated: $(GENERATED_MANDATORY)
196 build_libs_nodep: $(LIBS) {- join(" ",map { shlib_import($_) } @{$unified_info{libraries}}) -}
197 build_engines_nodep: $(ENGINES)
198 build_programs_nodep: $(PROGRAMS) $(SCRIPTS)
200 # Kept around for backward compatibility
201 build_apps build_tests: build_programs
204 {- dependmagic('tests'); -}: build_programs_nodep build_engines_nodep
205 @rem {- output_off() if $disabled{tests}; "" -}
209 set OPENSSL_DEBUG_MEMORY=on
210 "$(PERL)" "$(SRCDIR)\test\run_tests.pl" $(TESTS)
211 @rem {- if ($disabled{tests}) { output_on(); } else { output_off(); } "" -}
212 @echo "Tests are not supported with your chosen Configure options"
213 @rem {- output_on() if !$disabled{tests}; "" -}
216 @rem {- output_off() if $disabled{tests}; "" -}
217 @set SRCTOP=$(SRCDIR)
218 @"$(PERL)" "$(SRCDIR)\test\run_tests.pl" list
219 @rem {- if ($disabled{tests}) { output_on(); } else { output_off(); } "" -}
220 @echo "Tests are not supported with your chosen Configure options"
221 @rem {- output_on() if !$disabled{tests}; "" -}
223 install: install_sw install_ssldirs install_docs
225 uninstall: uninstall_docs uninstall_sw
228 "$(PERL)" -e "map { m/(.*)\.dll$$/; unlink glob """$$1.*"""; } @ARGV" $(SHLIBS)
229 "$(PERL)" -e "map { m/(.*)\.dll$$/; unlink glob """apps/$$1.*"""; } @ARGV" $(SHLIBS)
230 "$(PERL)" -e "map { m/(.*)\.dll$$/; unlink glob """test/$$1.*"""; } @ARGV" $(SHLIBS)
232 -del /Q ossl_static.pdb
235 {- join("\n\t", map { "-del /Q /F $_" } @PROGRAMS) -}
236 -del /Q /F $(ENGINES)
237 -del /Q /F $(SCRIPTS)
238 -del /Q /F $(GENERATED)
243 -del /Q /S /F engines\*.ilk
244 -del /Q /S /F engines\*.lib
245 -del /Q /S /F apps\*.lib
246 -del /Q /S /F engines\*.manifest
247 -del /Q /S /F apps\*.manifest
248 -del /Q /S /F test\*.manifest
251 -del /Q /F configdata.pm
256 # Install helper targets #############################################
258 install_sw: all install_dev install_engines install_runtime
260 uninstall_sw: uninstall_runtime uninstall_engines uninstall_dev
262 install_docs: install_html_docs
264 uninstall_docs: uninstall_html_docs
267 @"$(PERL)" "$(SRCDIR)\util\mkdir-p.pl" "$(OPENSSLDIR)\certs"
268 @"$(PERL)" "$(SRCDIR)\util\mkdir-p.pl" "$(OPENSSLDIR)\private"
269 @"$(PERL)" "$(SRCDIR)\util\mkdir-p.pl" "$(OPENSSLDIR)\misc"
270 @"$(PERL)" "$(SRCDIR)\util\copy.pl" "$(SRCDIR)\apps\openssl.cnf" \
271 "$(OPENSSLDIR)\openssl.cnf.dist"
272 @IF NOT EXIST "$(OPENSSLDIR)\openssl.cnf" \
273 "$(PERL)" "$(SRCDIR)\util\copy.pl" "$(SRCDIR)\apps\openssl.cnf" \
274 "$(OPENSSLDIR)\openssl.cnf"
275 @"$(PERL)" "$(SRCDIR)\util\copy.pl" $(MISC_SCRIPTS) \
279 @if "$(INSTALLTOP)"=="" ( echo INSTALLTOP should not be empty & exit 1 )
280 @echo *** Installing development files
281 @"$(PERL)" "$(SRCDIR)\util\mkdir-p.pl" "$(INSTALLTOP)\include\openssl"
282 @rem {- output_off() unless grep { $_ eq "OPENSSL_USE_APPLINK" } @{$target{defines}}; "" -}
283 @"$(PERL)" "$(SRCDIR)\util\copy.pl" "$(SRCDIR)\ms\applink.c" \
284 "$(INSTALLTOP)\include\openssl"
285 @rem {- output_on() unless grep { $_ eq "OPENSSL_USE_APPLINK" } @{$target{defines}}; "" -}
286 @"$(PERL)" "$(SRCDIR)\util\copy.pl" "$(SRCDIR)\include\openssl\*.h" \
287 "$(INSTALLTOP)\include\openssl"
288 @"$(PERL)" "$(SRCDIR)\util\copy.pl" $(BLDDIR)\include\openssl\*.h \
289 "$(INSTALLTOP)\include\openssl"
290 @"$(PERL)" "$(SRCDIR)\util\mkdir-p.pl" "$(INSTALLTOP)\$(LIBDIR)"
291 @"$(PERL)" "$(SRCDIR)\util\copy.pl" $(INSTALL_LIBS) \
292 "$(INSTALLTOP)\$(LIBDIR)"
293 @if "$(SHLIBS)"=="" \
294 "$(PERL)" "$(SRCDIR)\util\copy.pl" ossl_static.pdb \
295 "$(INSTALLTOP)\$(LIBDIR)"
300 @if "$(INSTALLTOP)"=="" ( echo INSTALLTOP should not be empty & exit 1 )
301 @echo *** Installing engines
302 @"$(PERL)" "$(SRCDIR)\util\mkdir-p.pl" "$(ENGINESDIR)"
303 @if not "$(ENGINES)"=="" \
304 "$(PERL)" "$(SRCDIR)\util\copy.pl" $(INSTALL_ENGINES) "$(ENGINESDIR)"
305 @if not "$(ENGINES)"=="" \
306 "$(PERL)" "$(SRCDIR)\util\copy.pl" $(INSTALL_ENGINEPDBS) "$(ENGINESDIR)"
311 @if "$(INSTALLTOP)"=="" ( echo INSTALLTOP should not be empty & exit 1 )
312 @echo *** Installing runtime files
313 @"$(PERL)" "$(SRCDIR)\util\mkdir-p.pl" "$(INSTALLTOP)\bin"
314 @if not "$(SHLIBS)"=="" \
315 "$(PERL)" "$(SRCDIR)\util\copy.pl" $(INSTALL_SHLIBS) "$(INSTALLTOP)\bin"
316 @if not "$(SHLIBS)"=="" \
317 "$(PERL)" "$(SRCDIR)\util\copy.pl" $(INSTALL_SHLIBPDBS) \
319 @"$(PERL)" "$(SRCDIR)\util\copy.pl" $(INSTALL_PROGRAMS) \
321 @"$(PERL)" "$(SRCDIR)\util\copy.pl" $(INSTALL_PROGRAMPDBS) \
323 @"$(PERL)" "$(SRCDIR)\util\copy.pl" $(BIN_SCRIPTS) \
329 "$(PERL)" "$(SRCDIR)\util\process_docs.pl" \
330 "--destdir=$(INSTALLTOP)\html" --type=html
334 # Building targets ###################################################
336 configdata.pm: "$(SRCDIR)\Configure" {- join(" ", map { '"'.$_.'"' } @{$config{build_file_templates}}, @{$config{build_infos}}, @{$config{conf_files}}) -}
337 @echo "Detected changed: $?"
338 @echo "Reconfiguring..."
339 "$(PERL)" "$(SRCDIR)\Configure" reconf
340 @echo "**************************************************"
342 @echo "*** Please run the same make command again ***"
344 @echo "**************************************************"
349 use File::Spec::Functions qw/:DEFAULT abs2rel rel2abs/;
351 # Helper function to figure out dependencies on libraries
352 # It takes a list of library names and outputs a list of dependencies
353 sub compute_lib_depends {
354 if ($disabled{shared}) {
355 return map { $_.$libext } @_;
357 return map { shlib_import($_) } @_;
362 (my $target = $args{src}) =~ s/\.[sS]$/.asm/;
363 my $generator = '"'.join('" "', @{$args{generator}}).'"';
364 my $generator_incs = join("", map { " -I \"$_\"" } @{$args{generator_incs}});
365 my $incs = join("", map { " /I \"$_\"" } @{$args{incs}});
366 my $deps = @{$args{deps}} ?
367 '"'.join('" "', @{$args{generator_deps}}, @{$args{deps}}).'"' : '';
369 if ($target !~ /\.asm$/) {
370 if ($args{generator}->[0] =~ m|^.*\.in$|) {
371 my $dofile = abs2rel(rel2abs(catfile($config{sourcedir},
372 "util", "dofile.pl")),
373 rel2abs($config{builddir}));
375 $target: "$args{generator}->[0]" $deps
376 "\$(PERL)" "-I\$(BLDDIR)" -Mconfigdata "$dofile" \\
377 "-o$target{build_file}" $generator > \$@
381 $target: "$args{generator}->[0]" $deps
382 "\$(PERL)"$generator_incs $generator > \$@
386 if ($args{generator}->[0] =~ /\.pl$/) {
387 $generator = '"$(PERL)"'.$generator_incs.' '.$generator;
388 } elsif ($args{generator}->[0] =~ /\.S$/) {
391 die "Generator type for $src unknown: $generator\n";
394 if (defined($generator)) {
395 # If the target is named foo.S in build.info, we want to
396 # end up generating foo.s in two steps.
397 if ($args{src} =~ /\.S$/) {
399 $target: "$args{generator}->[0]" $deps
402 \$(CC) $incs \$(CFLAGS) /EP /C \$@.S > \$@.i && move /Y \$@.i \$@
408 $target: "$args{generator}->[0]" $deps
414 $target: "$args{generator}->[0]" $deps
415 \$(CC) $incs \$(CFLAGS) /EP /C "$args{generator}->[0]" > \$@.i && move /Y \$@.i \$@
422 my $obj = $args{obj};
423 my @srcs = map { (my $x = $_) =~ s/\.s$/.asm/; $x
424 } ( @{$args{srcs}} );
425 my $srcs = '"'.join('" "', @srcs).'"';
426 my $deps = '"'.join('" "', @srcs, @{$args{deps}}).'"';
427 my $incs = join("", map { ' /I "'.$_.'"' } @{$args{incs}});
428 unless ($disabled{zlib}) {
429 if ($withargs{zlib_include}) {
430 $incs .= ' /I "'.$withargs{zlib_include}.'"';
433 my $ecflags = { lib => '$(LIB_CFLAGS)',
434 dso => '$(DSO_CFLAGS)',
435 bin => '$(BIN_CFLAGS)' } -> {$args{intent}};
436 my $makedepprog = $config{makedepprog};
437 if ($srcs[0] =~ /\.asm$/) {
440 \$(AS) \$(ASFLAGS) \$(ASOUTFLAG)\$\@ $srcs
443 return <<"EOF" if (!$disabled{makedepend});
445 \$(CC) \$(CFLAGS) $ecflags$inc /Zs /showIncludes $srcs 2>&1 | \\
446 "\$(PERL)" -n << > $obj$depext
448 s/^Note: including file: *//;
449 \$\$collect{\$\$_} = 1;
450 END { print '$obj$objext: ',join(" ", sort keys \%collect),"\\n" }
452 $obj$objext: $obj$depext
453 \$(CC) $incs \$(CFLAGS) $ecflags -c \$(COUTFLAG)\$\@ @<<
457 return <<"EOF" if ($disabled{makedepend});
459 \$(CC) $incs \$(CFLAGS) $ecflags -c \$(COUTFLAG)\$\@ $srcs
463 # On Unix, we build shlibs from static libs, so we're ignoring the
464 # object file array. We *know* this routine is only called when we've
465 # configure 'shared'.
468 my $lib = $args{lib};
469 my $shlib = $args{shlib};
470 (my $mkdef_key = $lib) =~ s/^lib//i;
471 my $objs = join("\n", map { $_.$objext } @{$args{objs}});
472 my $linklibs = join("",
473 map { "\n$_" } compute_lib_depends(@{$args{deps}}));
475 (map { $_.$objext } @{$args{objs}}),
476 compute_lib_depends(@{$args{deps}}));
477 my $ordinalsfile = defined($args{ordinals}) ? $args{ordinals}->[1] : "";
478 my $mkdef_pl = abs2rel(rel2abs(catfile($config{sourcedir},
479 "util", "mkdef.pl")),
480 rel2abs($config{builddir}));
481 my $mkrc_pl = abs2rel(rel2abs(catfile($config{sourcedir},
483 rel2abs($config{builddir}));
484 my $target = shlib_import($lib);
486 $target: $deps "$ordinalsfile" "$mkdef_pl"
487 "\$(PERL)" "$mkdef_pl" "$mkdef_key" 32 > $shlib.def
488 "\$(PERL)" -i.tmp -pe "s|^LIBRARY\\s+${mkdef_key}32|LIBRARY $shlib|;" $shlib.def
490 "\$(PERL)" "$mkrc_pl" $shlib$shlibext > $shlib.rc
491 \$(RC) \$(RCOUTFLAG)$shlib.res $shlib.rc
492 IF EXIST $shlib$shlibext.manifest DEL /F /Q $shlib$shlibext.manifest
493 \$(LD) \$(LDFLAGS) \$(LIB_LDFLAGS) \\
494 /implib:\$@ \$(LDOUTFLAG)$shlib$shlibext /def:$shlib.def @<< || (DEL /Q \$(\@B).* $shlib.* && EXIT 1)
495 $objs $shlib.res$linklibs \$(EX_LIBS)
497 IF EXIST $shlib$shlibext.manifest \\
498 \$(MT) \$(MTFLAGS) \$(MTINFLAG)$shlib$shlibext.manifest \$(MTOUTFLAG)$shlib$shlibext
499 IF EXIST apps\\$shlib$shlibext DEL /Q /F apps\\$shlib$shlibext
500 IF EXIST test\\$shlib$shlibext DEL /Q /F test\\$shlib$shlibext
501 COPY $shlib$shlibext apps
502 COPY $shlib$shlibext test
507 my $dso = $args{lib};
508 my $dso_n = basename($dso);
509 my $objs = join("\n", map { $_.$objext } @{$args{objs}});
510 my $linklibs = join("",
511 map { "\n$_" } compute_lib_depends(@{$args{deps}}));
513 (map { $_.$objext } @{$args{objs}}),
514 compute_lib_depends(@{$args{deps}}));
517 IF EXIST $dso$dsoext.manifest DEL /F /Q $dso$dsoext.manifest
518 \$(LD) \$(LDFLAGS) \$(DSO_LDFLAGS) \$(LDOUTFLAG)$dso$dsoext /def:<< @<<
524 $objs$linklibs \$(EX_LIBS)
526 IF EXIST $dso$dsoext.manifest \\
527 \$(MT) \$(MTFLAGS) \$(MTINFLAG)$dso$dsoext.manifest \$(MTOUTFLAG)$dso$dsoext
531 # Because static libs and import libs are both named the same in native
532 # Windows, we can't have both. We skip the static lib in that case,
533 # as the shared libs are what we use anyway.
534 return "" unless $disabled{"shared"};
537 my $lib = $args{lib};
538 my $objs = join("\n", map { $_.$objext } @{$args{objs}});
539 my $deps = join(" ", map { $_.$objext } @{$args{objs}});
542 \$(AR) \$(ARFLAGS) \$(AROUTFLAG)$lib$libext @<<
549 my $bin = $args{bin};
550 my $objs = join("\n", map { $_.$objext } @{$args{objs}});
551 my $linklibs = join("",
552 map { "\n$_" } compute_lib_depends(@{$args{deps}}));
554 (map { $_.$objext } @{$args{objs}}),
555 compute_lib_depends(@{$args{deps}}));
558 IF EXIST $bin$exeext.manifest DEL /F /Q $bin$exeext.manifest
559 \$(LD) \$(LDFLAGS) \$(BIN_LDFLAGS) \$(LDOUTFLAG)$bin$exeext @<<
560 $objs setargv.obj$linklibs \$(EX_LIBS)
562 IF EXIST $bin$exeext.manifest \\
563 \$(MT) \$(MTFLAGS) \$(MTINFLAG)$bin$exeext.manifest \$(MTOUTFLAG)$bin$exeext
568 my $script = $args{script};
569 my $sources = '"'.join('" "', @{$args{sources}}).'"';
570 my $dofile = abs2rel(rel2abs(catfile($config{sourcedir},
571 "util", "dofile.pl")),
572 rel2abs($config{builddir}));
575 "\$(PERL)" "-I\$(BLDDIR)" -Mconfigdata "$dofile" \\
576 "-o$target{build_file}" $sources > "$script"
581 my $dir = $args{dir};
582 my @deps = map { s|\.o$|$objext|; $_ } @{$args{deps}};
584 my %extinfo = ( dso => $dsoext,
588 foreach my $type (("dso", "lib", "bin", "script")) {
589 next unless defined($unified_info{dirinfo}->{$dir}->{products}->{$type});
590 # For lib object files, we could update the library. However,
591 # LIB on Windows doesn't work that way, so we won't create any
592 # actions for it, and the dependencies are already taken care of.
593 if ($type ne "lib") {
594 foreach my $prod (@{$unified_info{dirinfo}->{$dir}->{products}->{$type}}) {
595 if (dirname($prod) eq $dir) {
596 push @deps, $prod.$extinfo{$type};
598 push @actions, "\t@rem No support to produce $type ".join(", ", @{$unified_info{dirinfo}->{$dir}->{products}->{$type}});
604 my $deps = join(" ", @deps);
605 my $actions = join("\n", "", @actions);
607 $args{dir} $args{dir}\\ : $deps$actions
610 "" # Important! This becomes part of the template result.