This gets rid of the BEGINRAW..ENDRAW sections in crypto/poly1305/build.info.
This also moves the assembler generating perl scripts to take the
output file name as last command line argument, where necessary.
Reviewed-by: Andy Polyakov <appro@openssl.org>
poly1305-sparcv9.S: asm/poly1305-sparcv9.pl
$(PERL) asm/poly1305-sparcv9.pl $(PERLASM_SCHEME) $@
poly1305-x86.s: asm/poly1305-x86.pl
- $(PERL) asm/poly1305-x86.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) > $@
+ $(PERL) asm/poly1305-x86.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) $@
poly1305-x86_64.s: asm/poly1305-x86_64.pl
- $(PERL) asm/poly1305-x86_64.pl $(PERLASM_SCHEME) > $@
+ $(PERL) asm/poly1305-x86_64.pl $(PERLASM_SCHEME) $@
poly1305-ppc.s: asm/poly1305-ppc.pl
$(PERL) asm/poly1305-ppc.pl $(PERLASM_SCHEME) $@
poly1305-ppcfp.s: asm/poly1305-ppcfp.pl
# time dependent on input length. This module on the other hand is free
# from such limitation.
+$output=pop;
+open STDOUT,">$output";
+
($CTXA,$INPB,$LEN,$PADBIT)=("A4","B4","A6","B6");
($H0,$H1,$H2,$H3,$H4,$H4a)=("A8","B8","A10","B10","B2",$LEN);
($D0,$D1,$D2,$D3)= ("A9","B9","A11","B11");
my ($h0,$h1,$h2,$h3, $t0,$t1,$t2) = map("%o$_",(0..5,7));
my ($d0,$d1,$d2,$d3) = map("%g$_",(1..4));
+my $output = pop;
+open STDOUT,">$stdout";
+
$code.=<<___;
#include "sparc_arch.h"
push(@INC,"${dir}","${dir}../../perlasm");
require "x86asm.pl";
+$output=pop;
+open STDOUT,">$output";
+
&asm_init($ARGV[0],"poly1305-x86.pl",$ARGV[$#ARGV] eq "386");
$sse2=$avx=0;
&align (4);
&asm_finish();
+
+close STDOUT;
SOURCE[../../libcrypto]=\
poly1305.c {- $target{poly1305_asm_src} -}
-BEGINRAW[Makefile(unix)]
-{- $builddir -}/poly1305-sparcv9.S: {- $sourcedir -}/asm/poly1305-sparcv9.pl
- CC="$(CC)" $(PERL) {- $sourcedir -}/asm/poly1305-sparcv9.pl $(PERLASM_SCHEME) $@
-{- $builddir -}/poly1305-x86.s: {- $sourcedir -}/asm/poly1305-x86.pl
- CC="$(CC)" $(PERL) {- $sourcedir -}/asm/poly1305-x86.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) > $@
-{- $builddir -}/poly1305-x86_64.s: {- $sourcedir -}/asm/poly1305-x86_64.pl
- CC="$(CC)" $(PERL) {- $sourcedir -}/asm/poly1305-x86_64.pl $(PERLASM_SCHEME) > $@
-{- $builddir -}/poly1305-ppc.s: {- $sourcedir -}/asm/poly1305-ppc.pl
- CC="$(CC)" $(PERL) {- $sourcedir -}/asm/poly1305-ppc.pl $(PERLASM_SCHEME) $@
-{- $builddir -}/poly1305-ppcfp.s: {- $sourcedir -}/asm/poly1305-ppcfp.pl
- CC="$(CC)" $(PERL) {- $sourcedir -}/asm/poly1305-ppcfp.pl $(PERLASM_SCHEME) $@
+GENERATE[poly1305-sparcv9.S]=asm/poly1305-sparcv9.pl $(PERLASM_SCHEME)
+GENERATE[poly1305-x86.s]=asm/poly1305-x86.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR)
+GENERATE[poly1305-x86_64.s]=asm/poly1305-x86_64.pl $(PERLASM_SCHEME)
+GENERATE[poly1305-ppc.s]=asm/poly1305-ppc.pl $(PERLASM_SCHEME)
+GENERATE[poly1305-ppcfp.s]=asm/poly1305-ppcfp.pl $(PERLASM_SCHEME)
+BEGINRAW[Makefile(unix)]
{- $builddir -}/poly1305-%.S: {- $sourcedir -}/asm/poly1305-%.pl
CC="$(CC)" $(PERL) $< $(PERLASM_SCHEME) $@
ENDRAW[Makefile(unix)]