summaryrefslogtreecommitdiffstats
path: root/Configurations/common.tmpl
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2016-03-07 14:37:00 +0100
committerRichard Levitte <levitte@openssl.org>2016-03-07 18:25:56 +0100
commitae4c7450754ea13265edd69e6ff74d87c89401cd (patch)
tree8acb4c1b1120b58109e4b66d60b2cccf9750b6d7 /Configurations/common.tmpl
parent667867cced0013c1cfd8d7a9efa43b8f2cebc942 (diff)
Unified - Add the build.info command GENERATE, to generate source files
In some cases, one might want to generate some source files from others, that's done as follows: GENERATE[foo.s]=asm/something.pl $(CFLAGS) GENERATE[bar.s]=asm/bar.S The value of each GENERATE line is a command line or part of it. Configure places no rules on the command line, except the the first item muct be the generator file. It is, however, entirely up to the build file template to define exactly how those command lines should be handled, how the output is captured and so on. Reviewed-by: Rich Salz <rsalz@openssl.org>
Diffstat (limited to 'Configurations/common.tmpl')
-rw-r--r--Configurations/common.tmpl22
1 files changed, 21 insertions, 1 deletions
diff --git a/Configurations/common.tmpl b/Configurations/common.tmpl
index 7e452dd28f..b97abfb323 100644
--- a/Configurations/common.tmpl
+++ b/Configurations/common.tmpl
@@ -32,6 +32,22 @@
@newlist;
}
+ sub dogenerate {
+ my $src = shift;
+ return "" if $cache{$src};
+ my %opts = @_;
+ if ($unified_info{generate}->{$src}) {
+ $OUT .= generatesrc(src => $src,
+ generator => $unified_info{generate}->{$src},
+ deps => $unified_info{depends}->{$src},
+ %opts);
+ foreach (@{$unified_info{depends}->{$src}}) {
+ dogenerate($_, %opts);
+ }
+ }
+ $cache{$src} = 1;
+ }
+
# doobj is responsible for producing all the recipes that build
# object files as well as dependency files.
sub doobj {
@@ -43,10 +59,14 @@
if (@{$unified_info{sources}->{$obj}}) {
$OUT .= src2obj(obj => $obj_no_o,
srcs => $unified_info{sources}->{$obj},
- deps => [ reducedepends(resolvedepends($obj)) ],
+ deps => $unified_info{depends}->{$obj},
incs => [ @{$unified_info{includes}->{$bin}},
@{$unified_info{includes}->{$obj}} ],
%opts);
+ foreach ((@{$unified_info{sources}->{$obj}},
+ @{$unified_info{depends}->{$obj}})) {
+ dogenerate($_, %opts);
+ }
}
$cache{$obj} = 1;
}