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={- join(" ", map { $_.$exeext } @{$unified_info{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 # Do not edit these manually. Use Configure with --prefix or --openssldir
104 # to change this! Short explanation in the top comment in Configure
105 INSTALLTOP_dev={- # $prefix is used in the OPENSSLDIR perl snippet
107 use File::Spec::Functions qw(:DEFAULT splitpath);
108 our $prefix = $config{prefix} || "$win_installroot\\OpenSSL";
109 our ($prefix_dev, $prefix_dir, $prefix_file) =
110 splitpath($prefix, 1);
112 INSTALLTOP_dir={- $prefix_dir -}
114 # The logic here is that if no --openssldir was given,
115 # OPENSSLDIR will get the value from $prefix plus "/ssl".
116 # If --openssldir was given and the value is an absolute
117 # path, OPENSSLDIR will get its value without change.
118 # If the value from --openssldir is a relative path,
119 # OPENSSLDIR will get $prefix with the --openssldir
120 # value appended as a subdirectory.
122 use File::Spec::Functions qw(:DEFAULT splitpath);
124 $config{openssldir} ?
125 (file_name_is_absolute($config{openssldir}) ?
127 : catdir($prefix, $config{openssldir}))
128 : "$win_commonroot\\SSL";
129 our ($openssldir_dev, $openssldir_dir, $openssldir_file) =
130 splitpath($openssldir, 1);
132 OPENSSLDIR_dir={- $openssldir_dir -}
133 LIBDIR={- our $libdir = $config{libdir} || "lib";
135 ENGINESDIR_dev={- use File::Spec::Functions qw(:DEFAULT splitpath);
136 our $enginesdir = catdir($prefix,$libdir,"engines-$sover");
137 our ($enginesdir_dev, $enginesdir_dir, $enginesdir_file) =
138 splitpath($enginesdir, 1);
140 ENGINESDIR_dir={- $enginesdir_dir -}
141 !IF "$(DESTDIR)" != ""
142 INSTALLTOP=$(DESTDIR)$(INSTALLTOP_dir)
143 OPENSSLDIR=$(DESTDIR)$(OPENSSLDIR_dir)
144 ENGINESDIR=$(DESTDIR)$(ENGINESDIR_dir)
146 INSTALLTOP=$(INSTALLTOP_dev)$(INSTALLTOP_dir)
147 OPENSSLDIR=$(OPENSSLDIR_dev)$(OPENSSLDIR_dir)
148 ENGINESDIR=$(ENGINESDIR_dev)$(ENGINESDIR_dir)
152 CFLAGS={- join(" ",(map { "-D".$_} @{$target{defines}}, @{$config{defines}})) -} {- join(" ", quotify_l("-DENGINESDIR=\"$enginesdir\"", "-DOPENSSLDIR=\"$openssldir\"")) -} {- $target{cflags} -} {- $config{cflags} -}
153 COUTFLAG={- $target{coutflag} || "/Fo" -}$(OSSL_EMPTY)
154 RC={- $target{rc} || "rc" -}
155 RCOUTFLAG={- $target{rcoutflag} || "/fo" -}$(OSSL_EMPTY)
156 LD={- $target{ld} || "link" -}
157 LDFLAGS={- $target{lflags} -}
158 LDOUTFLAG={- $target{loutflag} || "/out:" -}$(OSSL_EMPTY)
159 EX_LIBS={- $target{ex_libs} -}
160 LIB_CFLAGS={- join(" ", $target{lib_cflags}, $target{shared_cflag}) || "" -}
161 LIB_LDFLAGS={- $target{shared_ldflag} || "" -}
162 DSO_CFLAGS={- join(" ", $target{dso_cflags}, $target{shared_cflag}) || "" -}
163 DSO_LDFLAGS={- join(" ", $target{dso_lflags}, $target{shared_ldflag}) || "" -}
164 BIN_CFLAGS={- $target{bin_cflags} -}
165 BIN_LDFLAGS={- $target{bin_lflags} -}
167 PERL={- $config{perl} -}
170 ARFLAGS= {- $target{arflags} -}
171 AROUTFLAG={- $target{aroutflag} || "/out:" -}$(OSSL_EMPTY)
174 MTFLAGS= {- $target{mtflags} -}
175 MTINFLAG={- $target{mtinflag} || "-manifest " -}$(OSSL_EMPTY)
176 MTOUTFLAG={- $target{mtoutflag} || "-outputresource:" -}$(OSSL_EMPTY)
179 ASFLAGS={- $target{asflags} -}
180 ASOUTFLAG={- $target{asoutflag} -}$(OSSL_EMPTY)
181 PERLASM_SCHEME= {- $target{perlasm_scheme} -}
183 PROCESSOR= {- $config{processor} -}
185 # The main targets ###################################################
187 {- dependmagic('all'); -}: build_libs_nodep build_engines_nodep build_programs_nodep
188 {- dependmagic('build_libs'); -}: build_libs_nodep
189 {- dependmagic('build_engines'); -}: build_engines_nodep
190 {- dependmagic('build_programs'); -}: build_programs_nodep
192 build_generated: $(GENERATED_MANDATORY)
193 build_libs_nodep: $(LIBS) {- join(" ",map { shlib_import($_) } @{$unified_info{libraries}}) -}
194 build_engines_nodep: $(ENGINES)
195 build_programs_nodep: $(PROGRAMS) $(SCRIPTS)
197 # Kept around for backward compatibility
198 build_apps build_tests: build_programs
201 {- dependmagic('tests'); -}: build_programs_nodep build_engines_nodep
202 @rem {- output_off() if $disabled{tests}; "" -}
206 set OPENSSL_DEBUG_MEMORY=on
207 "$(PERL)" "$(SRCDIR)\test\run_tests.pl" $(TESTS)
208 @rem {- if ($disabled{tests}) { output_on(); } else { output_off(); } "" -}
209 @echo "Tests are not supported with your chosen Configure options"
210 @rem {- output_on() if !$disabled{tests}; "" -}
213 @rem {- output_off() if $disabled{tests}; "" -}
214 @set SRCTOP=$(SRCDIR)
215 @"$(PERL)" "$(SRCDIR)\test\run_tests.pl" list
216 @rem {- if ($disabled{tests}) { output_on(); } else { output_off(); } "" -}
217 @echo "Tests are not supported with your chosen Configure options"
218 @rem {- output_on() if !$disabled{tests}; "" -}
220 install: install_sw install_ssldirs install_docs
222 uninstall: uninstall_docs uninstall_sw
225 "$(PERL)" -e "map { m/(.*)\.dll$$/; unlink glob """$$1.*"""; } @ARGV" $(SHLIBS)
226 "$(PERL)" -e "map { m/(.*)\.dll$$/; unlink glob """apps/$$1.*"""; } @ARGV" $(SHLIBS)
227 "$(PERL)" -e "map { m/(.*)\.dll$$/; unlink glob """test/$$1.*"""; } @ARGV" $(SHLIBS)
229 -del /Q ossl_static.pdb
232 -del /Q /F $(PROGRAMS) $(ENGINES) $(SCRIPTS)
233 -del /Q /F $(GENERATED)
238 -del /Q /S /F engines\*.ilk
239 -del /Q /S /F engines\*.lib
240 -del /Q /S /F apps\*.lib
241 -del /Q /S /F engines\*.manifest
242 -del /Q /S /F apps\*.manifest
243 -del /Q /S /F test\*.manifest
246 -del /Q /F configdata.pm
251 # Install helper targets #############################################
253 install_sw: all install_dev install_engines install_runtime
255 uninstall_sw: uninstall_runtime uninstall_engines uninstall_dev
257 install_docs: install_html_docs
259 uninstall_docs: uninstall_html_docs
262 @"$(PERL)" "$(SRCDIR)\util\mkdir-p.pl" "$(OPENSSLDIR)\certs"
263 @"$(PERL)" "$(SRCDIR)\util\mkdir-p.pl" "$(OPENSSLDIR)\private"
264 @"$(PERL)" "$(SRCDIR)\util\mkdir-p.pl" "$(OPENSSLDIR)\misc"
265 @"$(PERL)" "$(SRCDIR)\util\copy.pl" "$(SRCDIR)\apps\openssl.cnf" \
266 "$(OPENSSLDIR)\openssl.cnf.dist"
267 @IF NOT EXIST "$(OPENSSLDIR)\openssl.cnf" \
268 "$(PERL)" "$(SRCDIR)\util\copy.pl" "$(SRCDIR)\apps\openssl.cnf" \
269 "$(OPENSSLDIR)\openssl.cnf"
270 @"$(PERL)" "$(SRCDIR)\util\copy.pl" $(MISC_SCRIPTS) \
274 @if "$(INSTALLTOP)"=="" ( echo INSTALLTOP should not be empty & exit 1 )
275 @echo *** Installing development files
276 @"$(PERL)" "$(SRCDIR)\util\mkdir-p.pl" "$(INSTALLTOP)\include\openssl"
277 @rem {- output_off() unless grep { $_ eq "OPENSSL_USE_APPLINK" } @{$target{defines}}; "" -}
278 @"$(PERL)" "$(SRCDIR)\util\copy.pl" "$(SRCDIR)\ms\applink.c" \
279 "$(INSTALLTOP)\include\openssl"
280 @rem {- output_on() unless grep { $_ eq "OPENSSL_USE_APPLINK" } @{$target{defines}}; "" -}
281 @"$(PERL)" "$(SRCDIR)\util\copy.pl" "$(SRCDIR)\include\openssl\*.h" \
282 "$(INSTALLTOP)\include\openssl"
283 @"$(PERL)" "$(SRCDIR)\util\copy.pl" $(BLDDIR)\include\openssl\*.h \
284 "$(INSTALLTOP)\include\openssl"
285 @"$(PERL)" "$(SRCDIR)\util\mkdir-p.pl" "$(INSTALLTOP)\$(LIBDIR)"
286 @"$(PERL)" "$(SRCDIR)\util\copy.pl" $(INSTALL_LIBS) \
287 "$(INSTALLTOP)\$(LIBDIR)"
288 @if "$(SHLIBS)"=="" \
289 "$(PERL)" "$(SRCDIR)\util\copy.pl" ossl_static.pdb \
290 "$(INSTALLTOP)\$(LIBDIR)"
295 @if "$(INSTALLTOP)"=="" ( echo INSTALLTOP should not be empty & exit 1 )
296 @echo *** Installing engines
297 @"$(PERL)" "$(SRCDIR)\util\mkdir-p.pl" "$(ENGINESDIR)"
298 @if not "$(ENGINES)"=="" \
299 "$(PERL)" "$(SRCDIR)\util\copy.pl" $(INSTALL_ENGINES) "$(ENGINESDIR)"
300 @if not "$(ENGINES)"=="" \
301 "$(PERL)" "$(SRCDIR)\util\copy.pl" $(INSTALL_ENGINEPDBS) "$(ENGINESDIR)"
306 @if "$(INSTALLTOP)"=="" ( echo INSTALLTOP should not be empty & exit 1 )
307 @echo *** Installing runtime files
308 @"$(PERL)" "$(SRCDIR)\util\mkdir-p.pl" "$(INSTALLTOP)\bin"
309 @if not "$(SHLIBS)"=="" \
310 "$(PERL)" "$(SRCDIR)\util\copy.pl" $(INSTALL_SHLIBS) "$(INSTALLTOP)\bin"
311 @if not "$(SHLIBS)"=="" \
312 "$(PERL)" "$(SRCDIR)\util\copy.pl" $(INSTALL_SHLIBPDBS) \
314 @"$(PERL)" "$(SRCDIR)\util\copy.pl" $(INSTALL_PROGRAMS) \
316 @"$(PERL)" "$(SRCDIR)\util\copy.pl" $(INSTALL_PROGRAMPDBS) \
318 @"$(PERL)" "$(SRCDIR)\util\copy.pl" $(BIN_SCRIPTS) \
324 "$(PERL)" "$(SRCDIR)\util\process_docs.pl" \
325 "--destdir=$(INSTALLTOP)\html" --type=html
329 # Building targets ###################################################
331 configdata.pm: "$(SRCDIR)\Configure" {- join(" ", map { '"'.$_.'"' } @{$config{build_file_templates}}, @{$config{build_infos}}, @{$config{conf_files}}) -}
332 @echo "Detected changed: $?"
333 @echo "Reconfiguring..."
334 "$(PERL)" "$(SRCDIR)\Configure" reconf
335 @echo "**************************************************"
337 @echo "*** Please run the same make command again ***"
339 @echo "**************************************************"
344 use File::Spec::Functions qw/:DEFAULT abs2rel rel2abs/;
346 # Helper function to figure out dependencies on libraries
347 # It takes a list of library names and outputs a list of dependencies
348 sub compute_lib_depends {
349 if ($disabled{shared}) {
350 return map { $_.$libext } @_;
352 return map { shlib_import($_) } @_;
357 (my $target = $args{src}) =~ s/\.[sS]$/.asm/;
358 my $generator = '"'.join('" "', @{$args{generator}}).'"';
359 my $generator_incs = join("", map { " -I \"$_\"" } @{$args{generator_incs}});
360 my $incs = join("", map { " /I \"$_\"" } @{$args{incs}});
361 my $deps = @{$args{deps}} ?
362 '"'.join('" "', @{$args{generator_deps}}, @{$args{deps}}).'"' : '';
364 if ($target !~ /\.asm$/) {
365 if ($args{generator}->[0] =~ m|^.*\.in$|) {
366 my $dofile = abs2rel(rel2abs(catfile($config{sourcedir},
367 "util", "dofile.pl")),
368 rel2abs($config{builddir}));
370 $target: "$args{generator}->[0]" $deps
371 "\$(PERL)" "-I\$(BLDDIR)" -Mconfigdata "$dofile" \\
372 "-o$target{build_file}" $generator > \$@
376 $target: "$args{generator}->[0]" $deps
377 "\$(PERL)"$generator_incs $generator > \$@
381 if ($args{generator}->[0] =~ /\.pl$/) {
382 $generator = '"$(PERL)"'.$generator_incs.' '.$generator;
383 } elsif ($args{generator}->[0] =~ /\.S$/) {
386 die "Generator type for $src unknown: $generator\n";
389 if (defined($generator)) {
390 # If the target is named foo.S in build.info, we want to
391 # end up generating foo.s in two steps.
392 if ($args{src} =~ /\.S$/) {
394 $target: "$args{generator}->[0]" $deps
397 \$(CC) $incs \$(CFLAGS) /EP /C \$@.S > \$@.i && move /Y \$@.i \$@
403 $target: "$args{generator}->[0]" $deps
409 $target: "$args{generator}->[0]" $deps
410 \$(CC) $incs \$(CFLAGS) /EP /C "$args{generator}->[0]" > \$@.i && move /Y \$@.i \$@
417 my $obj = $args{obj};
418 my @srcs = map { (my $x = $_) =~ s/\.s$/.asm/; $x
419 } ( @{$args{srcs}} );
420 my $srcs = '"'.join('" "', @srcs).'"';
421 my $deps = '"'.join('" "', @srcs, @{$args{deps}}).'"';
422 my $incs = join("", map { ' /I "'.$_.'"' } @{$args{incs}});
423 unless ($disabled{zlib}) {
424 if ($withargs{zlib_include}) {
425 $incs .= ' /I "'.$withargs{zlib_include}.'"';
428 my $ecflags = { lib => '$(LIB_CFLAGS)',
429 dso => '$(DSO_CFLAGS)',
430 bin => '$(BIN_CFLAGS)' } -> {$args{intent}};
431 my $makedepprog = $config{makedepprog};
432 if ($srcs[0] =~ /\.asm$/) {
435 \$(AS) \$(ASFLAGS) \$(ASOUTFLAG)\$\@ $srcs
438 return <<"EOF" if (!$disabled{makedepend});
440 \$(CC) \$(CFLAGS) $ecflags$inc /Zs /showIncludes $srcs 2>&1 | \\
441 "\$(PERL)" -n << > $obj$depext
443 s/^Note: including file: *//;
444 \$\$collect{\$\$_} = 1;
445 END { print '$obj$objext: ',join(" ", sort keys \%collect),"\\n" }
447 $obj$objext: $obj$depext
448 \$(CC) $incs \$(CFLAGS) $ecflags -c \$(COUTFLAG)\$\@ @<<
452 return <<"EOF" if ($disabled{makedepend});
454 \$(CC) $incs \$(CFLAGS) $ecflags -c \$(COUTFLAG)\$\@ $srcs
458 # On Unix, we build shlibs from static libs, so we're ignoring the
459 # object file array. We *know* this routine is only called when we've
460 # configure 'shared'.
463 my $lib = $args{lib};
464 my $shlib = $args{shlib};
465 (my $mkdef_key = $lib) =~ s/^lib//i;
466 my $objs = join("\n", map { $_.$objext } @{$args{objs}});
467 my $linklibs = join("",
468 map { "\n$_" } compute_lib_depends(@{$args{deps}}));
470 (map { $_.$objext } @{$args{objs}}),
471 compute_lib_depends(@{$args{deps}}));
472 my $ordinalsfile = defined($args{ordinals}) ? $args{ordinals}->[1] : "";
473 my $mkdef_pl = abs2rel(rel2abs(catfile($config{sourcedir},
474 "util", "mkdef.pl")),
475 rel2abs($config{builddir}));
476 my $mkrc_pl = abs2rel(rel2abs(catfile($config{sourcedir},
478 rel2abs($config{builddir}));
479 my $target = shlib_import($lib);
481 $target: $deps "$ordinalsfile" "$mkdef_pl"
482 "\$(PERL)" "$mkdef_pl" "$mkdef_key" 32 > $shlib.def
483 "\$(PERL)" -i.tmp -pe "s|^LIBRARY\\s+${mkdef_key}32|LIBRARY $shlib|;" $shlib.def
485 "\$(PERL)" "$mkrc_pl" $shlib$shlibext > $shlib.rc
486 \$(RC) \$(RCOUTFLAG)$shlib.res $shlib.rc
487 IF EXIST $shlib$shlibext.manifest DEL /F /Q $shlib$shlibext.manifest
488 \$(LD) \$(LDFLAGS) \$(LIB_LDFLAGS) \\
489 /implib:\$@ \$(LDOUTFLAG)$shlib$shlibext /def:$shlib.def @<< || (DEL /Q \$(\@B).* $shlib.* && EXIT 1)
490 $objs $shlib.res$linklibs \$(EX_LIBS)
492 IF EXIST $shlib$shlibext.manifest \\
493 \$(MT) \$(MTFLAGS) \$(MTINFLAG)$shlib$shlibext.manifest \$(MTOUTFLAG)$shlib$shlibext
494 IF EXIST apps\\$shlib$shlibext DEL /Q /F apps\\$shlib$shlibext
495 IF EXIST test\\$shlib$shlibext DEL /Q /F test\\$shlib$shlibext
496 COPY $shlib$shlibext apps
497 COPY $shlib$shlibext test
502 my $dso = $args{lib};
503 my $dso_n = basename($dso);
504 my $objs = join("\n", map { $_.$objext } @{$args{objs}});
505 my $linklibs = join("",
506 map { "\n$_" } compute_lib_depends(@{$args{deps}}));
508 (map { $_.$objext } @{$args{objs}}),
509 compute_lib_depends(@{$args{deps}}));
512 IF EXIST $dso$dsoext.manifest DEL /F /Q $dso$dsoext.manifest
513 \$(LD) \$(LDFLAGS) \$(DSO_LDFLAGS) \$(LDOUTFLAG)$dso$dsoext /def:<< @<<
519 $objs$linklibs \$(EX_LIBS)
521 IF EXIST $dso$dsoext.manifest \\
522 \$(MT) \$(MTFLAGS) \$(MTINFLAG)$dso$dsoext.manifest \$(MTOUTFLAG)$dso$dsoext
526 # Because static libs and import libs are both named the same in native
527 # Windows, we can't have both. We skip the static lib in that case,
528 # as the shared libs are what we use anyway.
529 return "" unless $disabled{"shared"};
532 my $lib = $args{lib};
533 my $objs = join("\n", map { $_.$objext } @{$args{objs}});
534 my $deps = join(" ", map { $_.$objext } @{$args{objs}});
537 \$(AR) \$(ARFLAGS) \$(AROUTFLAG)$lib$libext @<<
544 my $bin = $args{bin};
545 my $objs = join("\n", map { $_.$objext } @{$args{objs}});
546 my $linklibs = join("",
547 map { "\n$_" } compute_lib_depends(@{$args{deps}}));
549 (map { $_.$objext } @{$args{objs}}),
550 compute_lib_depends(@{$args{deps}}));
553 IF EXIST $bin$exeext.manifest DEL /F /Q $bin$exeext.manifest
554 \$(LD) \$(LDFLAGS) \$(BIN_LDFLAGS) \$(LDOUTFLAG)$bin$exeext @<<
555 $objs setargv.obj$linklibs \$(EX_LIBS)
557 IF EXIST $bin$exeext.manifest \\
558 \$(MT) \$(MTFLAGS) \$(MTINFLAG)$bin$exeext.manifest \$(MTOUTFLAG)$bin$exeext
563 my $script = $args{script};
564 my $sources = '"'.join('" "', @{$args{sources}}).'"';
565 my $dofile = abs2rel(rel2abs(catfile($config{sourcedir},
566 "util", "dofile.pl")),
567 rel2abs($config{builddir}));
570 "\$(PERL)" "-I\$(BLDDIR)" -Mconfigdata "$dofile" \\
571 "-o$target{build_file}" $sources > "$script"
576 my $dir = $args{dir};
577 my @deps = map { s|\.o$|$objext|; $_ } @{$args{deps}};
579 my %extinfo = ( dso => $dsoext,
583 foreach my $type (("dso", "lib", "bin", "script")) {
584 next unless defined($unified_info{dirinfo}->{$dir}->{products}->{$type});
585 # For lib object files, we could update the library. However,
586 # LIB on Windows doesn't work that way, so we won't create any
587 # actions for it, and the dependencies are already taken care of.
588 if ($type ne "lib") {
589 foreach my $prod (@{$unified_info{dirinfo}->{$dir}->{products}->{$type}}) {
590 if (dirname($prod) eq $dir) {
591 push @deps, $prod.$extinfo{$type};
593 push @actions, "\t@rem No support to produce $type ".join(", ", @{$unified_info{dirinfo}->{$dir}->{products}->{$type}});
599 my $deps = join(" ", @deps);
600 my $actions = join("\n", "", @actions);
602 $args{dir} $args{dir}\\ : $deps$actions
605 "" # Important! This becomes part of the template result.