Unified - adapt the generation of des assembler to use GENERATE
authorRichard Levitte <levitte@openssl.org>
Mon, 7 Mar 2016 14:46:42 +0000 (15:46 +0100)
committerRichard Levitte <levitte@openssl.org>
Wed, 9 Mar 2016 10:09:26 +0000 (11:09 +0100)
This gets rid of the BEGINRAW..ENDRAW sections in crypto/des/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>
crypto/des/Makefile.in
crypto/des/asm/crypt586.pl
crypto/des/asm/des-586.pl
crypto/des/build.info

index c056804d352db70364b0074ab8739d1662206b71..93a715a7fb64862b5fc47f43bfb092821e085b99 100644 (file)
@@ -59,9 +59,9 @@ dest4-sparcv9.S:      asm/dest4-sparcv9.pl
        $(PERL) asm/dest4-sparcv9.pl $(PERLASM_SCHEME) $@
 
 des-586.s:     asm/des-586.pl ../perlasm/x86asm.pl ../perlasm/cbc.pl
-       $(PERL) asm/des-586.pl $(PERLASM_SCHEME) $(CFLAGS) $@
+       $(PERL) asm/des-586.pl $(PERLASM_SCHEME) $(CFLAGS) $@
 crypt586.s:    asm/crypt586.pl ../perlasm/x86asm.pl ../perlasm/cbc.pl
-       $(PERL) asm/crypt586.pl $(PERLASM_SCHEME) $(CFLAGS) $@
+       $(PERL) asm/crypt586.pl $(PERLASM_SCHEME) $(CFLAGS) $@
 
 files:
        $(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO
index e36f7d44bd7dc4e71f35df07e795a275ddb5fefb..d94528ff7c28d506c4a61da2d15c1aadddcb39b0 100644 (file)
@@ -10,6 +10,9 @@ $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1;
 push(@INC,"${dir}","${dir}../../perlasm");
 require "x86asm.pl";
 
+$output=pop;
+open STDOUT,">$output";
+
 &asm_init($ARGV[0],"crypt586.pl");
 
 $L="edi";
@@ -19,6 +22,8 @@ $R="esi";
 &fcrypt_body("fcrypt_body");
 &asm_finish();
 
+close STDOUT;
+
 sub fcrypt_body
        {
        local($name,$do_ip)=@_;
index bd6a7dd6b76b020da173de26b1c0e95dd4a6806e..e56eae47ddcba4e9c8a6a89519a6546956e291cb 100644 (file)
@@ -15,6 +15,9 @@ require "desboth.pl";
 # format.
 #
 
+$output=pop;
+open STDOUT,">$output";
+
 &asm_init($ARGV[0],"des-586.pl");
 
 $L="edi";
@@ -39,6 +42,8 @@ $small_footprint=1 if (grep(/\-DOPENSSL_SMALL_FOOTPRINT/,@ARGV));
 
 &asm_finish();
 
+close STDOUT;
+
 sub DES_encrypt_internal()
        {
        &function_begin_B("_x86_DES_encrypt");
index d3c5c1f64cf91c3e1a432131faaea6d0aa00aac5..ee2f67fa5248af2c056b3db134e66bf736b5891f 100644 (file)
@@ -8,16 +8,11 @@ SOURCE[../../libcrypto]=\
         fcrypt.c xcbc_enc.c rpc_enc.c  cbc_cksm.c \
         read2pwd.c
 
-BEGINRAW[Makefile]
-##### DES assembler implementations
+GENERATE[des_enc-sparc.S]=asm/des_enc.m4
+GENERATE[dest4-sparcv9.S]=asm/dest4-sparcv9.pl $(PERLASM_SCHEME)
 
-{- $builddir -}/des_enc-sparc.S:       {- $sourcedir -}/asm/des_enc.m4
-       m4 -B 8192 {- $sourcedir -}/asm/des_enc.m4 > $@
-{- $builddir -}/dest4-sparcv9.S:       {- $sourcedir -}/asm/dest4-sparcv9.pl
-       CC="$(CC)" $(PERL) {- $sourcedir -}/asm/dest4-sparcv9.pl $(PERLASM_SCHEME) $@
+GENERATE[des-586.s]=asm/des-586.pl $(PERLASM_SCHEME) $(CFLAGS)
+DEPEND[des-586.s]=../perlasm/x86asm.pl ../perlasm/cbc.pl
+GENERATE[crypt586.s]=asm/crypt586.pl $(PERLASM_SCHEME) $(CFLAGS)
+DEPEND[crypt586.s]=../perlasm/x86asm.pl ../perlasm/cbc.pl
 
-{- $builddir -}/des-586.s:     {- $sourcedir -}/asm/des-586.pl {- $sourcetop -}/crypto/perlasm/x86asm.pl {- $sourcetop -}/crypto/perlasm/cbc.pl
-       CC="$(CC)" $(PERL) {- $sourcedir -}/asm/des-586.pl $(PERLASM_SCHEME) $(CFLAGS) > $@
-{- $builddir -}/crypt586.s:    {- $sourcedir -}/asm/crypt586.pl {- $sourcetop -}/crypto/perlasm/x86asm.pl {- $sourcetop -}/crypto/perlasm/cbc.pl
-       CC="$(CC)" $(PERL) {- $sourcedir -}/asm/crypt586.pl $(PERLASM_SCHEME) $(CFLAGS) > $@
-ENDRAW[Makefile]