]> git.ipfire.org Git - thirdparty/openssl.git/blob - Configurations/windows-makefile.tmpl
build.info: Add the possibility to add dependencies on raw targets
[thirdparty/openssl.git] / Configurations / windows-makefile.tmpl
1 ##
2 ## Makefile for OpenSSL
3 ##
4 ## {- join("\n## ", @autowarntext) -}
5 {-
6 use File::Basename;
7
8 our $sover_dirname = platform->shlib_version_as_filename();
9
10 my $build_scheme = $target{build_scheme};
11 my $install_flavour = $build_scheme->[$#$build_scheme]; # last element
12 my $win_installenv =
13 $install_flavour eq "VC-WOW" ? "ProgramFiles(x86)"
14 : "ProgramW6432";
15 my $win_commonenv =
16 $install_flavour eq "VC-WOW" ? "CommonProgramFiles(x86)"
17 : "CommonProgramW6432";
18 our $win_installroot =
19 defined($ENV{$win_installenv}) ? $win_installenv : 'ProgramFiles';
20 our $win_commonroot =
21 defined($ENV{$win_commonenv}) ? $win_commonenv : 'CommonProgramFiles';
22
23 # expand variables early
24 $win_installroot = $ENV{$win_installroot};
25 $win_commonroot = $ENV{$win_commonroot};
26
27 # This makes sure things get built in the order they need
28 # to. You're welcome.
29 sub dependmagic {
30 my $target = shift;
31
32 return "$target: build_generated\n\t\$(MAKE) /\$(MAKEFLAGS) depend && \$(MAKE) /\$(MAKEFLAGS) _$target\n_$target";
33 }
34 '';
35 -}
36
37 PLATFORM={- $config{target} -}
38 SRCDIR={- $config{sourcedir} -}
39 BLDDIR={- $config{builddir} -}
40 FIPSKEY={- $config{FIPSKEY} -}
41
42 VERSION={- "$config{full_version}" -}
43 MAJOR={- $config{major} -}
44 MINOR={- $config{minor} -}
45
46 SHLIB_VERSION_NUMBER={- $config{shlib_version} -}
47
48 LIBS={- join(" ", map { ( platform->sharedlib_import($_), platform->staticlib($_) ) } @{$unified_info{libraries}}) -}
49 SHLIBS={- join(" ", map { platform->sharedlib($_) // () } @{$unified_info{libraries}}) -}
50 SHLIBPDBS={- join(" ", map { platform->sharedlibpdb($_) // () } @{$unified_info{libraries}}) -}
51 MODULES={- our @MODULES = map { platform->dso($_) } @{$unified_info{modules}};
52 join(" ", @MODULES) -}
53 MODULEPDBS={- join(" ", map { platform->dsopdb($_) } @{$unified_info{modules}}) -}
54 FIPSMODULENAME={- # We do some extra checking here, as there should be only one
55 my @fipsmodules =
56 grep { !$unified_info{attributes}->{modules}->{$_}->{noinst}
57 && $unified_info{attributes}->{modules}->{$_}->{fips} }
58 @{$unified_info{modules}};
59 die "More that one FIPS module" if scalar @fipsmodules > 1;
60 join(" ", map { basename platform->dso($_) } @fipsmodules) -}
61 PROGRAMS={- our @PROGRAMS = map { platform->bin($_) } @{$unified_info{programs}}; join(" ", @PROGRAMS) -}
62 PROGRAMPDBS={- join(" ", map { $_.".pdb" } @{$unified_info{programs}}) -}
63 SCRIPTS={- our @SCRIPTS = @{$unified_info{scripts}}; join(" ", @SCRIPTS) -}
64 {- output_off() if $disabled{makedepend}; "" -}
65 DEPS={- join(" ", map { platform->isobj($_) ? platform->dep($_) : () }
66 grep { $unified_info{sources}->{$_}->[0] =~ /\.c$/ }
67 keys %{$unified_info{sources}}); -}
68 {- output_on() if $disabled{makedepend}; "" -}
69 GENERATED_MANDATORY={- our @GENERATED_MANDATORY = @{$unified_info{depends}->{""}};
70 join(" ", @GENERATED_MANDATORY) -}
71 GENERATED={- # common0.tmpl provides @generated
72 our @GENERATED = map { platform->convertext($_) } @generated;
73 join(" ", @GENERATED) -}
74
75 INSTALL_LIBS={-
76 join(" ", map { quotify1(platform->sharedlib_import($_)
77 // platform->staticlib($_)) }
78 grep { !$unified_info{attributes}->{libraries}->{$_}->{noinst} }
79 @{$unified_info{libraries}})
80 -}
81 INSTALL_SHLIBS={-
82 join(" ", map { my $x = platform->sharedlib($_);
83 $x ? quotify_l($x) : () }
84 grep { !$unified_info{attributes}->{libraries}->{$_}->{noinst} }
85 @{$unified_info{libraries}})
86 -}
87 INSTALL_SHLIBPDBS={-
88 join(" ", map { my $x = platform->sharedlibpdb($_);
89 $x ? quotify_l($x) : () }
90 grep { !$unified_info{attributes}->{libraries}->{$_}->{noinst} }
91 @{$unified_info{libraries}})
92 -}
93 INSTALL_ENGINES={-
94 join(" ", map { quotify1(platform->dso($_)) }
95 grep { !$unified_info{attributes}->{modules}->{$_}->{noinst}
96 && $unified_info{attributes}->{modules}->{$_}->{engine} }
97 @{$unified_info{modules}})
98 -}
99 INSTALL_ENGINEPDBS={-
100 join(" ", map { quotify1(platform->dsopdb($_)) }
101 grep { !$unified_info{attributes}->{modules}->{$_}->{noinst}
102 && $unified_info{attributes}->{modules}->{$_}->{engine} }
103 @{$unified_info{modules}})
104 -}
105 INSTALL_MODULES={-
106 join(" ", map { platform->dso($_) }
107 grep { !$unified_info{attributes}->{modules}->{$_}->{noinst}
108 && !$unified_info{attributes}->{modules}->{$_}->{engine} }
109 @{$unified_info{modules}})
110 -}
111 INSTALL_MODULEPDBS={-
112 join(" ", map { quotify1(platform->dsopdb($_)) }
113 grep { !$unified_info{attributes}->{modules}->{$_}->{noinst}
114 && !$unified_info{attributes}->{modules}->{$_}->{engine} }
115 @{$unified_info{modules}})
116 -}
117 INSTALL_PROGRAMS={-
118 join(" ", map { quotify1(platform->bin($_)) }
119 grep { !$unified_info{attributes}->{programs}->{$_}->{noinst} }
120 @{$unified_info{programs}})
121 -}
122 INSTALL_PROGRAMPDBS={-
123 join(" ", map { quotify1(platform->binpdb($_)) }
124 grep { !$unified_info{attributes}->{programs}->{$_}->{noinst} }
125 @{$unified_info{programs}})
126 -}
127 BIN_SCRIPTS={-
128 join(" ", map { quotify1($_) }
129 grep { !$unified_info{attributes}->{scripts}->{$_}->{noinst}
130 && !$unified_info{attributes}->{scripts}->{$_}->{misc} }
131 @{$unified_info{scripts}})
132 -}
133 MISC_SCRIPTS={-
134 join(" ", map { quotify1($_) }
135 grep { !$unified_info{attributes}->{scripts}->{$_}->{noinst}
136 && $unified_info{attributes}->{scripts}->{$_}->{misc} }
137 @{$unified_info{scripts}})
138 -}
139 HTMLDOCS1={- our @HTMLDOCS1 = @{$unified_info{htmldocs}->{man1}};
140 join(" ", @HTMLDOCS1) -}
141 HTMLDOCS3={- our @HTMLDOCS3 = @{$unified_info{htmldocs}->{man3}};
142 join(" ", @HTMLDOCS3) -}
143 HTMLDOCS5={- our @HTMLDOCS5 = @{$unified_info{htmldocs}->{man5}};
144 join(" ", @HTMLDOCS5) -}
145 HTMLDOCS7={- our @HTMLDOCS7 = @{$unified_info{htmldocs}->{man7}};
146 join(" ", @HTMLDOCS7) -}
147 HTMLDOCS1_BLDDIRS={- my %dirs = map { dirname($_) => 1 } @HTMLDOCS1;
148 join(' ', sort keys %dirs) -}
149 HTMLDOCS3_BLDDIRS={- my %dirs = map { dirname($_) => 1 } @HTMLDOCS3;
150 join(' ', sort keys %dirs) -}
151 HTMLDOCS5_BLDDIRS={- my %dirs = map { dirname($_) => 1 } @HTMLDOCS5;
152 join(' ', sort keys %dirs) -}
153 HTMLDOCS7_BLDDIRS={- my %dirs = map { dirname($_) => 1 } @HTMLDOCS7;
154 join(' ', sort keys %dirs) -}
155
156 APPS_OPENSSL="{- use File::Spec::Functions;
157 catfile("apps","openssl") -}"
158
159 # Do not edit these manually. Use Configure with --prefix or --openssldir
160 # to change this! Short explanation in the top comment in Configure
161 INSTALLTOP_dev={- # $prefix is used in the OPENSSLDIR perl snippet
162 #
163 use File::Spec::Functions qw(:DEFAULT splitpath);
164 our $prefix = canonpath($config{prefix}
165 || "$win_installroot\\OpenSSL");
166 our ($prefix_dev, $prefix_dir, $prefix_file) =
167 splitpath($prefix, 1);
168 $prefix_dev -}
169 INSTALLTOP_dir={- canonpath($prefix_dir) -}
170 OPENSSLDIR_dev={- #
171 # The logic here is that if no --openssldir was given,
172 # OPENSSLDIR will get the value "$win_commonroot\\SSL".
173 # If --openssldir was given and the value is an absolute
174 # path, OPENSSLDIR will get its value without change.
175 # If the value from --openssldir is a relative path,
176 # OPENSSLDIR will get $prefix with the --openssldir
177 # value appended as a subdirectory.
178 #
179 use File::Spec::Functions qw(:DEFAULT splitpath);
180 our $openssldir =
181 $config{openssldir} ?
182 (file_name_is_absolute($config{openssldir}) ?
183 canonpath($config{openssldir})
184 : catdir($prefix, $config{openssldir}))
185 : canonpath("$win_commonroot\\SSL");
186 our ($openssldir_dev, $openssldir_dir, $openssldir_file) =
187 splitpath($openssldir, 1);
188 $openssldir_dev -}
189 OPENSSLDIR_dir={- canonpath($openssldir_dir) -}
190 LIBDIR={- our $libdir = $config{libdir} || "lib";
191 file_name_is_absolute($libdir) ? "" : $libdir -}
192 MODULESDIR_dev={- use File::Spec::Functions qw(:DEFAULT splitpath catpath);
193 our $modulesprefix = catdir($prefix,$libdir);
194 our ($modulesprefix_dev, $modulesprefix_dir,
195 $modulesprefix_file) =
196 splitpath($modulesprefix, 1);
197 our $modulesdir_dev = $modulesprefix_dev;
198 our $modulesdir_dir =
199 catdir($modulesprefix_dir, "ossl-modules");
200 our $modulesdir = catpath($modulesdir_dev, $modulesdir_dir);
201 our $enginesdir_dev = $modulesprefix_dev;
202 our $enginesdir_dir =
203 catdir($modulesprefix_dir, "engines-$sover_dirname");
204 our $enginesdir = catpath($enginesdir_dev, $enginesdir_dir);
205 $modulesdir_dev -}
206 MODULESDIR_dir={- canonpath($modulesdir_dir) -}
207 ENGINESDIR_dev={- $enginesdir_dev -}
208 ENGINESDIR_dir={- canonpath($enginesdir_dir) -}
209 !IF "$(DESTDIR)" != ""
210 INSTALLTOP=$(DESTDIR)$(INSTALLTOP_dir)
211 OPENSSLDIR=$(DESTDIR)$(OPENSSLDIR_dir)
212 ENGINESDIR=$(DESTDIR)$(ENGINESDIR_dir)
213 MODULESDIR=$(DESTDIR)$(MODULESDIR_dir)
214 !ELSE
215 INSTALLTOP=$(INSTALLTOP_dev)$(INSTALLTOP_dir)
216 OPENSSLDIR=$(OPENSSLDIR_dev)$(OPENSSLDIR_dir)
217 ENGINESDIR=$(ENGINESDIR_dev)$(ENGINESDIR_dir)
218 MODULESDIR=$(MODULESDIR_dev)$(MODULESDIR_dir)
219 !ENDIF
220
221 # $(libdir) is chosen to be compatible with the GNU coding standards
222 libdir={- file_name_is_absolute($libdir)
223 ? $libdir : '$(INSTALLTOP)\$(LIBDIR)' -}
224
225 ##### User defined commands and flags ################################
226
227 CC="{- $config{CC} -}"
228 CPP="{- $config{CPP} -}"
229 CPPFLAGS={- our $cppflags1 = join(" ",
230 (map { "-D".$_} @{$config{CPPDEFINES}}),
231 (map { " -I ".$_} @{$config{CPPINCLUDES}}),
232 @{$config{CPPFLAGS}}) -}
233 CFLAGS={- join(' ', @{$config{CFLAGS}}) -}
234 LD="{- $config{LD} -}"
235 LDFLAGS={- join(' ', @{$config{LDFLAGS}}) -}
236 EX_LIBS={- join(' ', @{$config{LDLIBS}}) -}
237
238 PERL={- $config{PERL} -}
239
240 AR="{- $config{AR} -}"
241 ARFLAGS= {- join(' ', @{$config{ARFLAGS}}) -}
242
243 MT="{- $config{MT} -}"
244 MTFLAGS= {- join(' ', @{$config{MTFLAGS}}) -}
245
246 AS="{- $config{AS} -}"
247 ASFLAGS={- join(' ', @{$config{ASFLAGS}}) -}
248
249 RC="{- $config{RC} -}"
250 RCFLAGS={- join(' ', @{$config{RCFLAGS}}) -}
251
252 ECHO="$(PERL)" "$(SRCDIR)\util\echo.pl"
253
254 ##### Special command flags ##########################################
255
256 COUTFLAG={- $target{coutflag} -}$(OSSL_EMPTY)
257 LDOUTFLAG={- $target{ldoutflag} -}$(OSSL_EMPTY)
258 AROUTFLAG={- $target{aroutflag} -}$(OSSL_EMPTY)
259 MTINFLAG={- $target{mtinflag} -}$(OSSL_EMPTY)
260 MTOUTFLAG={- $target{mtoutflag} -}$(OSSL_EMPTY)
261 ASOUTFLAG={- $target{asoutflag} -}$(OSSL_EMPTY)
262 RCOUTFLAG={- $target{rcoutflag} -}$(OSSL_EMPTY)
263
264 ##### Project flags ##################################################
265
266 # Variables starting with CNF_ are common variables for all product types
267
268 CNF_ASFLAGS={- join(' ', $target{asflags} || (),
269 @{$config{asflags}}) -}
270 CNF_CPPFLAGS={- our $cppfags2 =
271 join(' ', $target{cppflags} || (),
272 (map { '-D'.quotify1($_) } @{$target{defines}},
273 @{$config{defines}}),
274 (map { '-I'.'"'.$_.'"' } @{$target{includes}},
275 @{$config{includes}}),
276 @{$config{cppflags}}) -}
277 CNF_CFLAGS={- join(' ', $target{cflags} || (),
278 @{$config{cflags}}) -}
279 CNF_CXXFLAGS={- join(' ', $target{cxxflags} || (),
280 @{$config{cxxflags}}) -}
281 CNF_LDFLAGS={- join(' ', $target{lflags} || (),
282 @{$config{lflags}}) -}
283 CNF_EX_LIBS={- join(' ', $target{ex_libs} || (),
284 @{$config{ex_libs}}) -}
285
286 # Variables starting with LIB_ are used to build library object files
287 # and shared libraries.
288 # Variables starting with DSO_ are used to build DSOs and their object files.
289 # Variables starting with BIN_ are used to build programs and their object
290 # files.
291
292 LIB_ASFLAGS={- join(' ', $target{lib_asflags} || (),
293 @{$config{lib_asflags}},
294 '$(CNF_ASFLAGS)', '$(ASFLAGS)') -}
295 LIB_CPPFLAGS={- our $lib_cppflags =
296 join(' ', $target{lib_cppflags} || (),
297 $target{shared_cppflag} || (),
298 (map { '-D'.quotify1($_) }
299 @{$target{lib_defines}},
300 @{$target{shared_defines}},
301 @{$config{lib_defines}},
302 @{$config{shared_defines}}),
303 (map { '-I'.quotify1($_) }
304 @{$target{lib_includes}},
305 @{$target{shared_includes}},
306 @{$config{lib_includes}},
307 @{$config{shared_includes}}),
308 @{$config{lib_cppflags}},
309 @{$config{shared_cppflag}});
310 join(' ', $lib_cppflags,
311 (map { '-D'.quotify1($_) }
312 "OPENSSLDIR=\"$openssldir\"",
313 "ENGINESDIR=\"$enginesdir\"",
314 "MODULESDIR=\"$modulesdir\""),
315 '$(CNF_CPPFLAGS)', '$(CPPFLAGS)') -}
316 LIB_CFLAGS={- join(' ', $target{lib_cflags} || (),
317 $target{shared_cflag} || (),
318 @{$config{lib_cflags}},
319 @{$config{shared_cflag}},
320 '$(CNF_CFLAGS)', '$(CFLAGS)') -}
321 LIB_LDFLAGS={- join(' ', $target{shared_ldflag} || (),
322 $config{shared_ldflag} || (),
323 '$(CNF_LDFLAGS)', '$(LDFLAGS)') -}
324 LIB_EX_LIBS=$(CNF_EX_LIBS) $(EX_LIBS)
325 DSO_ASFLAGS={- join(' ', $target{dso_asflags} || (),
326 $target{module_asflags} || (),
327 @{$config{dso_asflags}},
328 @{$config{module_asflags}},
329 '$(CNF_ASFLAGS)', '$(ASFLAGS)') -}
330 DSO_CPPFLAGS={- join(' ', $target{dso_cppflags} || (),
331 $target{module_cppflag} || (),
332 (map { '-D'.quotify1($_) }
333 @{$target{dso_defines}},
334 @{$target{module_defines}},
335 @{$config{dso_defines}},
336 @{$config{module_defines}}),
337 (map { '-I'.quotify1($_) }
338 @{$target{dso_includes}},
339 @{$target{module_includes}},
340 @{$config{dso_includes}},
341 @{$config{module_includes}}),
342 @{$config{dso_cppflags}},
343 @{$config{module_cppflags}},
344 '$(CNF_CPPFLAGS)', '$(CPPFLAGS)') -}
345 DSO_CFLAGS={- join(' ', $target{dso_cflags} || (),
346 $target{module_cflags} || (),
347 @{$config{dso_cflags}},
348 @{$config{module_cflags}},
349 '$(CNF_CFLAGS)', '$(CFLAGS)') -}
350 DSO_LDFLAGS={- join(' ', $target{dso_lflags} || (),
351 $target{module_ldflags} || (),
352 @{$config{dso_lflags}},
353 @{$config{module_ldflags}},
354 '$(CNF_LDFLAGS)', '$(LDFLAGS)') -}
355 DSO_EX_LIBS=$(CNF_EX_LIBS) $(EX_LIBS)
356 BIN_ASFLAGS={- join(' ', $target{bin_asflags} || (),
357 @{$config{bin_asflags}},
358 '$(CNF_ASFLAGS)', '$(ASFLAGS)') -}
359 BIN_CPPFLAGS={- join(' ', $target{bin_cppflags} || (),
360 (map { '-D'.$_ } @{$config{bin_defines} || ()}),
361 @{$config{bin_cppflags}},
362 '$(CNF_CPPFLAGS)', '$(CPPFLAGS)') -}
363 BIN_CFLAGS={- join(' ', $target{bin_cflags} || (),
364 @{$config{bin_cflags}},
365 '$(CNF_CFLAGS)', '$(CFLAGS)') -}
366 BIN_LDFLAGS={- join(' ', $target{bin_lflags} || (),
367 @{$config{bin_lflags}},
368 '$(CNF_LDFLAGS)', '$(LDFLAGS)') -}
369 BIN_EX_LIBS=$(CNF_EX_LIBS) $(EX_LIBS)
370
371 # CPPFLAGS_Q is used for one thing only: to build up buildinf.h
372 CPPFLAGS_Q={- $cppflags1 =~ s|([\\"])|\\$1|g;
373 $cppflags2 =~ s|([\\"])|\\$1|g;
374 join(' ', $lib_cppflags || (), $cppflags2 || (),
375 $cppflags1 || ()) -}
376
377 PERLASM_SCHEME= {- $target{perlasm_scheme} -}
378
379 PROCESSOR= {- $config{processor} -}
380
381 # The main targets ###################################################
382
383 {- dependmagic('build_sw'); -}: build_libs_nodep build_modules_nodep build_programs_nodep copy-utils
384 {- dependmagic('build_libs'); -}: build_libs_nodep
385 {- dependmagic('build_modules'); -}: build_modules_nodep
386 {- dependmagic('build_programs'); -}: build_programs_nodep
387
388 build_docs: build_html_docs
389 build_html_docs: $(HTMLDOCS1) $(HTMLDOCS3) $(HTMLDOCS5) $(HTMLDOCS7)
390
391 build_generated: $(GENERATED_MANDATORY)
392 build_libs_nodep: $(LIBS) {- join(" ",map { platform->sharedlib_import($_) // () } @{$unified_info{libraries}}) -}
393 build_modules_nodep: $(MODULES)
394 build_programs_nodep: $(PROGRAMS) $(SCRIPTS)
395
396 # Kept around for backward compatibility
397 build_apps build_tests: build_programs
398
399 # Convenience target to prebuild all generated files, not just the mandatory
400 # ones
401 build_all_generated: $(GENERATED_MANDATORY) $(GENERATED) build_docs
402 @{- output_off() if $disabled{makedepend}; "" -}
403 @$(ECHO) "Warning: consider configuring with no-makedepend, because if"
404 @$(ECHO) " target system doesn't have $(PERL),"
405 @$(ECHO) " then make will fail..."
406 @{- output_on() if $disabled{makedepend}; "" -}
407
408 all: build_sw build_docs
409
410 test: tests
411 {- dependmagic('tests'); -}: build_programs_nodep build_modules_nodep copy-utils
412 @{- output_off() if $disabled{tests}; "" -}
413 set SRCTOP=$(SRCDIR)
414 set BLDTOP=$(BLDDIR)
415 set PERL=$(PERL)
416 set FIPSKEY=$(FIPSKEY)
417 "$(PERL)" "$(SRCDIR)\test\run_tests.pl" $(TESTS)
418 @{- if ($disabled{tests}) { output_on(); } else { output_off(); } "" -}
419 @$(ECHO) "Tests are not supported with your chosen Configure options"
420 @{- output_on() if !$disabled{tests}; "" -}
421
422 list-tests:
423 @{- output_off() if $disabled{tests}; "" -}
424 @set SRCTOP=$(SRCDIR)
425 @"$(PERL)" "$(SRCDIR)\test\run_tests.pl" list
426 @{- if ($disabled{tests}) { output_on(); } else { output_off(); } "" -}
427 @$(ECHO) "Tests are not supported with your chosen Configure options"
428 @{- output_on() if !$disabled{tests}; "" -}
429
430 install: install_sw install_ssldirs install_docs
431
432 uninstall: uninstall_docs uninstall_sw
433
434 libclean:
435 "$(PERL)" -e "map { m/(.*)\.dll$$/; unlink glob """{.,apps,test,fuzz}/$$1.*"""; } @ARGV" $(SHLIBS)
436 -del /Q /F $(LIBS) libcrypto.* libssl.* ossl_static.pdb
437
438 clean: libclean
439 -rmdir /Q /S $(HTMLDOCS1_BLDDIRS)
440 -rmdir /Q /S $(HTMLDOCS3_BLDDIRS)
441 -rmdir /Q /S $(HTMLDOCS5_BLDDIRS)
442 -rmdir /Q /S $(HTMLDOCS7_BLDDIRS)
443 {- join("\n\t", map { "-del /Q /F $_" } @PROGRAMS) -}
444 {- join("\n\t", map { "-del /Q /F $_" } @MODULES) -}
445 {- join("\n\t", map { "-del /Q /F $_" } @SCRIPTS) -}
446 {- join("\n\t", map { "-del /Q /F $_" } @GENERATED_MANDATORY) -}
447 {- join("\n\t", map { "-del /Q /F $_" } @GENERATED) -}
448 -del /Q /S /F *.d *.obj *.pdb *.ilk *.manifest
449 -del /Q /S /F engines\*.lib engines\*.exp
450 -del /Q /S /F apps\*.lib apps\*.rc apps\*.res apps\*.exp
451 -del /Q /S /F test\*.exp
452 -rmdir /Q /S test\test-runs
453
454 distclean: clean
455 -del /Q /F configdata.pm
456 -del /Q /F makefile
457
458 depend:
459 @ {- output_off() if $disabled{makedepend}; "" -}
460 @ "$(PERL)" "$(SRCDIR)\util\add-depends.pl" "VC"
461 @ {- output_on() if $disabled{makedepend}; "" -}
462
463 # Install helper targets #############################################
464
465 install_sw: install_dev install_engines install_modules install_runtime
466
467 uninstall_sw: uninstall_runtime uninstall_modules uninstall_engines uninstall_dev
468
469 install_docs: install_html_docs
470
471 uninstall_docs: uninstall_html_docs
472
473 install_fips: install_sw
474 @$(ECHO) "*** Installing FIPS module configuration"
475 @$(ECHO) "fipsinstall $(DESTDIR)$(MODULESDIR)/$(FIPSMODULENAME).cnf"
476 @openssl fipsinstall -module $(DESTDIR)$(MODULESDIR)/$(FIPSMODULENAME) \
477 -out $(DESTDIR)$(MODULESDIR)/$(FIPSMODULENAME).cnf \
478 -macopt "key:$(FIPSKEY)"
479
480 uninstall_fips: uninstall_sw
481 @$(ECHO) "*** Uninstalling FIPS module configuration"
482 @$(ECHO) "$(RM) $(DESTDIR)$(MODULESDIR)/$(FIPSMODULENAME).cnf"
483 @$(RM) $(DESTDIR)$(MODULESDIR)/$(FIPSMODULENAME).cnf
484
485 install_ssldirs:
486 @"$(PERL)" "$(SRCDIR)\util\mkdir-p.pl" "$(OPENSSLDIR)\certs"
487 @"$(PERL)" "$(SRCDIR)\util\mkdir-p.pl" "$(OPENSSLDIR)\private"
488 @"$(PERL)" "$(SRCDIR)\util\mkdir-p.pl" "$(OPENSSLDIR)\misc"
489 @"$(PERL)" "$(SRCDIR)\util\copy.pl" "$(SRCDIR)\apps\openssl.cnf" \
490 "$(OPENSSLDIR)\openssl.cnf.dist"
491 @IF NOT EXIST "$(OPENSSLDIR)\openssl.cnf" \
492 "$(PERL)" "$(SRCDIR)\util\copy.pl" "$(SRCDIR)\apps\openssl.cnf" \
493 "$(OPENSSLDIR)\openssl.cnf"
494 @if not "$(MISC_SCRIPTS)"=="" \
495 "$(PERL)" "$(SRCDIR)\util\copy.pl" $(MISC_SCRIPTS) \
496 "$(OPENSSLDIR)\misc"
497 @"$(PERL)" "$(SRCDIR)\util\copy.pl" "$(SRCDIR)\apps\ct_log_list.cnf" \
498 "$(OPENSSLDIR)\ct_log_list.cnf.dist"
499 @IF NOT EXIST "$(OPENSSLDIR)\ct_log_list.cnf" \
500 "$(PERL)" "$(SRCDIR)\util\copy.pl" "$(SRCDIR)\apps\ct_log_list.cnf" \
501 "$(OPENSSLDIR)\ct_log_list.cnf"
502
503 install_dev: install_runtime_libs
504 @if "$(INSTALLTOP)"=="" ( $(ECHO) "INSTALLTOP should not be empty" & exit 1 )
505 @$(ECHO) "*** Installing development files"
506 @"$(PERL)" "$(SRCDIR)\util\mkdir-p.pl" "$(INSTALLTOP)\include\openssl"
507 @{- output_off() unless grep { $_ eq "OPENSSL_USE_APPLINK" } (@{$target{defines}}, @{$config{defines}}); "" -}
508 @"$(PERL)" "$(SRCDIR)\util\copy.pl" "$(SRCDIR)\ms\applink.c" \
509 "$(INSTALLTOP)\include\openssl"
510 @{- output_on() unless grep { $_ eq "OPENSSL_USE_APPLINK" } (@{$target{defines}}, @{$config{defines}}); "" -}
511 @"$(PERL)" "$(SRCDIR)\util\copy.pl" "-exclude_re=/__DECC_" \
512 "$(SRCDIR)\include\openssl\*.h" \
513 "$(INSTALLTOP)\include\openssl"
514 @"$(PERL)" "$(SRCDIR)\util\copy.pl" "$(BLDDIR)\include\openssl\*.h" \
515 "$(INSTALLTOP)\include\openssl"
516 @"$(PERL)" "$(SRCDIR)\util\mkdir-p.pl" "$(libdir)"
517 @"$(PERL)" "$(SRCDIR)\util\copy.pl" $(INSTALL_LIBS) "$(libdir)"
518 @if "$(SHLIBS)"=="" \
519 "$(PERL)" "$(SRCDIR)\util\copy.pl" ossl_static.pdb "$(libdir)"
520
521 uninstall_dev:
522
523 _install_modules_deps: install_runtime_libs build_modules
524
525 install_engines: _install_modules_deps
526 @if "$(INSTALLTOP)"=="" ( $(ECHO) "INSTALLTOP should not be empty" & exit 1 )
527 @$(ECHO) "*** Installing engines"
528 @"$(PERL)" "$(SRCDIR)\util\mkdir-p.pl" "$(ENGINESDIR)"
529 @if not "$(INSTALL_ENGINES)"=="" \
530 "$(PERL)" "$(SRCDIR)\util\copy.pl" $(INSTALL_ENGINES) "$(ENGINESDIR)"
531 @if not "$(INSTALL_ENGINES)"=="" \
532 "$(PERL)" "$(SRCDIR)\util\copy.pl" $(INSTALL_ENGINEPDBS) "$(ENGINESDIR)"
533
534 uninstall_engines:
535
536 install_modules: _install_modules_deps
537 @if "$(INSTALLTOP)"=="" ( $(ECHO) "INSTALLTOP should not be empty" & exit 1 )
538 @$(ECHO) "*** Installing modules"
539 @"$(PERL)" "$(SRCDIR)\util\mkdir-p.pl" "$(MODULESDIR)"
540 @if not "$(INSTALL_MODULES)"=="" \
541 "$(PERL)" "$(SRCDIR)\util\copy.pl" $(INSTALL_MODULES) "$(MODULESDIR)"
542 @if not "$(INSTALL_MODULES)"=="" \
543 "$(PERL)" "$(SRCDIR)\util\copy.pl" $(INSTALL_MODULEPDBS) "$(MODULESDIR)"
544
545 uninstall_modules:
546
547 install_runtime: install_programs
548
549 install_runtime_libs: build_libs
550 @if "$(INSTALLTOP)"=="" ( $(ECHO) "INSTALLTOP should not be empty" & exit 1 )
551 @$(ECHO) "*** Installing runtime libraries"
552 @"$(PERL)" "$(SRCDIR)\util\mkdir-p.pl" "$(INSTALLTOP)\bin"
553 @if not "$(SHLIBS)"=="" \
554 "$(PERL)" "$(SRCDIR)\util\copy.pl" $(INSTALL_SHLIBS) "$(INSTALLTOP)\bin"
555 @if not "$(SHLIBS)"=="" \
556 "$(PERL)" "$(SRCDIR)\util\copy.pl" $(INSTALL_SHLIBPDBS) \
557 "$(INSTALLTOP)\bin"
558
559 install_programs: install_runtime_libs build_programs
560 @if "$(INSTALLTOP)"=="" ( $(ECHO) "INSTALLTOP should not be empty" & exit 1 )
561 @$(ECHO) "*** Installing runtime programs"
562 @if not "$(INSTALL_PROGRAMS)"=="" \
563 "$(PERL)" "$(SRCDIR)\util\mkdir-p.pl" "$(INSTALLTOP)\bin"
564 @if not "$(INSTALL_PROGRAMS)"=="" \
565 "$(PERL)" "$(SRCDIR)\util\copy.pl" $(INSTALL_PROGRAMS) \
566 "$(INSTALLTOP)\bin"
567 @if not "$(INSTALL_PROGRAMS)"=="" \
568 "$(PERL)" "$(SRCDIR)\util\copy.pl" $(INSTALL_PROGRAMPDBS) \
569 "$(INSTALLTOP)\bin"
570 @if not "$(INSTALL_PROGRAMS)"=="" \
571 "$(PERL)" "$(SRCDIR)\util\copy.pl" $(BIN_SCRIPTS) \
572 "$(INSTALLTOP)\bin"
573
574 uninstall_runtime:
575
576 install_html_docs: build_html_docs
577 @if "$(INSTALLTOP)"=="" ( echo INSTALLTOP should not be empty & exit 1 )
578 @echo *** Installing HTML docs
579 @"$(PERL)" "$(SRCDIR)\util\mkdir-p.pl" "$(INSTALLTOP)\html\man1"
580 @"$(PERL)" "$(SRCDIR)\util\mkdir-p.pl" "$(INSTALLTOP)\html\man3"
581 @"$(PERL)" "$(SRCDIR)\util\mkdir-p.pl" "$(INSTALLTOP)\html\man5"
582 @"$(PERL)" "$(SRCDIR)\util\mkdir-p.pl" "$(INSTALLTOP)\html\man7"
583 @"$(PERL)" "$(SRCDIR)\util\copy.pl" $(BLDDIR)\doc\html\man1\*.html \
584 "$(INSTALLTOP)\html\man1"
585 @"$(PERL)" "$(SRCDIR)\util\copy.pl" $(BLDDIR)\doc\html\man3\*.html \
586 "$(INSTALLTOP)\html\man3"
587 @"$(PERL)" "$(SRCDIR)\util\copy.pl" $(BLDDIR)\doc\html\man5\*.html \
588 "$(INSTALLTOP)\html\man5"
589 @"$(PERL)" "$(SRCDIR)\util\copy.pl" $(BLDDIR)\doc\html\man7\*.html \
590 "$(INSTALLTOP)\html\man7"
591
592 uninstall_html_docs:
593
594 # Helper targets #####################################################
595
596 copy-utils: $(BLDDIR)\util\wrap.pl
597
598 $(BLDDIR)\util\wrap.pl: configdata.pm
599 @if NOT EXIST "$(BLDDIR)\util" mkdir "$(BLDDIR)\util"
600 @if NOT "$(SRCDIR)"=="$(BLDDIR)" copy "$(SRCDIR)\util\$(@F)" "$(BLDDIR)\util"
601
602 # Building targets ###################################################
603
604 configdata.pm: "$(SRCDIR)\Configure" {- join(" ", map { '"'.$_.'"' } @{$config{build_file_templates}}, @{$config{build_infos}}, @{$config{conf_files}}) -}
605 @$(ECHO) "Detected changed: $?"
606 "$(PERL)" configdata.pm -r
607 @$(ECHO) "**************************************************"
608 @$(ECHO) "*** ***"
609 @$(ECHO) "*** Please run the same make command again ***"
610 @$(ECHO) "*** ***"
611 @$(ECHO) "**************************************************"
612 @exit 1
613
614 reconfigure reconf:
615 "$(PERL)" configdata.pm -r
616
617 {-
618 use File::Basename;
619 use File::Spec::Functions qw/:DEFAULT abs2rel rel2abs/;
620
621 # Helper function to figure out dependencies on libraries
622 # It takes a list of library names and outputs a list of dependencies
623 sub compute_lib_depends {
624 if ($disabled{shared}) {
625 return map { platform->staticlib($_) } @_;
626 }
627 return map { platform->sharedlib_import($_) // platform->staticlib($_) } @_;
628 }
629
630 sub generatetarget {
631 my %args = @_;
632 my $deps = join(" ", @{$args{deps}});
633 return <<"EOF";
634 $args{target}: $deps
635 EOF
636 }
637
638 sub generatesrc {
639 my %args = @_;
640 my ($gen0, @gens) = @{$args{generator}};
641 my $generator = '"'.$gen0.'"'.join('', map { " $_" } @gens);
642 my $generator_incs = join("", map { " -I \"$_\"" } @{$args{generator_incs}});
643 my $incs = join("", map { " -I \"$_\"" } @{$args{incs}});
644 my $defs = join("", map { " -D".$_ } @{$args{defs}});
645 my $deps = @{$args{deps}} ?
646 '"'.join('" "', @{$args{generator_deps}}, @{$args{deps}}).'"' : '';
647
648 if ($args{src} =~ /\.html$/) {
649 my $title = basename($args{src}, ".html");
650 my $pod = $args{generator}->[0];
651 return <<"EOF";
652 $args{src}: "$pod"
653 \$(PERL) \$(SRCDIR)/util/mkpod2html.pl -i "$pod" -o \$\@ -t "$title" -r "\$(SRCDIR)/doc"
654 EOF
655 } elsif (platform->isdef($args{src})) {
656 my $target = platform->def($args{src});
657 my $mkdef = abs2rel(rel2abs(catfile($config{sourcedir},
658 "util", "mkdef.pl")),
659 rel2abs($config{builddir}));
660 my $ord_ver = $args{intent} eq 'lib' ? ' --version $(VERSION)' : '';
661 my $ord_name =
662 $args{generator}->[1] || platform->dsoname($args{product});
663 return <<"EOF";
664 $target: $args{generator}->[0] $deps $mkdef
665 "\$(PERL)" $mkdef$ord_ver --ordinals $args{generator}->[0] --name $ord_name --OS windows > $target
666 EOF
667 } elsif (!platform->isasm($args{src})) {
668 my $target = $args{src};
669 if ($args{generator}->[0] =~ m|^.*\.in$|) {
670 my $dofile = abs2rel(rel2abs(catfile($config{sourcedir},
671 "util", "dofile.pl")),
672 rel2abs($config{builddir}));
673 my @modules = ( 'configdata.pm',
674 grep { $_ =~ m|\.pm$| } @{$args{deps}} );
675 my %moduleincs = map { '"-I'.dirname($_).'"' => 1 } @modules;
676 @modules = map { "-M".basename($_, '.pm') } @modules;
677 my $modules = join(' ', '', sort keys %moduleincs, @modules);
678 return <<"EOF";
679 $target: "$args{generator}->[0]" $deps
680 "\$(PERL)"$modules "$dofile" "-o$target{build_file}" $generator > \$@
681 EOF
682 } else {
683 return <<"EOF";
684 $target: "$args{generator}->[0]" $deps
685 "\$(PERL)"$generator_incs $generator > \$@
686 EOF
687 }
688 } else {
689 my $cppflags = {
690 shlib => '$(LIB_CFLAGS) $(LIB_CPPFLAGS)',
691 lib => '$(LIB_CFLAGS) $(LIB_CPPFLAGS)',
692 dso => '$(DSO_CFLAGS) $(DSO_CPPFLAGS)',
693 bin => '$(BIN_CFLAGS) $(BIN_CPPFLAGS)'
694 } -> {$args{intent}};
695 my $target = platform->asm($args{src});
696
697 if ($args{generator}->[0] =~ /\.pl$/) {
698 $generator = '"$(PERL)"'.$generator_incs.' '.$generator
699 .' "$(PERLASM_SCHEME)"'.$incs.' '.$cppflags.$defs.' $(PROCESSSOR)';
700 } elsif ($args{generator}->[0] =~ /\.S$/) {
701 $generator = undef;
702 } else {
703 die "Generator type for $src unknown: $generator\n";
704 }
705
706 if (defined($generator)) {
707 # If the target is named foo.S in build.info, we want to
708 # end up generating foo.s in two steps.
709 if ($args{src} =~ /\.S$/) {
710 return <<"EOF";
711 $target: "$args{generator}->[0]" $deps
712 set ASM=\$(AS)
713 $generator \$@.S
714 \$(CPP) $incs $cppflags $defs \$@.S > \$@.i && move /Y \$@.i \$@
715 del /Q \$@.S
716 EOF
717 }
718 # Otherwise....
719 return <<"EOF";
720 $target: "$args{generator}->[0]" $deps
721 set ASM=\$(AS)
722 $generator \$@
723 EOF
724 }
725 return <<"EOF";
726 $target: "$args{generator}->[0]" $deps
727 \$(CPP) $incs $cppflags $defs "$args{generator}->[0]" > \$@.i && move /Y \$@.i \$@
728 EOF
729 }
730 }
731
732 sub src2obj {
733 my $asmext = platform->asmext();
734 my %args = @_;
735 my @srcs =
736 map { my $x = $_;
737 (platform->isasm($x) && grep { $x eq $_ } @generated)
738 ? platform->asm($x) : $x }
739 ( @{$args{srcs}} );
740 my $srcs = '"'.join('" "', @srcs).'"';
741 my $deps = '"'.join('" "', @srcs, @{$args{deps}}).'"';
742 my $incs = join("", map { ' -I "'.$_.'"' } @{$args{incs}});
743 my $defs = join("", map { " -D".$_ } @{$args{defs}});
744 my $cflags = { shlib => ' $(LIB_CFLAGS)',
745 lib => ' $(LIB_CFLAGS)',
746 dso => ' $(DSO_CFLAGS)',
747 bin => ' $(BIN_CFLAGS)' } -> {$args{intent}};
748 $cflags .= $incs;
749 $cflags .= { shlib => ' $(LIB_CPPFLAGS)',
750 lib => ' $(LIB_CPPFLAGS)',
751 dso => ' $(DSO_CPPFLAGS)',
752 bin => ' $(BIN_CPPFLAGS)' } -> {$args{intent}};
753 my $asflags = { shlib => ' $(LIB_ASFLAGS)',
754 lib => ' $(LIB_ASFLAGS)',
755 dso => ' $(DSO_ASFLAGS)',
756 bin => ' $(BIN_ASFLAGS)' } -> {$args{intent}};
757 my $makedepprog = $config{makedepprog};
758 if ($srcs[0] =~ /\.rc$/) {
759 my $res = platform->res($args{obj});
760 return <<"EOF";
761 $res: $deps
762 \$(RC) \$(RCFLAGS) \$(RCOUTFLAG)\$\@ $srcs
763 EOF
764 }
765 my $obj = platform->obj($args{obj});
766 my $dep = platform->dep($args{obj});
767 if ($srcs[0] =~ /\Q${asmext}\E$/) {
768 return <<"EOF";
769 $obj: $deps
770 \$(AS) $asflags \$(ASOUTFLAG)\$\@ $srcs
771 EOF
772 } elsif ($srcs[0] =~ /.S$/) {
773 return <<"EOF";
774 $obj: $deps
775 \$(CC) /EP -D__ASSEMBLER__ $cflags $defs $srcs > \$@.asm && \$(AS) $asflags \$(ASOUTFLAG)\$\@ \$@.asm
776 EOF
777 }
778 my $recipe = <<"EOF";
779 $obj: $deps
780 \$(CC) $cflags $defs -c \$(COUTFLAG)\$\@ $srcs
781 EOF
782 $recipe .= <<"EOF" unless $disabled{makedepend};
783 \$(CC) $cflags $defs /Zs /showIncludes $srcs 2>&1 > $dep
784 EOF
785 return $recipe;
786 }
787
788 # We *know* this routine is only called when we've configure 'shared'.
789 # Also, note that even though the import library built here looks like
790 # a static library, it really isn't.
791 sub obj2shlib {
792 my %args = @_;
793 my $lib = $args{lib};
794 my @objs = map { platform->convertext($_) }
795 grep { platform->isobj($_) || platform->isres($_) }
796 @{$args{objs}};
797 my @defs = map { platform->def($_) }
798 grep { platform->isdef($_) }
799 @{$args{objs}};
800 my @deps = compute_lib_depends(@{$args{deps}});
801 die "More than one exported symbols list" if scalar @defs > 1;
802 my $linklibs = join("", map { "$_\n" } @deps);
803 my $objs = join("\n", @objs);
804 my $deps = join(" ", @objs, @defs, @deps);
805 my $import = platform->sharedlib_import($lib);
806 my $dll = platform->sharedlib($lib);
807 my $shared_def = join("", map { " /def:$_" } @defs);
808 return <<"EOF"
809 # The import library may look like a static library, but it is not.
810 # We MUST make the import library depend on the DLL, in case someone
811 # mistakenly removes the latter.
812 $import: $dll
813 $dll: $deps
814 IF EXIST $full.manifest DEL /F /Q $full.manifest
815 IF EXIST \$@ DEL /F /Q \$@
816 \$(LD) \$(LDFLAGS) \$(LIB_LDFLAGS) \\
817 /implib:$import \$(LDOUTFLAG)$dll$shared_def @<< || (DEL /Q \$(\@B).* $import && EXIT 1)
818 $objs
819 $linklibs\$(LIB_EX_LIBS)
820 <<
821 IF EXIST $dll.manifest \\
822 \$(MT) \$(MTFLAGS) \$(MTINFLAG)$dll.manifest \$(MTOUTFLAG)$dll
823 IF EXIST apps\\$dll DEL /Q /F apps\\$dll
824 IF EXIST test\\$dll DEL /Q /F test\\$dll
825 IF EXIST fuzz\\$dll DEL /Q /F fuzz\\$dll
826 COPY $dll apps
827 COPY $dll test
828 COPY $dll fuzz
829 EOF
830 }
831 sub obj2dso {
832 my %args = @_;
833 my $dso = platform->dso($args{module});
834 my $dso_n = platform->dsoname($args{module});
835 my @objs = map { platform->convertext($_) }
836 grep { platform->isobj($_) || platform->isres($_) }
837 @{$args{objs}};
838 my @defs = map { platform->def($_) }
839 grep { platform->isdef($_) }
840 @{$args{objs}};
841 my @deps = compute_lib_depends(@{$args{deps}});
842 my $objs = join("\n", @objs);
843 my $linklibs = join("", map { "$_\n" } @deps);
844 my $deps = join(" ", @objs, @defs, @deps);
845 my $shared_def = join("", map { " /def:$_" } @defs);
846 return <<"EOF";
847 $dso: $deps
848 IF EXIST $dso.manifest DEL /F /Q $dso.manifest
849 \$(LD) \$(LDFLAGS) \$(DSO_LDFLAGS) \\
850 \$(LDOUTFLAG)$dso$shared_def @<< || (DEL /Q \$(\@B).* $dso_n.* && EXIT 1)
851 $objs
852 $linklibs \$(DSO_EX_LIBS)
853 <<
854 IF EXIST $dso.manifest \\
855 \$(MT) \$(MTFLAGS) \$(MTINFLAG)$dso.manifest \$(MTOUTFLAG)$dso
856 EOF
857 }
858 sub obj2lib {
859 my %args = @_;
860 my $lib = platform->staticlib($args{lib});
861 my @objs = map { platform->obj($_) } @{$args{objs}};
862 my $objs = join("\n", @objs);
863 my $deps = join(" ", @objs);
864 return <<"EOF";
865 $lib: $deps
866 \$(AR) \$(ARFLAGS) \$(AROUTFLAG)$lib @<<
867 $objs
868 <<
869 EOF
870 }
871 sub obj2bin {
872 my %args = @_;
873 my $bin = platform->bin($args{bin});
874 my @objs = map { platform->convertext($_) }
875 grep { platform->isobj($_) || platform->isres($_) }
876 @{$args{objs}};
877 my @deps = compute_lib_depends(@{$args{deps}});
878 my $objs = join("\n", @objs);
879 my $linklibs = join("", map { "$_\n" } @deps);
880 my $deps = join(" ", @objs, @deps);
881 return <<"EOF";
882 $bin: $deps
883 IF EXIST $bin.manifest DEL /F /Q $bin.manifest
884 \$(LD) \$(LDFLAGS) \$(BIN_LDFLAGS) \$(LDOUTFLAG)$bin @<<
885 $objs
886 setargv.obj
887 $linklibs\$(BIN_EX_LIBS)
888 <<
889 IF EXIST $bin.manifest \\
890 \$(MT) \$(MTFLAGS) \$(MTINFLAG)$bin.manifest \$(MTOUTFLAG)$bin
891 EOF
892 }
893 sub in2script {
894 my %args = @_;
895 my $script = $args{script};
896 my $sources = '"'.join('" "', @{$args{sources}}).'"';
897 my $dofile = abs2rel(rel2abs(catfile($config{sourcedir},
898 "util", "dofile.pl")),
899 rel2abs($config{builddir}));
900 return <<"EOF";
901 $script: $sources
902 "\$(PERL)" "-I\$(BLDDIR)" -Mconfigdata "$dofile" \\
903 "-o$target{build_file}" $sources > "$script"
904 EOF
905 }
906 sub generatedir {
907 my %args = @_;
908 my $dir = $args{dir};
909 my @deps = map { platform->convertext($_) } @{$args{deps}};
910 my @actions = ();
911 my %extinfo = ( dso => platform->dsoext(),
912 lib => platform->libext(),
913 bin => platform->binext() );
914
915 # We already have a 'test' target, and the top directory is just plain
916 # silly
917 return if $dir eq "test" || $dir eq ".";
918
919 foreach my $type (("dso", "lib", "bin", "script")) {
920 next unless defined($unified_info{dirinfo}->{$dir}->{products}->{$type});
921 # For lib object files, we could update the library. However,
922 # LIB on Windows doesn't work that way, so we won't create any
923 # actions for it, and the dependencies are already taken care of.
924 if ($type ne "lib") {
925 foreach my $prod (@{$unified_info{dirinfo}->{$dir}->{products}->{$type}}) {
926 if (dirname($prod) eq $dir) {
927 push @deps, $prod.$extinfo{$type};
928 }
929 }
930 }
931 }
932
933 my $deps = join(" ", @deps);
934 my $actions = join("\n", "", @actions);
935 return <<"EOF";
936 $dir $dir\\ : $deps$actions
937 EOF
938 }
939 "" # Important! This becomes part of the template result.
940 -}