summaryrefslogtreecommitdiffstats
path: root/Configurations
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2016-03-07 14:12:45 +0100
committerRichard Levitte <levitte@openssl.org>2016-03-09 11:22:07 +0100
commit9a1394c54e9e5d21476ee6fb5d15d1d14dd4fdf5 (patch)
tree5afae30b215061d0f5a8b6af87b2fecb883ede3d /Configurations
parent2d32d3be154f2f658a5884d1e46b0ba56d1e6c59 (diff)
Adapt the Windows makefile template to source generation
Reviewed-by: Rich Salz <rsalz@openssl.org>
Diffstat (limited to 'Configurations')
-rw-r--r--Configurations/windows-makefile.tmpl47
1 files changed, 47 insertions, 0 deletions
diff --git a/Configurations/windows-makefile.tmpl b/Configurations/windows-makefile.tmpl
index 6f3c8483e2..77cc377fce 100644
--- a/Configurations/windows-makefile.tmpl
+++ b/Configurations/windows-makefile.tmpl
@@ -167,6 +167,53 @@ configdata.pm: {- $config{build_file_template} -} $(SRCDIR)\Configure
return map { shlib_import($_) } @_;
}
+ sub generatesrc {
+ my %args = @_;
+ (my $target = $args{src}) =~ s/\.[sS]$/.asm/;
+ my $generator = join(" ", @{$args{generator}});
+
+ if ($target !~ /\.asm$/) {
+ return <<"EOF";
+$target: $args{generator}->[0]
+ \$(PERL) $generator > \$@
+EOF
+ } else {
+ if ($args{generator}->[0] =~ /\.pl$/) {
+ $generator = '$(PERL) '.$generator;
+ } elsif ($args{generator}->[0] =~ /\.S$/) {
+ $generator = undef;
+ } else {
+ die "Generator type for $src unknown: $generator\n";
+ }
+
+ if (defined($generator)) {
+ # If the target is named foo.S in build.info, we want to
+ # end up generating foo.s in two steps.
+ if ($args{src} =~ /\.S$/) {
+ return <<"EOF";
+$target: $args{generator}->[0]
+ set ASM=\$(AS)
+ set CC=\$(CC)
+ $generator \$@.S
+ \$(CC) \$(CFLAGS) /EP /C \$@.S > \$@
+ del /Q \$@.S
+EOF
+ }
+ # Otherwise....
+ return <<"EOF";
+$target: $args{generator}->[0]
+ set ASM=\$(AS)
+ set CC=\$(CC)
+ $generator \$@
+EOF
+ }
+ return <<"EOF";
+$target: $args{generator}->[0]
+ \$(CC) \$(CFLAGS) /EP /C \$< > \$@
+EOF
+ }
+ }
+
sub src2obj {
my %args = @_;
my $obj = $args{obj};