diff options
author | Richard Levitte <levitte@openssl.org> | 2021-02-25 16:55:39 +0100 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2021-03-03 14:47:01 +0100 |
commit | 3f399e3787788b1cc3832e254c53cda42873d847 (patch) | |
tree | 9eb93a058ff17e99b3c1b66926b77ff25f036134 /Configurations | |
parent | 8593ff00cc66e330228164ae5422f80ef93ed35d (diff) |
build.info: Add the possibility to add dependencies on raw targets
We need to add something for the 'tests' target to depend on, so a
special syntax for those is introduced:
DEPEND[|tests|]=fipsmodule.cnf
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14320)
Diffstat (limited to 'Configurations')
-rw-r--r-- | Configurations/common.tmpl | 18 | ||||
-rw-r--r-- | Configurations/descrip.mms.tmpl | 8 | ||||
-rw-r--r-- | Configurations/unix-Makefile.tmpl | 8 | ||||
-rw-r--r-- | Configurations/windows-makefile.tmpl | 8 |
4 files changed, 40 insertions, 2 deletions
diff --git a/Configurations/common.tmpl b/Configurations/common.tmpl index 5db3471fe2..e25a61fbed 100644 --- a/Configurations/common.tmpl +++ b/Configurations/common.tmpl @@ -137,6 +137,8 @@ # generated source file. sub dogenerate { my $src = shift; + # Safety measure + return "" unless defined $unified_info{generate}->{$_}; return "" if $cache{$src}; my $obj = shift; my $bin = shift; @@ -171,6 +173,17 @@ $cache{$src} = 1; } + sub dotarget { + my $target = shift; + return "" if $cache{$target}; + $OUT .= generatetarget(target => $target, + deps => $unified_info{depends}->{$target}); + foreach (@{$unified_info{depends}->{$target}}) { + dogenerate($_); + } + $cache{$target} = 1; + } + # doobj is responsible for producing all the recipes that build # object files as well as dependency files. sub doobj { @@ -463,11 +476,12 @@ # Start with populating the cache with all the overrides %cache = map { $_ => 1 } @{$unified_info{overrides}}; - # Build mandatory generated headers + # Build mandatory header file generators foreach (@{$unified_info{depends}->{""}}) { dogenerate($_); } - # Build all known libraries, modules, programs and scripts. + # Build all known targets, libraries, modules, programs and scripts. # Everything else will be handled as a consequence. + foreach (@{$unified_info{targets}}) { dotarget($_); } foreach (@{$unified_info{libraries}}) { dolib($_); } foreach (@{$unified_info{modules}}) { domodule($_); } foreach (@{$unified_info{programs}}) { dobin($_); } diff --git a/Configurations/descrip.mms.tmpl b/Configurations/descrip.mms.tmpl index 3f015a0eb5..abc344594d 100644 --- a/Configurations/descrip.mms.tmpl +++ b/Configurations/descrip.mms.tmpl @@ -795,6 +795,14 @@ reconfigure reconf : return ([ @before ], [ @after ]); } + sub generatetarget { + my %args = @_; + my $deps = join(" ", @{$args{deps}}); + return <<"EOF"; +$args{target} : $deps +EOF + } + sub generatesrc { my %args = @_; my $generator = join(" ", @{$args{generator}}); diff --git a/Configurations/unix-Makefile.tmpl b/Configurations/unix-Makefile.tmpl index aa4b3ec0ec..610a6f6557 100644 --- a/Configurations/unix-Makefile.tmpl +++ b/Configurations/unix-Makefile.tmpl @@ -1305,6 +1305,14 @@ reconfigure reconf: } @_; } + sub generatetarget { + my %args = @_; + my $deps = join(" ", @{$args{deps}}); + return <<"EOF"; +$args{target}: $deps +EOF + } + sub generatesrc { my %args = @_; my $generator = join(" ", @{$args{generator}}); diff --git a/Configurations/windows-makefile.tmpl b/Configurations/windows-makefile.tmpl index ce042d6ee8..f19efba7d1 100644 --- a/Configurations/windows-makefile.tmpl +++ b/Configurations/windows-makefile.tmpl @@ -627,6 +627,14 @@ reconfigure reconf: return map { platform->sharedlib_import($_) // platform->staticlib($_) } @_; } + sub generatetarget { + my %args = @_; + my $deps = join(" ", @{$args{deps}}); + return <<"EOF"; +$args{target}: $deps +EOF + } + sub generatesrc { my %args = @_; my ($gen0, @gens) = @{$args{generator}}; |