2 ## Makefile for OpenSSL
4 ## {- join("\n## ", @autowarntext) -}
9 our $sover_dirname = platform->shlib_version_as_filename();
11 my $build_scheme = $target{build_scheme};
12 my $install_flavour = $build_scheme->[$#$build_scheme]; # last element
14 $install_flavour eq "VC-WOW" ? "ProgramFiles(x86)"
17 $install_flavour eq "VC-WOW" ? "CommonProgramFiles(x86)"
18 : "CommonProgramW6432";
19 our $win_installroot =
20 defined($ENV{$win_installenv}) ? $win_installenv : 'ProgramFiles';
22 defined($ENV{$win_commonenv}) ? $win_commonenv : 'CommonProgramFiles';
24 # expand variables early
25 $win_installroot = $ENV{$win_installroot};
26 $win_commonroot = $ENV{$win_commonroot};
28 # This makes sure things get built in the order they need
33 return "$target: build_generated\n\t\$(MAKE) /\$(MAKEFLAGS) depend\n\t\$(MAKE) /\$(MAKEFLAGS) _$target\n_$target";
38 PLATFORM={- $config{target} -}
39 SRCDIR={- $config{sourcedir} -}
40 BLDDIR={- $config{builddir} -}
41 FIPSKEY={- $config{FIPSKEY} -}
43 VERSION={- "$config{full_version}" -}
44 MAJOR={- $config{major} -}
45 MINOR={- $config{minor} -}
47 SHLIB_VERSION_NUMBER={- $config{shlib_version} -}
49 LIBS={- join(" ", map { ( platform->sharedlib_import($_), platform->staticlib($_) ) } @{$unified_info{libraries}}) -}
50 SHLIBS={- join(" ", map { platform->sharedlib($_) // () } @{$unified_info{libraries}}) -}
51 SHLIBPDBS={- join(" ", map { platform->sharedlibpdb($_) // () } @{$unified_info{libraries}}) -}
52 MODULES={- our @MODULES = map { platform->dso($_) }
53 # Drop all modules that are dependencies, they will
54 # be processed through their dependents
56 !grep { grep { $_ eq $x } @$_ }
57 values %{$unified_info{depends}} }
58 @{$unified_info{modules}};
59 join(" ", @MODULES) -}
60 MODULEPDBS={- join(" ", map { platform->dsopdb($_) } @{$unified_info{modules}}) -}
61 FIPSMODULE={- # We do some extra checking here, as there should be only one
64 grep { !$unified_info{attributes}->{modules}->{$_}->{noinst}
65 && $unified_info{attributes}->{modules}->{$_}->{fips} }
66 @{$unified_info{modules}};
67 die "More that one FIPS module" if scalar @fipsmodules > 1;
68 join(" ", map { basename(platform->dso($_)) } @fipsmodules) -}
69 FIPSMODULENAME={- die "More that one FIPS module" if scalar @fipsmodules > 1;
70 join(", ", map { basename(platform->dso($_)) } @fipsmodules) -}
71 PROGRAMS={- our @PROGRAMS = map { platform->bin($_) } @{$unified_info{programs}}; join(" ", @PROGRAMS) -}
72 PROGRAMPDBS={- join(" ", map { $_.".pdb" } @{$unified_info{programs}}) -}
73 SCRIPTS={- our @SCRIPTS = @{$unified_info{scripts}}; join(" ", @SCRIPTS) -}
74 {- output_off() if $disabled{makedepend}; "" -}
75 DEPS={- join(" ", map { platform->isobj($_) ? platform->dep($_) : () }
76 grep { $unified_info{sources}->{$_}->[0] =~ /\.c$/ }
77 keys %{$unified_info{sources}}); -}
78 {- output_on() if $disabled{makedepend}; "" -}
79 GENERATED_MANDATORY={- our @GENERATED_MANDATORY = @{$unified_info{depends}->{""}};
80 join(" ", @GENERATED_MANDATORY) -}
81 GENERATED={- # common0.tmpl provides @generated
82 our @GENERATED = map { platform->convertext($_) } @generated;
83 join(" ", @GENERATED) -}
86 join(" ", map { quotify1(platform->sharedlib_import($_)
87 // platform->staticlib($_)) }
88 grep { !$unified_info{attributes}->{libraries}->{$_}->{noinst} }
89 @{$unified_info{libraries}})
92 join(" ", map { my $x = platform->sharedlib($_);
93 $x ? quotify_l($x) : () }
94 grep { !$unified_info{attributes}->{libraries}->{$_}->{noinst} }
95 @{$unified_info{libraries}})
98 join(" ", map { my $x = platform->sharedlibpdb($_);
99 $x ? quotify_l($x) : () }
100 grep { !$unified_info{attributes}->{libraries}->{$_}->{noinst} }
101 @{$unified_info{libraries}})
104 join(" ", map { quotify1(platform->dso($_)) }
105 grep { !$unified_info{attributes}->{modules}->{$_}->{noinst}
106 && $unified_info{attributes}->{modules}->{$_}->{engine} }
107 @{$unified_info{modules}})
109 INSTALL_ENGINEPDBS={-
110 join(" ", map { quotify1(platform->dsopdb($_)) }
111 grep { !$unified_info{attributes}->{modules}->{$_}->{noinst}
112 && $unified_info{attributes}->{modules}->{$_}->{engine} }
113 @{$unified_info{modules}})
116 join(" ", map { quotify1(platform->dso($_)) }
117 grep { !$unified_info{attributes}->{modules}->{$_}->{noinst}
118 && $unified_info{attributes}->{modules}->{$_}->{fips} }
119 @{$unified_info{modules}})
122 join(" ", map { quotify1(platform->dso($_)) }
123 grep { !$unified_info{attributes}->{modules}->{$_}->{noinst}
124 && !$unified_info{attributes}->{modules}->{$_}->{engine}
125 && !$unified_info{attributes}->{modules}->{$_}->{fips} }
126 @{$unified_info{modules}})
128 INSTALL_MODULEPDBS={-
129 join(" ", map { quotify1(platform->dsopdb($_)) }
130 grep { !$unified_info{attributes}->{modules}->{$_}->{noinst}
131 && !$unified_info{attributes}->{modules}->{$_}->{engine} }
132 @{$unified_info{modules}})
135 join(" ", map { quotify1(platform->bin($_)) }
136 grep { !$unified_info{attributes}->{programs}->{$_}->{noinst} }
137 @{$unified_info{programs}})
139 INSTALL_PROGRAMPDBS={-
140 join(" ", map { quotify1(platform->binpdb($_)) }
141 grep { !$unified_info{attributes}->{programs}->{$_}->{noinst} }
142 @{$unified_info{programs}})
145 join(" ", map { quotify1($_) }
146 grep { !$unified_info{attributes}->{scripts}->{$_}->{noinst}
147 && !$unified_info{attributes}->{scripts}->{$_}->{misc} }
148 @{$unified_info{scripts}})
151 join(" ", map { quotify1($_) }
152 grep { !$unified_info{attributes}->{scripts}->{$_}->{noinst}
153 && $unified_info{attributes}->{scripts}->{$_}->{misc} }
154 @{$unified_info{scripts}})
156 IMAGEDOCS1={- our @IMAGEDOCS1 = @{$unified_info{imagedocs}->{man1}};
157 join(" ", @IMAGEDOCS1) -}
158 IMAGEDOCS3={- our @IMAGEDOCS3 = @{$unified_info{imagedocs}->{man3}};
159 join(" ", @IMAGEDOCS3) -}
160 IMAGEDOCS5={- our @IMAGEDOCS5 = @{$unified_info{imagedocs}->{man5}};
161 join(" ", @IMAGEDOCS5) -}
162 IMAGEDOCS7={- our @IMAGEDOCS7 = @{$unified_info{imagedocs}->{man7}};
163 join(" ", @IMAGEDOCS7) -}
164 HTMLDOCS1={- our @HTMLDOCS1 = @{$unified_info{htmldocs}->{man1}};
165 join(" ", @HTMLDOCS1) -}
166 HTMLDOCS3={- our @HTMLDOCS3 = @{$unified_info{htmldocs}->{man3}};
167 join(" ", @HTMLDOCS3) -}
168 HTMLDOCS5={- our @HTMLDOCS5 = @{$unified_info{htmldocs}->{man5}};
169 join(" ", @HTMLDOCS5) -}
170 HTMLDOCS7={- our @HTMLDOCS7 = @{$unified_info{htmldocs}->{man7}};
171 join(" ", @HTMLDOCS7) -}
172 HTMLDOCS1_BLDDIRS={- my %dirs = map { dirname($_) => 1 } @HTMLDOCS1;
173 join(' ', sort keys %dirs) -}
174 HTMLDOCS3_BLDDIRS={- my %dirs = map { dirname($_) => 1 } @HTMLDOCS3;
175 join(' ', sort keys %dirs) -}
176 HTMLDOCS5_BLDDIRS={- my %dirs = map { dirname($_) => 1 } @HTMLDOCS5;
177 join(' ', sort keys %dirs) -}
178 HTMLDOCS7_BLDDIRS={- my %dirs = map { dirname($_) => 1 } @HTMLDOCS7;
179 join(' ', sort keys %dirs) -}
181 APPS_OPENSSL="{- use File::Spec::Functions;
182 catfile("apps","openssl") -}"
184 # Do not edit these manually. Use Configure with --prefix or --openssldir
185 # to change this! Short explanation in the top comment in Configure
186 INSTALLTOP_dev={- # $prefix is used in the OPENSSLDIR perl snippet
188 use File::Spec::Functions qw(:DEFAULT splitpath);
189 our $prefix = canonpath($config{prefix}
190 || "$win_installroot\\OpenSSL");
191 our ($prefix_dev, $prefix_dir, $prefix_file) =
192 splitpath($prefix, 1);
194 INSTALLTOP_dir={- canonpath($prefix_dir) -}
196 # The logic here is that if no --openssldir was given,
197 # OPENSSLDIR will get the value "$win_commonroot\\SSL".
198 # If --openssldir was given and the value is an absolute
199 # path, OPENSSLDIR will get its value without change.
200 # If the value from --openssldir is a relative path,
201 # OPENSSLDIR will get $prefix with the --openssldir
202 # value appended as a subdirectory.
204 use File::Spec::Functions qw(:DEFAULT splitpath);
206 $config{openssldir} ?
207 (file_name_is_absolute($config{openssldir}) ?
208 canonpath($config{openssldir})
209 : catdir($prefix, $config{openssldir}))
210 : canonpath("$win_commonroot\\SSL");
211 our ($openssldir_dev, $openssldir_dir, $openssldir_file) =
212 splitpath($openssldir, 1);
214 OPENSSLDIR_dir={- canonpath($openssldir_dir) -}
215 LIBDIR={- our $libdir = $config{libdir} || "lib";
216 file_name_is_absolute($libdir) ? "" : $libdir -}
217 MODULESDIR_dev={- use File::Spec::Functions qw(:DEFAULT splitpath catpath);
218 our $modulesprefix = catdir($prefix,$libdir);
219 our ($modulesprefix_dev, $modulesprefix_dir,
220 $modulesprefix_file) =
221 splitpath($modulesprefix, 1);
222 our $modulesdir_dev = $modulesprefix_dev;
223 our $modulesdir_dir =
224 catdir($modulesprefix_dir, "ossl-modules");
225 our $modulesdir = catpath($modulesdir_dev, $modulesdir_dir);
226 our $enginesdir_dev = $modulesprefix_dev;
227 our $enginesdir_dir =
228 catdir($modulesprefix_dir, "engines-$sover_dirname");
229 our $enginesdir = catpath($enginesdir_dev, $enginesdir_dir);
231 MODULESDIR_dir={- canonpath($modulesdir_dir) -}
232 ENGINESDIR_dev={- $enginesdir_dev -}
233 ENGINESDIR_dir={- canonpath($enginesdir_dir) -}
234 !IF "$(DESTDIR)" != ""
235 INSTALLTOP=$(DESTDIR)$(INSTALLTOP_dir)
236 OPENSSLDIR=$(DESTDIR)$(OPENSSLDIR_dir)
237 ENGINESDIR=$(DESTDIR)$(ENGINESDIR_dir)
238 MODULESDIR=$(DESTDIR)$(MODULESDIR_dir)
240 INSTALLTOP=$(INSTALLTOP_dev)$(INSTALLTOP_dir)
241 OPENSSLDIR=$(OPENSSLDIR_dev)$(OPENSSLDIR_dir)
242 ENGINESDIR=$(ENGINESDIR_dev)$(ENGINESDIR_dir)
243 MODULESDIR=$(MODULESDIR_dev)$(MODULESDIR_dir)
246 # $(libdir) is chosen to be compatible with the GNU coding standards
247 libdir={- file_name_is_absolute($libdir)
248 ? $libdir : '$(INSTALLTOP)\$(LIBDIR)' -}
250 ##### User defined commands and flags ################################
252 CC="{- $config{CC} -}"
253 CPP={- $config{CPP} -}
254 CPPFLAGS={- our $cppflags1 = join(" ",
255 (map { "-D".$_} @{$config{CPPDEFINES}}),
256 (map { " -I".$_} @{$config{CPPINCLUDES}}),
257 @{$config{CPPFLAGS}}) -}
258 CFLAGS={- join(' ', @{$config{CFLAGS}}) -}
259 LD="{- $config{LD} -}"
260 LDFLAGS={- join(' ', @{$config{LDFLAGS}}) -}
261 EX_LIBS={- join(' ', @{$config{LDLIBS}}) -}
263 PERL={- $config{PERL} -}
265 AR="{- $config{AR} -}"
266 ARFLAGS= {- join(' ', @{$config{ARFLAGS}}) -}
268 MT="{- $config{MT} -}"
269 MTFLAGS= {- join(' ', @{$config{MTFLAGS}}) -}
271 AS="{- $config{AS} -}"
272 ASFLAGS={- join(' ', @{$config{ASFLAGS}}) -}
274 RC="{- $config{RC} -}"
275 RCFLAGS={- join(' ', @{$config{RCFLAGS}}) -}
277 ECHO="$(PERL)" "$(SRCDIR)\util\echo.pl"
279 ##### Special command flags ##########################################
281 COUTFLAG={- $target{coutflag} -}$(OSSL_EMPTY)
282 LDOUTFLAG={- $target{ldoutflag} -}$(OSSL_EMPTY)
283 AROUTFLAG={- $target{aroutflag} -}$(OSSL_EMPTY)
284 MTINFLAG={- $target{mtinflag} -}$(OSSL_EMPTY)
285 MTOUTFLAG={- $target{mtoutflag} -}$(OSSL_EMPTY)
286 ASOUTFLAG={- $target{asoutflag} -}$(OSSL_EMPTY)
287 RCOUTFLAG={- $target{rcoutflag} -}$(OSSL_EMPTY)
289 ##### Project flags ##################################################
291 # Variables starting with CNF_ are common variables for all product types
293 CNF_ASFLAGS={- join(' ', $target{asflags} || (),
294 @{$config{asflags}}) -}
295 CNF_CPPFLAGS={- our $cppfags2 =
296 join(' ', $target{cppflags} || (),
297 (map { '-D'.quotify1($_) } @{$target{defines}},
298 @{$config{defines}}),
299 (map { '-I'.'"'.$_.'"' } @{$target{includes}},
300 @{$config{includes}}),
301 @{$config{cppflags}}) -}
302 CNF_CFLAGS={- join(' ', $target{cflags} || (),
303 @{$config{cflags}}) -}
304 CNF_CXXFLAGS={- join(' ', $target{cxxflags} || (),
305 @{$config{cxxflags}}) -}
306 CNF_LDFLAGS={- join(' ', $target{lflags} || (),
307 @{$config{lflags}}) -}
308 CNF_EX_LIBS={- join(' ', $target{ex_libs} || (),
309 @{$config{ex_libs}}) -}
311 # Variables starting with LIB_ are used to build library object files
312 # and shared libraries.
313 # Variables starting with DSO_ are used to build DSOs and their object files.
314 # Variables starting with BIN_ are used to build programs and their object
317 LIB_ASFLAGS={- join(' ', $target{lib_asflags} || (),
318 @{$config{lib_asflags}},
319 '$(CNF_ASFLAGS)', '$(ASFLAGS)') -}
320 LIB_CPPFLAGS={- our $lib_cppflags =
321 join(' ', $target{lib_cppflags} || (),
322 $target{shared_cppflag} || (),
323 (map { '-D'.quotify1($_) }
324 @{$target{lib_defines}},
325 @{$target{shared_defines}},
326 @{$config{lib_defines}},
327 @{$config{shared_defines}}),
328 (map { '-I'.quotify1($_) }
329 @{$target{lib_includes}},
330 @{$target{shared_includes}},
331 @{$config{lib_includes}},
332 @{$config{shared_includes}}),
333 @{$config{lib_cppflags}},
334 @{$config{shared_cppflag}});
335 join(' ', $lib_cppflags,
336 (map { '-D'.quotify1($_) }
337 "OPENSSLDIR=\"$openssldir\"",
338 "ENGINESDIR=\"$enginesdir\"",
339 "MODULESDIR=\"$modulesdir\""),
340 '$(CNF_CPPFLAGS)', '$(CPPFLAGS)') -}
341 LIB_CFLAGS={- join(' ', $target{lib_cflags} || (),
342 $target{shared_cflag} || (),
343 @{$config{lib_cflags}},
344 @{$config{shared_cflag}},
345 '$(CNF_CFLAGS)', '$(CFLAGS)') -}
346 LIB_LDFLAGS={- join(' ', $target{shared_ldflag} || (),
347 $config{shared_ldflag} || (),
348 '$(CNF_LDFLAGS)', '$(LDFLAGS)') -}
349 LIB_EX_LIBS=$(CNF_EX_LIBS) $(EX_LIBS)
350 DSO_ASFLAGS={- join(' ', $target{dso_asflags} || (),
351 $target{module_asflags} || (),
352 @{$config{dso_asflags}},
353 @{$config{module_asflags}},
354 '$(CNF_ASFLAGS)', '$(ASFLAGS)') -}
355 DSO_CPPFLAGS={- join(' ', $target{dso_cppflags} || (),
356 $target{module_cppflag} || (),
357 (map { '-D'.quotify1($_) }
358 @{$target{dso_defines}},
359 @{$target{module_defines}},
360 @{$config{dso_defines}},
361 @{$config{module_defines}}),
362 (map { '-I'.quotify1($_) }
363 @{$target{dso_includes}},
364 @{$target{module_includes}},
365 @{$config{dso_includes}},
366 @{$config{module_includes}}),
367 @{$config{dso_cppflags}},
368 @{$config{module_cppflags}},
369 '$(CNF_CPPFLAGS)', '$(CPPFLAGS)') -}
370 DSO_CFLAGS={- join(' ', $target{dso_cflags} || (),
371 $target{module_cflags} || (),
372 @{$config{dso_cflags}},
373 @{$config{module_cflags}},
374 '$(CNF_CFLAGS)', '$(CFLAGS)') -}
375 DSO_LDFLAGS={- join(' ', $target{dso_lflags} || (),
376 $target{module_ldflags} || (),
377 @{$config{dso_lflags}},
378 @{$config{module_ldflags}},
379 '$(CNF_LDFLAGS)', '$(LDFLAGS)') -}
380 DSO_EX_LIBS=$(CNF_EX_LIBS) $(EX_LIBS)
381 BIN_ASFLAGS={- join(' ', $target{bin_asflags} || (),
382 @{$config{bin_asflags}},
383 '$(CNF_ASFLAGS)', '$(ASFLAGS)') -}
384 BIN_CPPFLAGS={- join(' ', $target{bin_cppflags} || (),
385 (map { '-D'.$_ } @{$config{bin_defines} || ()}),
386 @{$config{bin_cppflags}},
387 '$(CNF_CPPFLAGS)', '$(CPPFLAGS)') -}
388 BIN_CFLAGS={- join(' ', $target{bin_cflags} || (),
389 @{$config{bin_cflags}},
390 '$(CNF_CFLAGS)', '$(CFLAGS)') -}
391 BIN_LDFLAGS={- join(' ', $target{bin_lflags} || (),
392 @{$config{bin_lflags}},
393 '$(CNF_LDFLAGS)', '$(LDFLAGS)') -}
394 BIN_EX_LIBS=$(CNF_EX_LIBS) $(EX_LIBS)
396 # CPPFLAGS_Q is used for one thing only: to build up buildinf.h
397 CPPFLAGS_Q={- $cppflags1 =~ s|([\\"])|\\$1|g;
398 $cppflags2 =~ s|([\\"])|\\$1|g;
399 join(' ', $lib_cppflags || (), $cppflags2 || (),
402 PERLASM_SCHEME= {- $target{perlasm_scheme} -}
404 PROCESSOR= {- $config{processor} -}
406 # The main targets ###################################################
408 {- dependmagic('build_sw'); -}: build_libs_nodep build_modules_nodep build_programs_nodep copy-utils
409 {- dependmagic('build_libs'); -}: build_libs_nodep
410 {- dependmagic('build_modules'); -}: build_modules_nodep
411 {- dependmagic('build_programs'); -}: build_programs_nodep
413 build_docs: build_html_docs
414 build_html_docs: $(HTMLDOCS1) $(HTMLDOCS3) $(HTMLDOCS5) $(HTMLDOCS7)
416 build_generated: $(GENERATED_MANDATORY)
418 build_libs_nodep: $(LIBS) {- join(" ",map { platform->sharedlib_import($_) // () } @{$unified_info{libraries}}) -}
420 build_modules_nodep: $(MODULES)
422 build_programs_nodep: $(PROGRAMS) $(SCRIPTS)
425 # Kept around for backward compatibility
426 build_apps build_tests: build_programs
428 # Convenience target to prebuild all generated files, not just the mandatory
430 build_all_generated: $(GENERATED_MANDATORY) $(GENERATED) build_docs
431 @{- output_off() if $disabled{makedepend}; "" -}
432 @$(ECHO) "Warning: consider configuring with no-makedepend, because if"
433 @$(ECHO) " target system doesn't have $(PERL),"
434 @$(ECHO) " then make will fail..."
435 @{- output_on() if $disabled{makedepend}; "" -}
437 all: build_sw build_docs
440 {- dependmagic('tests'); -}: build_programs_nodep build_modules_nodep copy-utils
441 @{- output_off() if $disabled{tests}; "" -}
442 cmd /C "set "SRCTOP=$(SRCDIR)" & set "BLDTOP=$(BLDDIR)" & set "PERL=$(PERL)" & set "FIPSKEY=$(FIPSKEY)" & "$(PERL)" "$(SRCDIR)\test\run_tests.pl" $(TESTS)"
443 @{- if ($disabled{tests}) { output_on(); } else { output_off(); } "" -}
444 @$(ECHO) "Tests are not supported with your chosen Configure options"
445 @{- output_on() if !$disabled{tests}; "" -}
448 @{- output_off() if $disabled{tests}; "" -}
449 @cmd /C "set "SRCTOP=$(SRCDIR)" & "$(PERL)" "$(SRCDIR)\test\run_tests.pl" list"
450 @{- if ($disabled{tests}) { output_on(); } else { output_off(); } "" -}
451 @$(ECHO) "Tests are not supported with your chosen Configure options"
452 @{- output_on() if !$disabled{tests}; "" -}
454 install: install_sw install_ssldirs install_docs
456 uninstall: uninstall_docs uninstall_sw
459 "$(PERL)" -e "map { m/(.*)\.dll$$/; unlink glob """{.,apps,test,fuzz}/$$1.*"""; } @ARGV" $(SHLIBS)
460 -del /Q /F $(LIBS) libcrypto.* libssl.* ossl_static.pdb
463 -rmdir /Q /S $(HTMLDOCS1_BLDDIRS)
464 -rmdir /Q /S $(HTMLDOCS3_BLDDIRS)
465 -rmdir /Q /S $(HTMLDOCS5_BLDDIRS)
466 -rmdir /Q /S $(HTMLDOCS7_BLDDIRS)
467 {- join("\n\t", map { "-del /Q /F $_" } @PROGRAMS) -}
468 {- join("\n\t", map { "-del /Q /F $_" } @MODULES) -}
469 {- join("\n\t", map { "-del /Q /F $_" } @SCRIPTS) -}
470 {- join("\n\t", map { "-del /Q /F $_" } @GENERATED_MANDATORY) -}
471 {- join("\n\t", map { "-del /Q /F $_" } @GENERATED) -}
472 -del /Q /S /F *.d *.obj *.pdb *.ilk *.manifest
473 -del /Q /S /F engines\*.lib engines\*.exp
474 -del /Q /S /F apps\*.lib apps\*.rc apps\*.res apps\*.exp
475 -del /Q /S /F test\*.exp
476 -rmdir /Q /S test\test-runs
479 -del /Q /F configdata.pm
483 @ {- output_off() if $disabled{makedepend}; "" -}
484 @ "$(PERL)" "$(SRCDIR)\util\add-depends.pl" "{- $target{makedep_scheme} -}"
485 @ {- output_on() if $disabled{makedepend}; "" -}
487 # Install helper targets #############################################
489 install_sw: install_dev install_engines install_modules install_runtime
491 uninstall_sw: uninstall_runtime uninstall_modules uninstall_engines uninstall_dev
493 install_docs: install_html_docs
495 uninstall_docs: uninstall_html_docs
497 {- output_off() if $disabled{fips}; "" -}
498 install_fips: build_sw providers\fipsmodule.cnf
499 # @[ -n "$(INSTALLTOP)" ] || (echo INSTALLTOP should not be empty; exit 1)
500 @$(PERL) $(SRCDIR)\util\mkdir-p.pl $(MODULESDIR)
501 @$(ECHO) "*** Installing FIPS module"
502 @$(ECHO) "install $(INSTALL_FIPS) -> $(MODULESDIR)\$(FIPSMODULENAME)"
503 @copy "$(INSTALL_FIPS)" $(MODULESDIR)\$(FIPSMODULENAME).new
504 @move /Y $(MODULESDIR)\$(FIPSMODULENAME).new \
505 $(MODULESDIR)\$(FIPSMODULENAME)
506 @$(ECHO) "*** Installing FIPS module configuration"
507 @$(ECHO) "install providers\fipsmodule.cnf -> $(OPENSSLDIR)\fipsmodule.cnf"
508 @copy providers\fipsmodule.cnf "$(OPENSSLDIR)\fipsmodule.cnf"
511 @$(ECHO) "*** Uninstalling FIPS module configuration"
512 $(RM) "$(OPENSSLDIR)\fipsmodule.cnf"
513 @$(ECHO) "*** Uninstalling FIPS module"
514 $(RM) "$(MODULESDIR)\$(FIPSMODULENAME)"
515 {- if ($disabled{fips}) { output_on(); } else { output_off(); } "" -}
517 @$(ECHO) "The 'install_fips' target requires the 'enable-fips' option"
520 @$(ECHO) "The 'uninstall_fips' target requires the 'enable-fips' option"
521 {- output_on() if !$disabled{fips}; "" -}
524 @"$(PERL)" "$(SRCDIR)\util\mkdir-p.pl" "$(OPENSSLDIR)\certs"
525 @"$(PERL)" "$(SRCDIR)\util\mkdir-p.pl" "$(OPENSSLDIR)\private"
526 @"$(PERL)" "$(SRCDIR)\util\mkdir-p.pl" "$(OPENSSLDIR)\misc"
527 @"$(PERL)" "$(SRCDIR)\util\copy.pl" "$(SRCDIR)\apps\openssl.cnf" \
528 "$(OPENSSLDIR)\openssl.cnf.dist"
529 @IF NOT EXIST "$(OPENSSLDIR)\openssl.cnf" \
530 "$(PERL)" "$(SRCDIR)\util\copy.pl" "$(SRCDIR)\apps\openssl.cnf" \
531 "$(OPENSSLDIR)\openssl.cnf"
532 @if not "$(MISC_SCRIPTS)"=="" \
533 "$(PERL)" "$(SRCDIR)\util\copy.pl" $(MISC_SCRIPTS) \
535 @"$(PERL)" "$(SRCDIR)\util\copy.pl" "$(SRCDIR)\apps\ct_log_list.cnf" \
536 "$(OPENSSLDIR)\ct_log_list.cnf.dist"
537 @IF NOT EXIST "$(OPENSSLDIR)\ct_log_list.cnf" \
538 "$(PERL)" "$(SRCDIR)\util\copy.pl" "$(SRCDIR)\apps\ct_log_list.cnf" \
539 "$(OPENSSLDIR)\ct_log_list.cnf"
541 install_dev: install_runtime_libs
542 @if "$(INSTALLTOP)"=="" ( $(ECHO) "INSTALLTOP should not be empty" & exit 1 )
543 @$(ECHO) "*** Installing development files"
544 @"$(PERL)" "$(SRCDIR)\util\mkdir-p.pl" "$(INSTALLTOP)\include\openssl"
545 @{- output_off() unless grep { $_ eq "OPENSSL_USE_APPLINK" } (@{$target{defines}}, @{$config{defines}}); "" -}
546 @"$(PERL)" "$(SRCDIR)\util\copy.pl" "$(SRCDIR)\ms\applink.c" \
547 "$(INSTALLTOP)\include\openssl"
548 @{- output_on() unless grep { $_ eq "OPENSSL_USE_APPLINK" } (@{$target{defines}}, @{$config{defines}}); "" -}
549 @"$(PERL)" "$(SRCDIR)\util\copy.pl" "-exclude_re=/__DECC_" \
550 "$(SRCDIR)\include\openssl\*.h" \
551 "$(INSTALLTOP)\include\openssl"
552 @"$(PERL)" "$(SRCDIR)\util\copy.pl" "$(BLDDIR)\include\openssl\*.h" \
553 "$(INSTALLTOP)\include\openssl"
554 @"$(PERL)" "$(SRCDIR)\util\mkdir-p.pl" "$(libdir)"
555 @"$(PERL)" "$(SRCDIR)\util\copy.pl" $(INSTALL_LIBS) "$(libdir)"
556 @if "$(SHLIBS)"=="" \
557 "$(PERL)" "$(SRCDIR)\util\copy.pl" ossl_static.pdb "$(libdir)"
561 _install_modules_deps: install_runtime_libs build_modules
563 install_engines: _install_modules_deps
564 @if "$(INSTALLTOP)"=="" ( $(ECHO) "INSTALLTOP should not be empty" & exit 1 )
565 @$(ECHO) "*** Installing engines"
566 @"$(PERL)" "$(SRCDIR)\util\mkdir-p.pl" "$(ENGINESDIR)"
567 @if not "$(INSTALL_ENGINES)"=="" \
568 "$(PERL)" "$(SRCDIR)\util\copy.pl" $(INSTALL_ENGINES) "$(ENGINESDIR)"
569 @if not "$(INSTALL_ENGINES)"=="" \
570 "$(PERL)" "$(SRCDIR)\util\copy.pl" $(INSTALL_ENGINEPDBS) "$(ENGINESDIR)"
574 install_modules: _install_modules_deps
575 @if "$(INSTALLTOP)"=="" ( $(ECHO) "INSTALLTOP should not be empty" & exit 1 )
576 @$(ECHO) "*** Installing modules"
577 @"$(PERL)" "$(SRCDIR)\util\mkdir-p.pl" "$(MODULESDIR)"
578 @if not "$(INSTALL_MODULES)"=="" \
579 "$(PERL)" "$(SRCDIR)\util\copy.pl" $(INSTALL_MODULES) "$(MODULESDIR)"
580 @if not "$(INSTALL_MODULES)"=="" \
581 "$(PERL)" "$(SRCDIR)\util\copy.pl" $(INSTALL_MODULEPDBS) "$(MODULESDIR)"
585 install_runtime: install_programs
587 install_runtime_libs: build_libs
588 @if "$(INSTALLTOP)"=="" ( $(ECHO) "INSTALLTOP should not be empty" & exit 1 )
589 @$(ECHO) "*** Installing runtime libraries"
590 @"$(PERL)" "$(SRCDIR)\util\mkdir-p.pl" "$(INSTALLTOP)\bin"
591 @if not "$(SHLIBS)"=="" \
592 "$(PERL)" "$(SRCDIR)\util\copy.pl" $(INSTALL_SHLIBS) "$(INSTALLTOP)\bin"
593 @if not "$(SHLIBS)"=="" \
594 "$(PERL)" "$(SRCDIR)\util\copy.pl" $(INSTALL_SHLIBPDBS) \
597 install_programs: install_runtime_libs build_programs
598 @if "$(INSTALLTOP)"=="" ( $(ECHO) "INSTALLTOP should not be empty" & exit 1 )
599 @$(ECHO) "*** Installing runtime programs"
600 @if not "$(INSTALL_PROGRAMS)"=="" \
601 "$(PERL)" "$(SRCDIR)\util\mkdir-p.pl" "$(INSTALLTOP)\bin"
602 @if not "$(INSTALL_PROGRAMS)"=="" \
603 "$(PERL)" "$(SRCDIR)\util\copy.pl" $(INSTALL_PROGRAMS) \
605 @if not "$(INSTALL_PROGRAMS)"=="" \
606 "$(PERL)" "$(SRCDIR)\util\copy.pl" $(INSTALL_PROGRAMPDBS) \
608 @if not "$(INSTALL_PROGRAMS)"=="" \
609 "$(PERL)" "$(SRCDIR)\util\copy.pl" $(BIN_SCRIPTS) \
614 install_html_docs: install_image_docs build_html_docs
615 @if "$(INSTALLTOP)"=="" ( echo INSTALLTOP should not be empty & exit 1 )
616 @echo *** Installing HTML docs
617 @"$(PERL)" "$(SRCDIR)\util\mkdir-p.pl" "$(INSTALLTOP)\html\man1"
618 @"$(PERL)" "$(SRCDIR)\util\mkdir-p.pl" "$(INSTALLTOP)\html\man3"
619 @"$(PERL)" "$(SRCDIR)\util\mkdir-p.pl" "$(INSTALLTOP)\html\man5"
620 @"$(PERL)" "$(SRCDIR)\util\mkdir-p.pl" "$(INSTALLTOP)\html\man7"
621 @"$(PERL)" "$(SRCDIR)\util\copy.pl" $(BLDDIR)\doc\html\man1\*.html \
622 "$(INSTALLTOP)\html\man1"
623 @"$(PERL)" "$(SRCDIR)\util\copy.pl" $(BLDDIR)\doc\html\man3\*.html \
624 "$(INSTALLTOP)\html\man3"
625 @"$(PERL)" "$(SRCDIR)\util\copy.pl" $(BLDDIR)\doc\html\man5\*.html \
626 "$(INSTALLTOP)\html\man5"
627 @"$(PERL)" "$(SRCDIR)\util\copy.pl" $(BLDDIR)\doc\html\man7\*.html \
628 "$(INSTALLTOP)\html\man7"
630 uninstall_html_docs: uninstall_image_docs
633 @if "$(INSTALLTOP)"=="" ( echo INSTALLTOP should not be empty & exit 1 )
634 @echo *** Installing HTML images
635 @"$(PERL)" "$(SRCDIR)\util\mkdir-p.pl" "$(INSTALLTOP)\html\man7\img"
636 @"$(PERL)" "$(SRCDIR)\util\copy.pl" $(SRCDIR)\doc\man7\img\*.png \
637 "$(INSTALLTOP)\html\man7\img"
639 uninstall_image_docs:
641 # Helper targets #####################################################
643 copy-utils: $(BLDDIR)\util\wrap.pl $(BLDDIR)\apps\openssl.cnf
645 $(BLDDIR)\util\wrap.pl: configdata.pm
646 @if NOT EXIST "$(BLDDIR)\util" mkdir "$(BLDDIR)\util"
647 @if NOT "$(SRCDIR)"=="$(BLDDIR)" copy "$(SRCDIR)\util\$(@F)" "$(BLDDIR)\util"
649 $(BLDDIR)\apps\openssl.cnf: configdata.pm
650 @if NOT EXIST "$(BLDDIR)\apps" mkdir "$(BLDDIR)\apps"
651 @if NOT "$(SRCDIR)"=="$(BLDDIR)" copy "$(SRCDIR)\apps\$(@F)" "$(BLDDIR)\apps"
653 # Building targets ###################################################
655 configdata.pm: "$(SRCDIR)\Configure" {- join(" ", map { '"'.$_.'"' } @{$config{build_file_templates}}, @{$config{build_infos}}, @{$config{conf_files}}) -}
656 @$(ECHO) "Detected changed: $?"
657 "$(PERL)" configdata.pm -r
658 @$(ECHO) "**************************************************"
660 @$(ECHO) "*** Please run the same make command again ***"
662 @$(ECHO) "**************************************************"
666 "$(PERL)" configdata.pm -r
670 use File::Spec::Functions qw/:DEFAULT abs2rel rel2abs file_name_is_absolute/;
672 # Helper function to convert dependencies in platform agnostic form to
673 # dependencies in platform form.
674 sub compute_platform_depends {
677 grep { $x eq $_ } @{$unified_info{programs}} and platform->bin($x)
678 or grep { $x eq $_ } @{$unified_info{modules}} and platform->dso($x)
679 or grep { $x eq $_ } @{$unified_info{libraries}} and platform->lib($x)
680 or platform->convertext($x); } @_;
683 # Helper function to figure out dependencies on libraries
684 # It takes a list of library names and outputs a list of dependencies
685 sub compute_lib_depends {
686 if ($disabled{shared}) {
687 return map { platform->staticlib($_) } @_;
689 return map { platform->sharedlib_import($_) // platform->staticlib($_) } @_;
694 my $deps = join(" ", compute_platform_depends(@{$args{deps}}));
700 # This function (and the next) avoids quoting paths of generated dependencies
701 # (in the build tree), but quotes paths of non-generated dependencies (in the
702 # source tree). This is a workaround for a limitation of C++Builder's make.exe
703 # in handling quoted paths: https://quality.embarcadero.com/browse/RSP-31756
706 my $gen0 = $args{generator}->[0];
707 my $gen_args = join('', map { " $_" }
708 @{$args{generator}}[1..$#{$args{generator}}]);
709 my $gen_incs = join("", map { " -I\"$_\"" } @{$args{generator_incs}});
710 my $incs = join("", map { " -I\"$_\"" } @{$args{incs}});
711 my $defs = join("", map { " -D".$_ } @{$args{defs}});
713 map { file_name_is_absolute($_) || ($_ =~ m|^../|) ? "\"$_\"" : $_ }
714 compute_platform_depends(@{$args{generator_deps}},
717 if ($args{src} =~ /\.html$/) {
721 my $title = basename($args{src}, ".html");
725 "\$(PERL)" "\$(SRCDIR)/util/mkpod2html.pl" -i "$pod" -o \$\@ -t "$title" -r "\$(SRCDIR)/doc"
727 } elsif (platform->isdef($args{src})) {
729 # Linker script-ish generator
731 my $target = platform->def($args{src});
732 my $mkdef = abs2rel(rel2abs(catfile($config{sourcedir},
733 "util", "mkdef.pl")),
734 rel2abs($config{builddir}));
735 my $ord_ver = $args{intent} eq 'lib' ? ' --version $(VERSION)' : '';
737 $args{generator}->[1] || platform->dsoname($args{product});
739 $target: $gen0 $deps $mkdef
740 "\$(PERL)" $mkdef$ord_ver --ordinals $gen0 --name $ord_name --OS windows > $target
742 } elsif (platform->isasm($args{src})) {
744 # Assembler generator
747 shlib => '$(LIB_CFLAGS) $(LIB_CPPFLAGS)',
748 lib => '$(LIB_CFLAGS) $(LIB_CPPFLAGS)',
749 dso => '$(DSO_CFLAGS) $(DSO_CPPFLAGS)',
750 bin => '$(BIN_CFLAGS) $(BIN_CPPFLAGS)'
751 } -> {$args{intent}};
752 my $target = platform->asm($args{src});
755 if ($gen0 =~ /\.pl$/) {
756 $generator = '"$(PERL)"'.$gen_incs.' '.$gen0.$gen_args
757 .' "$(PERLASM_SCHEME)"'.$incs.' '.$cppflags.$defs.' $(PROCESSSOR)';
758 } elsif ($gen0 =~ /\.S$/) {
761 die "Generator type for $src unknown: $gen0\n";
764 if (defined($generator)) {
765 # If the target is named foo.S in build.info, we want to
766 # end up generating foo.s in two steps.
767 if ($args{src} =~ /\.S$/) {
769 $target: "$gen0" $deps
770 cmd /C "set "ASM=\$(AS)" & $generator \$@.S"
771 \$(CPP) $incs $cppflags $defs \$@.S > \$@.i
778 $target: "$gen0" $deps
779 cmd /C "set "ASM=\$(AS)" & $generator \$@"
783 $target: "$gen0" $deps
784 \$(CPP) $incs $cppflags $defs "$gen0" > \$@.i
787 } elsif ($gen0 =~ m|^.*\.in$|) {
789 # "dofile" generator (file.in -> file)
791 my $dofile = abs2rel(rel2abs(catfile($config{sourcedir},
792 "util", "dofile.pl")),
793 rel2abs($config{builddir}));
794 my @perlmodules = ( 'configdata.pm',
795 grep { $_ =~ m|\.pm$| } @{$args{deps}} );
796 my %perlmoduleincs = map { '"-I'.dirname($_).'"' => 1 } @perlmodules;
797 $deps = join(' ', $deps, compute_platform_depends(@perlmodules));
798 @perlmodules = map { "-M".basename($_, '.pm') } @perlmodules;
799 my $perlmodules = join(' ', '', sort keys %perlmoduleincs, @perlmodules);
801 $args{src}: "$gen0" $deps
802 "\$(PERL)"$perlmodules "$dofile" "-o$target{build_file}" "$gen0"$gen_args > \$@
804 } elsif (grep { $_ eq $gen0 } @{$unified_info{programs}}) {
806 # Generic generator using OpenSSL programs
809 # Redo $gen0, to ensure that we have the proper extension.
810 $gen0 = platform->bin($gen0);
812 $args{src}: $gen0 $deps "\$(BLDDIR)\\util\\wrap.pl"
813 "\$(PERL)" "\$(BLDDIR)\\util\\wrap.pl" $gen0$gen_args > \$@
817 # Generic generator using Perl
820 $args{src}: "$gen0" $deps
821 "\$(PERL)"$gen_incs $gen0$gen_args > \$@
827 my $asmext = platform->asmext();
831 (platform->isasm($x) && grep { $x eq $_ } @generated)
832 ? platform->asm($x) : $x }
834 my $srcs = '"'.join('" "', @srcs).'"';
836 map { file_name_is_absolute($_) || ($_ =~ m|^../|) ? "\"$_\"" : $_ }
837 (@srcs, @{$args{deps}}));
838 my $incs = join("", map { ' -I"'.$_.'"' } @{$args{incs}});
839 my $defs = join("", map { " -D".$_ } @{$args{defs}});
840 my $cflags = { shlib => ' $(LIB_CFLAGS)',
841 lib => ' $(LIB_CFLAGS)',
842 dso => ' $(DSO_CFLAGS)',
843 bin => ' $(BIN_CFLAGS)' } -> {$args{intent}};
845 $cflags .= { shlib => ' $(LIB_CPPFLAGS)',
846 lib => ' $(LIB_CPPFLAGS)',
847 dso => ' $(DSO_CPPFLAGS)',
848 bin => ' $(BIN_CPPFLAGS)' } -> {$args{intent}};
849 my $asflags = { shlib => ' $(LIB_ASFLAGS)',
850 lib => ' $(LIB_ASFLAGS)',
851 dso => ' $(DSO_ASFLAGS)',
852 bin => ' $(BIN_ASFLAGS)' } -> {$args{intent}};
853 my $makedepcmd = $config{makedepcmd} unless $disabled{makedepend};
854 if ($srcs[0] =~ /\.rc$/) {
855 my $res = platform->res($args{obj});
858 \$(RC) \$(RCFLAGS) \$(RCOUTFLAG)\$\@ $srcs
861 my $obj = platform->obj($args{obj});
862 my $dep = platform->dep($args{obj});
863 if ($srcs[0] =~ /\Q${asmext}\E$/) {
866 \$(AS) $asflags \$(ASOUTFLAG)\$\@ $srcs
868 } elsif ($srcs[0] =~ /.S$/) {
871 \$(CC) /EP -D__ASSEMBLER__ $cflags $defs $srcs > \$@.asm
872 \$(AS) $asflags \$(ASOUTFLAG)\$\@ \$@.asm
875 my $recipe = <<"EOF";
877 \$(CC) $cflags $defs -c \$(COUTFLAG)\$\@ $srcs
879 $recipe .= <<"EOF" unless $disabled{makedepend};
880 cmd /C "$makedepcmd $cflags $defs $srcs > $dep 2>&1"
885 # We *know* this routine is only called when we've configure 'shared'.
886 # Also, note that even though the import library built here looks like
887 # a static library, it really isn't.
890 my $lib = $args{lib};
891 my @objs = map { platform->convertext($_) }
892 grep { platform->isobj($_) }
894 my @ress = map { platform->convertext($_) }
895 grep { platform->isres($_) }
897 my @defs = map { platform->def($_) }
898 grep { platform->isdef($_) }
900 my @deps = compute_lib_depends(@{$args{deps}});
901 die "More than one exported symbols list" if scalar @defs > 1;
902 my $linklibs = join("", map { "$_$target{ld_resp_delim}" } @deps);
903 my $objs = join($target{ld_resp_delim}, @objs);
904 my $ress = join($target{ld_resp_delim}, @ress);
905 my $deps = join(" ", @objs, @ress, @defs, @deps);
906 my $import = platform->sharedlib_import($lib);
907 my $dll = platform->sharedlib($lib);
908 my $shared_def = $target{lddefflag} . join("", @defs);
909 my $implib_rule = $target{ld_implib_rule} || "";
910 my $implib_flag = $target{ld_implib_flag}
911 ? "$target{ld_implib_flag}$import"
914 # The import library may look like a static library, but it is not.
915 # We MUST make the import library depend on the DLL, in case someone
916 # mistakenly removes the latter.
920 IF EXIST $full.manifest DEL /F /Q $full.manifest
921 IF EXIST \$@ DEL /F /Q \$@
922 cmd /C "\$(LD) \$(LDFLAGS) \$(LIB_LDFLAGS) @<< $implib_flag || (DEL /Q \$(\@B).* $import & EXIT 1)"
923 $objs$target{ld_resp_delim}\$(LDOUTFLAG)$dll$target{ldpostoutflag}$target{ld_resp_delim}$linklibs\$(LIB_EX_LIBS)$target{ld_resp_delim}$shared_def$target{ldresflag}$ress
925 IF EXIST $dll.manifest \\
926 \$(MT) \$(MTFLAGS) \$(MTINFLAG)$dll.manifest \$(MTOUTFLAG)$dll
927 IF EXIST apps\\$dll DEL /Q /F apps\\$dll
928 IF EXIST test\\$dll DEL /Q /F test\\$dll
929 IF EXIST fuzz\\$dll DEL /Q /F fuzz\\$dll
937 my $dso = platform->dso($args{module});
938 my $dso_n = platform->dsoname($args{module});
939 my @objs = map { platform->convertext($_) }
940 grep { platform->isobj($_) }
942 my @ress = map { platform->convertext($_) }
943 grep { platform->isres($_) }
945 my @defs = map { platform->def($_) }
946 grep { platform->isdef($_) }
948 my @deps = compute_lib_depends(@{$args{deps}});
949 die "More than one exported symbols list" if scalar @defs > 1;
950 my $objs = join($target{ld_resp_delim}, @objs);
951 my $ress = join($target{ld_resp_delim}, @ress);
952 my $linklibs = join("", map { "$_$target{ld_resp_delim}" } @deps);
953 my $deps = join(" ", @objs, @ress, @defs, @deps);
954 my $shared_def = $target{lddefflag} . join("", @defs);
957 IF EXIST $dso.manifest DEL /F /Q $dso.manifest
958 cmd /C "\$(LD) \$(LDFLAGS) \$(DSO_LDFLAGS) @<< || (DEL /Q \$(\@B).* $dso_n.* & EXIT 1)"
959 $objs$target{ld_resp_delim}\$(LDOUTFLAG)$dso$target{ldpostoutflag}$target{ld_resp_delim}$linklibs \$(DSO_EX_LIBS)$target{ld_resp_delim}$shared_def$target{ldresflag}$ress
961 IF EXIST $dso.manifest \\
962 \$(MT) \$(MTFLAGS) \$(MTINFLAG)$dso.manifest \$(MTOUTFLAG)$dso
967 my $lib = platform->staticlib($args{lib});
968 my @objs = map { platform->obj($_) } @{$args{objs}};
969 my $objs = join($target{ar_resp_delim}, @objs);
970 my $deps = join(" ", @objs);
973 \$(AR) \$(ARFLAGS) \$(AROUTFLAG)$lib @<<
980 my $bin = platform->bin($args{bin});
981 my @objs = map { platform->convertext($_) }
982 grep { platform->isobj($_) }
984 my @ress = map { platform->convertext($_) }
985 grep { platform->isres($_) }
987 my @deps = compute_lib_depends(@{$args{deps}});
988 my $objs = join($target{ld_resp_delim}, @objs);
989 my $linklibs = join("", map { "$_$target{ld_resp_delim}" } @deps);
990 my $deps = join(" ", @objs, @ress, @deps);
993 IF EXIST $bin.manifest DEL /F /Q $bin.manifest
994 \$(LD) \$(LDFLAGS) \$(BIN_LDFLAGS) @<<
995 $objs$target{ld_resp_delim}\$(LDOUTFLAG)$bin$target{ldpostoutflag}$target{ld_resp_delim}$linklibs\$(BIN_EX_LIBS)$target{ldresflag}$target{ldresflag}$ress
997 IF EXIST $bin.manifest \\
998 \$(MT) \$(MTFLAGS) \$(MTINFLAG)$bin.manifest \$(MTOUTFLAG)$bin
1003 my $script = $args{script};
1004 my $sources = '"'.join('" "', @{$args{sources}}).'"';
1005 my $dofile = abs2rel(rel2abs(catfile($config{sourcedir},
1006 "util", "dofile.pl")),
1007 rel2abs($config{builddir}));
1010 "\$(PERL)" "-I\$(BLDDIR)" -Mconfigdata "$dofile" \\
1011 "-o$target{build_file}" $sources > \$@
1016 my $dir = $args{dir};
1017 my @deps = map { platform->convertext($_) } @{$args{deps}};
1019 my %extinfo = ( dso => platform->dsoext(),
1020 lib => platform->libext(),
1021 bin => platform->binext() );
1023 # We already have a 'test' target, and the top directory is just plain
1025 return if $dir eq "test" || $dir eq ".";
1027 foreach my $type (("dso", "lib", "bin", "script")) {
1028 next unless defined($unified_info{dirinfo}->{$dir}->{products}->{$type});
1029 # For lib object files, we could update the library. However,
1030 # LIB on Windows doesn't work that way, so we won't create any
1031 # actions for it, and the dependencies are already taken care of.
1032 if ($type ne "lib") {
1033 foreach my $prod (@{$unified_info{dirinfo}->{$dir}->{products}->{$type}}) {
1034 if (dirname($prod) eq $dir) {
1035 push @deps, $prod.$extinfo{$type};
1041 my $deps = join(" ", @deps);
1042 my $actions = join("\n", "", @actions);
1044 $dir $dir\\ : $deps$actions
1047 "" # Important! This becomes part of the template result.