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;
53 PLATFORM={- $config{target} -}
54 SRCDIR={- $config{sourcedir} -}
55 BLDDIR={- $config{builddir} -}
57 VERSION={- $config{version} -}
58 MAJOR={- $config{major} -}
59 MINOR={- $config{minor} -}
61 SHLIB_VERSION_NUMBER={- $config{shlib_version_number} -}
63 LIBS={- join(" ", map { $_.$libext } @{$unified_info{libraries}}) -}
64 SHLIBS={- join(" ", map { shlib($_) } @{$unified_info{libraries}}) -}
65 SHLIBPDBS={- join(" ", map { local $shlibext = ".pdb"; shlib($_) } @{$unified_info{libraries}}) -}
66 ENGINES={- join(" ", map { dso($_) } @{$unified_info{engines}}) -}
67 ENGINEPDBS={- join(" ", map { local $dsoext = ".pdb"; dso($_) } @{$unified_info{engines}}) -}
68 PROGRAMS={- join(" ", map { $_.$exeext } grep { !m|^test\\| } @{$unified_info{programs}}) -}
69 PROGRAMPDBS={- join(" ", map { $_.".pdb" } grep { !m|^test\\| } @{$unified_info{programs}}) -}
70 TESTPROGS={- join(" ", map { $_.$exeext } grep { m|^test\\| } @{$unified_info{programs}}) -}
71 SCRIPTS={- join(" ", @{$unified_info{scripts}}) -}
72 {- output_off() if $disabled{makedepend}; "" -}
73 DEPS={- join(" ", map { (my $x = $_) =~ s|\.o$|$depext|; $x; }
74 grep { $unified_info{sources}->{$_}->[0] =~ /\.c$/ }
75 keys %{$unified_info{sources}}); -}
76 {- output_on() if $disabled{makedepend}; "" -}
77 GENERATED_MANDATORY={- join(" ", @{$unified_info{depends}->{""}} ) -}
78 GENERATED={- join(" ",
79 ( map { (my $x = $_) =~ s|\.[sS]$|\.asm|; $x }
80 grep { defined $unified_info{generate}->{$_} }
81 map { @{$unified_info{sources}->{$_}} }
82 grep { /\.o$/ } keys %{$unified_info{sources}} ),
83 ( grep { /\.h$/ } keys %{$unified_info{generate}} )) -}
85 INSTALL_LIBS={- join(" ", map { $_.$libext } @{$unified_info{install}->{libraries}}) -}
86 INSTALL_SHLIBS={- join(" ", map { shlib($_) } @{$unified_info{install}->{libraries}}) -}
87 INSTALL_SHLIBPDBS={- join(" ", map { local $shlibext = ".pdb"; shlib($_) } @{$unified_info{install}->{libraries}}) -}
88 INSTALL_ENGINES={- join(" ", map { dso($_) } @{$unified_info{install}->{engines}}) -}
89 INSTALL_ENGINEPDBS={- join(" ", map { local $dsoext = ".pdb"; dso($_) } @{$unified_info{install}->{engines}}) -}
90 INSTALL_PROGRAMS={- join(" ", map { $_.$exeext } grep { !m|^test\\| } @{$unified_info{install}->{programs}}) -}
91 INSTALL_PROGRAMPDBS={- join(" ", map { $_.".pdb" } grep { !m|^test\\| } @{$unified_info{install}->{programs}}) -}
92 {- output_off() if $disabled{apps}; "" -}
93 BIN_SCRIPTS=$(BLDDIR)\tools\c_rehash.pl
94 MISC_SCRIPTS=$(BLDDIR)\apps\CA.pl $(BLDDIR)\apps\tsget.pl
95 {- output_on() if $disabled{apps}; "" -}
97 # Do not edit these manually. Use Configure with --prefix or --openssldir
98 # to change this! Short explanation in the top comment in Configure
99 INSTALLTOP_dev={- # $prefix is used in the OPENSSLDIR perl snippet
101 use File::Spec::Functions qw(:DEFAULT splitpath);
102 our $prefix = $config{prefix} || "$win_installroot\\OpenSSL";
103 our ($prefix_dev, $prefix_dir, $prefix_file) =
104 splitpath($prefix, 1);
106 INSTALLTOP_dir={- $prefix_dir -}
108 # The logic here is that if no --openssldir was given,
109 # OPENSSLDIR will get the value from $prefix plus "/ssl".
110 # If --openssldir was given and the value is an absolute
111 # path, OPENSSLDIR will get its value without change.
112 # If the value from --openssldir is a relative path,
113 # OPENSSLDIR will get $prefix with the --openssldir
114 # value appended as a subdirectory.
116 use File::Spec::Functions qw(:DEFAULT splitpath);
118 $config{openssldir} ?
119 (file_name_is_absolute($config{openssldir}) ?
121 : catdir($prefix, $config{openssldir}))
122 : "$win_commonroot\\SSL";
123 our ($openssldir_dev, $openssldir_dir, $openssldir_file) =
124 splitpath($openssldir, 1);
126 OPENSSLDIR_dir={- $openssldir_dir -}
127 LIBDIR={- our $libdir = $config{libdir} || "lib";
129 ENGINESDIR_dev={- use File::Spec::Functions qw(:DEFAULT splitpath);
130 our $enginesdir = catdir($prefix,$libdir,"engines-$sover");
131 our ($enginesdir_dev, $enginesdir_dir, $enginesdir_file) =
132 splitpath($enginesdir, 1);
134 ENGINESDIR_dir={- $enginesdir_dir -}
135 !IF "$(DESTDIR)" != ""
136 INSTALLTOP=$(DESTDIR)$(INSTALLTOP_dir)
137 OPENSSLDIR=$(DESTDIR)$(OPENSSLDIR_dir)
138 ENGINESDIR=$(DESTDIR)$(ENGINESDIR_dir)
140 INSTALLTOP=$(INSTALLTOP_dev)$(INSTALLTOP_dir)
141 OPENSSLDIR=$(OPENSSLDIR_dev)$(OPENSSLDIR_dir)
142 ENGINESDIR=$(ENGINESDIR_dev)$(ENGINESDIR_dir)
146 CFLAGS={- join(" ",(map { "-D".$_} @{$target{defines}}, @{$config{defines}})) -} {- join(" ", quotify_l("-DENGINESDIR=\"$enginesdir\"", "-DOPENSSLDIR=\"$openssldir\"")) -} {- $target{cflags} -} {- $config{cflags} -}
147 COUTFLAG={- $target{coutflag} || "/Fo" -}$(OSSL_EMPTY)
148 RC={- $target{rc} || "rc" -}
149 RCOUTFLAG={- $target{rcoutflag} || "/fo" -}$(OSSL_EMPTY)
150 LD={- $target{ld} || "link" -}
151 LDFLAGS={- $target{lflags} -}
152 LDOUTFLAG={- $target{loutflag} || "/out:" -}$(OSSL_EMPTY)
153 EX_LIBS={- $target{ex_libs} -}
154 LIB_CFLAGS={- join(" ", $target{lib_cflags}, $target{shared_cflag}) || "" -}
155 LIB_LDFLAGS={- $target{shared_ldflag} || "" -}
156 DSO_CFLAGS={- join(" ", $target{dso_cflags}, $target{shared_cflag}) || "" -}
157 DSO_LDFLAGS={- join(" ", $target{dso_lflags}, $target{shared_ldflag}) || "" -}
158 BIN_CFLAGS={- $target{bin_cflags} -}
159 BIN_LDFLAGS={- $target{bin_lflags} -}
161 PERL={- $config{perl} -}
164 ARFLAGS= {- $target{arflags} -}
165 AROUTFLAG={- $target{aroutflag} || "/out:" -}$(OSSL_EMPTY)
168 MTFLAGS= {- $target{mtflags} -}
169 MTINFLAG={- $target{mtinflag} || "-manifest " -}$(OSSL_EMPTY)
170 MTOUTFLAG={- $target{mtoutflag} || "-outputresource:" -}$(OSSL_EMPTY)
173 ASFLAGS={- $target{asflags} -}
174 ASOUTFLAG={- $target{asoutflag} -}$(OSSL_EMPTY)
175 PERLASM_SCHEME= {- $target{perlasm_scheme} -}
177 PROCESSOR= {- $config{processor} -}
179 # The main targets ###################################################
181 all: build_generated \
182 build_libs_nodep build_engines_nodep build_apps_nodep depend
184 build_libs: build_generated build_libs_nodep depend
185 build_libs_nodep: $(LIBS) {- join(" ",map { shlib_import($_) } @{$unified_info{libraries}}) -}
186 build_engines: build_generated build_engines_nodep depend
187 build_engines_nodep: $(ENGINES)
188 build_apps: build_generated build_apps_nodep depend
189 build_apps_nodep: $(PROGRAMS) $(SCRIPTS)
190 build_tests: build_generated build_tests_nodep depend
191 build_tests_nodep: $(TESTPROGS)
193 build_generated: $(GENERATED_MANDATORY)
196 tests: build_generated \
197 build_tests_nodep build_apps_nodep build_engines_nodep depend
198 @rem {- output_off() if $disabled{tests}; "" -}
202 "$(PERL)" "$(SRCDIR)\test\run_tests.pl" $(TESTS)
203 @rem {- if ($disabled{tests}) { output_on(); } else { output_off(); } "" -}
204 @echo "Tests are not supported with your chosen Configure options"
205 @rem {- output_on() if !$disabled{tests}; "" -}
208 @rem {- output_off() if $disabled{tests}; "" -}
209 @set SRCTOP=$(SRCDIR)
210 @"$(PERL)" "$(SRCDIR)\test\run_tests.pl" list
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}; "" -}
215 install: install_sw install_ssldirs install_docs
217 uninstall: uninstall_docs uninstall_sw
220 "$(PERL)" -e "map { m/(.*)\.dll$$/; unlink glob """$$1.*"""; } @ARGV" $(SHLIBS)
221 "$(PERL)" -e "map { m/(.*)\.dll$$/; unlink glob """apps/$$1.*"""; } @ARGV" $(SHLIBS)
222 "$(PERL)" -e "map { m/(.*)\.dll$$/; unlink glob """test/$$1.*"""; } @ARGV" $(SHLIBS)
224 -del /Q ossl_static.pdb
227 -del /Q /F $(PROGRAMS) $(TESTPROGS) $(ENGINES) $(SCRIPTS)
228 -del /Q /F $(GENERATED)
233 -del /Q /S /F engines\*.ilk
234 -del /Q /S /F engines\*.lib
235 -del /Q /S /F apps\*.lib
236 -del /Q /S /F engines\*.manifest
237 -del /Q /S /F apps\*.manifest
238 -del /Q /S /F test\*.manifest
241 -del /Q /F configdata.pm
246 # Install helper targets #############################################
248 install_sw: all install_dev install_engines install_runtime
250 uninstall_sw: uninstall_runtime uninstall_engines uninstall_dev
252 install_docs: install_html_docs
254 uninstall_docs: uninstall_html_docs
257 @"$(PERL)" "$(SRCDIR)\util\mkdir-p.pl" "$(OPENSSLDIR)\certs"
258 @"$(PERL)" "$(SRCDIR)\util\mkdir-p.pl" "$(OPENSSLDIR)\private"
259 @"$(PERL)" "$(SRCDIR)\util\mkdir-p.pl" "$(OPENSSLDIR)\misc"
260 @"$(PERL)" "$(SRCDIR)\util\copy.pl" "$(SRCDIR)\apps\openssl.cnf" \
262 @"$(PERL)" "$(SRCDIR)\util\copy.pl" $(MISC_SCRIPTS) \
266 @if "$(INSTALLTOP)"=="" ( echo INSTALLTOP should not be empty & exit 1 )
267 @echo *** Installing development files
268 @"$(PERL)" "$(SRCDIR)\util\mkdir-p.pl" "$(INSTALLTOP)\include\openssl"
269 @rem {- output_off() unless grep { $_ eq "OPENSSL_USE_APPLINK" } @{$target{defines}}; "" -}
270 @"$(PERL)" "$(SRCDIR)\util\copy.pl" "$(SRCDIR)\ms\applink.c" \
271 "$(INSTALLTOP)\include\openssl"
272 @rem {- output_on() unless grep { $_ eq "OPENSSL_USE_APPLINK" } @{$target{defines}}; "" -}
273 @"$(PERL)" "$(SRCDIR)\util\copy.pl" "$(SRCDIR)\include\openssl\*.h" \
274 "$(INSTALLTOP)\include\openssl"
275 @"$(PERL)" "$(SRCDIR)\util\copy.pl" $(BLDDIR)\include\openssl\*.h \
276 "$(INSTALLTOP)\include\openssl"
277 @"$(PERL)" "$(SRCDIR)\util\mkdir-p.pl" "$(INSTALLTOP)\$(LIBDIR)"
278 @"$(PERL)" "$(SRCDIR)\util\copy.pl" $(INSTALL_LIBS) \
279 "$(INSTALLTOP)\$(LIBDIR)"
280 @if "$(SHLIBS)"=="" \
281 "$(PERL)" "$(SRCDIR)\util\copy.pl" ossl_static.pdb \
282 "$(INSTALLTOP)\$(LIBDIR)"
287 @if "$(INSTALLTOP)"=="" ( echo INSTALLTOP should not be empty & exit 1 )
288 @echo *** Installing engines
289 @"$(PERL)" "$(SRCDIR)\util\mkdir-p.pl" "$(ENGINESDIR)"
290 @if not "$(ENGINES)"=="" \
291 "$(PERL)" "$(SRCDIR)\util\copy.pl" $(INSTALL_ENGINES) "$(ENGINESDIR)"
292 @if not "$(ENGINES)"=="" \
293 "$(PERL)" "$(SRCDIR)\util\copy.pl" $(INSTALL_ENGINEPDBS) "$(ENGINESDIR)"
298 @if "$(INSTALLTOP)"=="" ( echo INSTALLTOP should not be empty & exit 1 )
299 @echo *** Installing runtime files
300 @"$(PERL)" "$(SRCDIR)\util\mkdir-p.pl" "$(INSTALLTOP)\bin"
301 @if not "$(SHLIBS)"=="" \
302 "$(PERL)" "$(SRCDIR)\util\copy.pl" $(INSTALL_SHLIBS) "$(INSTALLTOP)\bin"
303 @if not "$(SHLIBS)"=="" \
304 "$(PERL)" "$(SRCDIR)\util\copy.pl" $(INSTALL_SHLIBPDBS) \
306 @"$(PERL)" "$(SRCDIR)\util\copy.pl" $(INSTALL_PROGRAMS) \
308 @"$(PERL)" "$(SRCDIR)\util\copy.pl" $(INSTALL_PROGRAMPDBS) \
310 @"$(PERL)" "$(SRCDIR)\util\copy.pl" $(BIN_SCRIPTS) \
316 "$(PERL)" "$(SRCDIR)\util\process_docs.pl" \
317 "--destdir=$(INSTALLTOP)\html" --type=html
321 # Building targets ###################################################
323 configdata.pm: "{- $config{build_file_template} -}" "$(SRCDIR)\Configurations\common.tmpl" "$(SRCDIR)\Configure" {- join(" ", map { '"'.$_.'"' } @{$config{build_infos}}) -}
324 @echo "Detected changed: $?"
325 @echo "Reconfiguring..."
326 "$(PERL)" "$(SRCDIR)\Configure" reconf
327 @echo "**************************************************"
329 @echo "*** Please run the same make command again ***"
331 @echo "**************************************************"
336 use File::Spec::Functions qw/:DEFAULT abs2rel rel2abs/;
338 # Helper function to figure out dependencies on libraries
339 # It takes a list of library names and outputs a list of dependencies
340 sub compute_lib_depends {
341 if ($disabled{shared}) {
342 return map { $_.$libext } @_;
344 return map { shlib_import($_) } @_;
349 (my $target = $args{src}) =~ s/\.[sS]$/.asm/;
350 my $generator = '"'.join('" "', @{$args{generator}}).'"';
351 my $generator_incs = join("", map { " -I \"$_\"" } @{$args{generator_incs}});
352 my $incs = join("", map { " /I \"$_\"" } @{$args{incs}});
353 my $deps = @{$args{deps}} ?
354 '"'.join('" "', @{$args{generator_deps}}, @{$args{deps}}).'"' : '';
356 if ($target !~ /\.asm$/) {
357 if ($args{generator}->[0] =~ m|^.*\.in$|) {
358 my $dofile = abs2rel(rel2abs(catfile($config{sourcedir},
359 "util", "dofile.pl")),
360 rel2abs($config{builddir}));
362 $target: "$args{generator}->[0]" $deps
363 "\$(PERL)" "-I\$(BLDDIR)" -Mconfigdata "$dofile" \\
364 "-o$target{build_file}" $generator > \$@
368 $target: "$args{generator}->[0]" $deps
369 "\$(PERL)"$generator_incs $generator > \$@
373 if ($args{generator}->[0] =~ /\.pl$/) {
374 $generator = '"$(PERL)"'.$generator_incs.' '.$generator;
375 } elsif ($args{generator}->[0] =~ /\.S$/) {
378 die "Generator type for $src unknown: $generator\n";
381 if (defined($generator)) {
382 # If the target is named foo.S in build.info, we want to
383 # end up generating foo.s in two steps.
384 if ($args{src} =~ /\.S$/) {
386 $target: "$args{generator}->[0]" $deps
389 \$(CC) $incs \$(CFLAGS) /EP /C \$@.S > \$@.i && move /Y \$@.i \$@
395 $target: "$args{generator}->[0]" $deps
401 $target: "$args{generator}->[0]" $deps
402 \$(CC) $incs \$(CFLAGS) /EP /C "$args{generator}->[0]" > \$@.i && move /Y \$@.i \$@
409 my $obj = $args{obj};
410 my @srcs = map { (my $x = $_) =~ s/\.s$/.asm/; $x
411 } ( @{$args{srcs}} );
412 my $srcs = '"'.join('" "', @srcs).'"';
413 my $deps = '"'.join('" "', @srcs, @{$args{deps}}).'"';
414 my $incs = join("", map { ' /I "'.$_.'"' } @{$args{incs}});
415 unless ($disabled{zlib}) {
416 if ($withargs{zlib_include}) {
417 $incs .= ' /I "'.$withargs{zlib_include}.'"';
420 my $ecflags = { lib => '$(LIB_CFLAGS)',
421 dso => '$(DSO_CFLAGS)',
422 bin => '$(BIN_CFLAGS)' } -> {$args{intent}};
423 my $makedepprog = $config{makedepprog};
424 if ($srcs[0] =~ /\.asm$/) {
427 \$(AS) \$(ASFLAGS) \$(ASOUTFLAG)\$\@ $srcs
430 return <<"EOF" if (!$disabled{makedepend});
432 \$(CC) \$(CFLAGS) $ecflags$inc /Zs /showIncludes $srcs 2>&1 | \\
433 "\$(PERL)" -n << > $obj$depext
435 s/^Note: including file: *//;
436 \$\$collect{\$\$_} = 1;
437 END { print '$obj$objext: ',join(" ", sort keys \%collect),"\\n" }
439 $obj$objext: $obj$depext
440 \$(CC) $incs \$(CFLAGS) $ecflags -c \$(COUTFLAG)\$\@ @<<
444 return <<"EOF" if ($disabled{makedepend});
446 \$(CC) $incs \$(CFLAGS) $ecflags -c \$(COUTFLAG)\$\@ $srcs
450 # On Unix, we build shlibs from static libs, so we're ignoring the
451 # object file array. We *know* this routine is only called when we've
452 # configure 'shared'.
455 my $lib = $args{lib};
456 my $shlib = $args{shlib};
457 (my $mkdef_key = $lib) =~ s/^lib//i;
458 my $objs = join("\n", map { $_.$objext } @{$args{objs}});
459 my $linklibs = join("",
460 map { "\n$_" } compute_lib_depends(@{$args{deps}}));
462 (map { $_.$objext } @{$args{objs}}),
463 compute_lib_depends(@{$args{deps}}));
464 my $ordinalsfile = defined($args{ordinals}) ? $args{ordinals}->[1] : "";
465 my $mkdef_pl = abs2rel(rel2abs(catfile($config{sourcedir},
466 "util", "mkdef.pl")),
467 rel2abs($config{builddir}));
468 my $mkrc_pl = abs2rel(rel2abs(catfile($config{sourcedir},
470 rel2abs($config{builddir}));
471 my $target = shlib_import($lib);
473 $target: $deps "$ordinalsfile" "$mkdef_pl"
474 "\$(PERL)" "$mkdef_pl" "$mkdef_key" 32 > $shlib.def
475 "\$(PERL)" -i.tmp -pe "s|^LIBRARY\\s+${mkdef_key}32|LIBRARY $shlib|;" $shlib.def
477 "\$(PERL)" "$mkrc_pl" $shlib$shlibext > $shlib.rc
478 \$(RC) \$(RCOUTFLAG)$shlib.res $shlib.rc
479 IF EXIST $shlib$shlibext.manifest DEL /F /Q $shlib$shlibext.manifest
480 \$(LD) \$(LDFLAGS) \$(LIB_LDFLAGS) \\
481 /implib:\$@ \$(LDOUTFLAG)$shlib$shlibext /def:$shlib.def @<< || (DEL /Q \$(\@B).* $shlib.* && EXIT 1)
482 $objs $shlib.res$linklibs \$(EX_LIBS)
484 IF EXIST $shlib$shlibext.manifest \\
485 \$(MT) \$(MTFLAGS) \$(MTINFLAG)$shlib$shlibext.manifest \$(MTOUTFLAG)$shlib$shlibext
486 IF EXIST apps\\$shlib$shlibext DEL /Q /F apps\\$shlib$shlibext
487 IF EXIST test\\$shlib$shlibext DEL /Q /F test\\$shlib$shlibext
488 COPY $shlib$shlibext apps
489 COPY $shlib$shlibext test
494 my $dso = $args{lib};
495 my $dso_n = basename($dso);
496 my $objs = join("\n", map { $_.$objext } @{$args{objs}});
497 my $linklibs = join("",
498 map { "\n$_" } compute_lib_depends(@{$args{deps}}));
500 (map { $_.$objext } @{$args{objs}}),
501 compute_lib_depends(@{$args{deps}}));
504 IF EXIST $dso$dsoext.manifest DEL /F /Q $dso$dsoext.manifest
505 \$(LD) \$(LDFLAGS) \$(DSO_LDFLAGS) \$(LDOUTFLAG)$dso$dsoext /def:<< @<<
511 $objs$linklibs \$(EX_LIBS)
513 IF EXIST $dso$dsoext.manifest \\
514 \$(MT) \$(MTFLAGS) \$(MTINFLAG)$dso$dsoext.manifest \$(MTOUTFLAG)$dso$dsoext
518 # Because static libs and import libs are both named the same in native
519 # Windows, we can't have both. We skip the static lib in that case,
520 # as the shared libs are what we use anyway.
521 return "" unless $disabled{"shared"};
524 my $lib = $args{lib};
525 my $objs = join("\n", map { $_.$objext } @{$args{objs}});
526 my $deps = join(" ", map { $_.$objext } @{$args{objs}});
529 \$(AR) \$(ARFLAGS) \$(AROUTFLAG)$lib$libext @<<
536 my $bin = $args{bin};
537 my $objs = join("\n", map { $_.$objext } @{$args{objs}});
538 my $linklibs = join("",
539 map { "\n$_" } compute_lib_depends(@{$args{deps}}));
541 (map { $_.$objext } @{$args{objs}}),
542 compute_lib_depends(@{$args{deps}}));
545 IF EXIST $bin$exeext.manifest DEL /F /Q $bin$exeext.manifest
546 \$(LD) \$(LDFLAGS) \$(BIN_LDFLAGS) \$(LDOUTFLAG)$bin$exeext @<<
547 $objs setargv.obj$linklibs \$(EX_LIBS)
549 IF EXIST $bin$exeext.manifest \\
550 \$(MT) \$(MTFLAGS) \$(MTINFLAG)$bin$exeext.manifest \$(MTOUTFLAG)$bin$exeext
555 my $script = $args{script};
556 my $sources = '"'.join('" "', @{$args{sources}}).'"';
557 my $dofile = abs2rel(rel2abs(catfile($config{sourcedir},
558 "util", "dofile.pl")),
559 rel2abs($config{builddir}));
562 "\$(PERL)" "-I\$(BLDDIR)" -Mconfigdata "$dofile" \\
563 "-o$target{build_file}" $sources > "$script"
568 my $dir = $args{dir};
569 my @deps = map { s|\.o$|$objext|; $_ } @{$args{deps}};
571 my %extinfo = ( dso => $dsoext,
575 foreach my $type (("dso", "lib", "bin", "script")) {
576 next unless defined($unified_info{dirinfo}->{$dir}->{products}->{$type});
577 # For lib object files, we could update the library. However,
578 # LIB on Windows doesn't work that way, so we won't create any
579 # actions for it, and the dependencies are already taken care of.
580 if ($type ne "lib") {
581 foreach my $prod (@{$unified_info{dirinfo}->{$dir}->{products}->{$type}}) {
582 if (dirname($prod) eq $dir) {
583 push @deps, $prod.$extinfo{$type};
585 push @actions, "\t@rem No support to produce $type ".join(", ", @{$unified_info{dirinfo}->{$dir}->{products}->{$type}});
591 my $deps = join(" ", @deps);
592 my $actions = join("\n", "", @actions);
594 $args{dir} $args{dir}\\ : $deps$actions
597 "" # Important! This becomes part of the template result.