summaryrefslogtreecommitdiffstats
path: root/Configurations/windows-makefile.tmpl
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2019-10-13 12:33:15 +0200
committerRichard Levitte <levitte@openssl.org>2019-10-14 16:58:20 +0200
commit70d9675342efbc9fe518e082c44f3ad80a1e4671 (patch)
tree4e94fb03adb82128dbfb5c9c2d36bec847b71342 /Configurations/windows-makefile.tmpl
parent9ff872e8a325651935cf1a42dc573bb6760fa0f8 (diff)
Building: Add modules with DEPENDs to GENERATEd files
For files GENERATEd from templates (.in files), any perl module (.pm file) that the file depends on will automatically be used. This means that these two lines: GENERATE[foo]=foo.in DEPEND[foo]=whatever.pm will emit this command in a Makefile (or corresponding): foo: foo.in whatever.pm configdata.pm $(PERL) -I. -Ipathto -Mwhatever -Mconfigdata $(SRCDIR)/util/dofile.pl \\ foo.in > foo Note that configdata.pm is automatically added, since util/dofile.pl itself depends on it. Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> (Merged from https://github.com/openssl/openssl/pull/10162)
Diffstat (limited to 'Configurations/windows-makefile.tmpl')
-rw-r--r--Configurations/windows-makefile.tmpl8
1 files changed, 6 insertions, 2 deletions
diff --git a/Configurations/windows-makefile.tmpl b/Configurations/windows-makefile.tmpl
index 4a83d0cee6..19e3f4e0ee 100644
--- a/Configurations/windows-makefile.tmpl
+++ b/Configurations/windows-makefile.tmpl
@@ -558,10 +558,14 @@ EOF
my $dofile = abs2rel(rel2abs(catfile($config{sourcedir},
"util", "dofile.pl")),
rel2abs($config{builddir}));
+ my @modules = ( 'configdata.pm',
+ grep { $_ =~ m|\.pm$| } @{$args{deps}} );
+ my %moduleincs = map { '"-I'.dirname($_).'"' => 1 } @modules;
+ @modules = map { "-M".basename($_, '.pm') } @modules;
+ my $modules = join(' ', '', sort keys %moduleincs, @modules);
return <<"EOF";
$target: "$args{generator}->[0]" $deps
- "\$(PERL)" "-I\$(BLDDIR)" -Mconfigdata "$dofile" \\
- "-o$target{build_file}" $generator > \$@
+ "\$(PERL)"$modules "$dofile" "-o$target{build_file}" $generator > \$@
EOF
} else {
return <<"EOF";