diff options
author | Richard Levitte <levitte@openssl.org> | 2019-10-13 12:33:15 +0200 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2019-10-14 16:58:20 +0200 |
commit | 70d9675342efbc9fe518e082c44f3ad80a1e4671 (patch) | |
tree | 4e94fb03adb82128dbfb5c9c2d36bec847b71342 /Configurations/descrip.mms.tmpl | |
parent | 9ff872e8a325651935cf1a42dc573bb6760fa0f8 (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/descrip.mms.tmpl')
-rw-r--r-- | Configurations/descrip.mms.tmpl | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Configurations/descrip.mms.tmpl b/Configurations/descrip.mms.tmpl index e177f2202e..28e7663a54 100644 --- a/Configurations/descrip.mms.tmpl +++ b/Configurations/descrip.mms.tmpl @@ -775,10 +775,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"; |