mirror of
https://github.com/openssl/openssl.git
synced 2025-01-18 13:44:20 +08:00
Adapt the Windows makefile template to source generation
Reviewed-by: Rich Salz <rsalz@openssl.org>
This commit is contained in:
parent
2d32d3be15
commit
9a1394c54e
@ -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};
|
||||
|
Loading…
Reference in New Issue
Block a user