[openssl-commits] [openssl] master update

Richard Levitte levitte at openssl.org
Wed Mar 9 10:09:37 UTC 2016


The branch master has been updated
       via  81e61d7cb51988a0cde11c3b924052213b50d979 (commit)
       via  e87e380a179d14284cd5d6cd65a52ace7a98de45 (commit)
       via  3c9d51ce8ba51a8ef7b58f1f07c8d9c9df2ca665 (commit)
       via  ac9888e5a9cc7b581323614c615b669f655512a1 (commit)
       via  fe7f8263afc2ad906ac9b834ae6dc7a2ed25c6b7 (commit)
       via  57c83b3c3a61796ecd0e2e87109176ac9f8eae30 (commit)
       via  4f0d5f1849fba056ae2e626dbce976efc4586383 (commit)
       via  3aa3af68a52ed8e6fba9c5a7659943714593ac88 (commit)
       via  6d33da3487143023b176ebe8164cf05df6f5fbf6 (commit)
       via  73d2fb66efdb63d419f0663b3f41b7db4b14fcd3 (commit)
       via  5384d1e4ebd58f31a06b2f5d1f6c4b28f63d72ed (commit)
       via  db1983980b1a8978f65ce631aae48b5769a803c6 (commit)
       via  df0cb57ca3528ed0dd5ba47e77d724dc761a454d (commit)
       via  a4b4bb086bf9de74b3fce00c32d427c003506272 (commit)
       via  0a4edb931b883b9973721ae012e60c028387dd50 (commit)
       via  184bc45f683c76531d7e065b6553ca9086564576 (commit)
       via  10eab320a5e4b585f640b5f11d21eebaebb1814a (commit)
      from  71a07ca7bf207ccc795330441da76b02c7261091 (commit)


- Log -----------------------------------------------------------------
commit 81e61d7cb51988a0cde11c3b924052213b50d979
Author: Richard Levitte <levitte at openssl.org>
Date:   Mon Mar 7 15:50:21 2016 +0100

    Unified - adapt the generation of whirlpool assembler to use GENERATE
    
    This gets rid of the BEGINRAW..ENDRAW sections in crypto/whrlpool/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 at openssl.org>

commit e87e380a179d14284cd5d6cd65a52ace7a98de45
Author: Richard Levitte <levitte at openssl.org>
Date:   Mon Mar 7 15:49:53 2016 +0100

    Unified - adapt the generation of sha assembler to use GENERATE
    
    This gets rid of the BEGINRAW..ENDRAW sections in crypto/sha/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 at openssl.org>

commit 3c9d51ce8ba51a8ef7b58f1f07c8d9c9df2ca665
Author: Richard Levitte <levitte at openssl.org>
Date:   Mon Mar 7 15:48:49 2016 +0100

    Unified - adapt the generation of rc4 assembler to use GENERATE
    
    This gets rid of the BEGINRAW..ENDRAW sections in crypto/rc4/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 at openssl.org>

commit ac9888e5a9cc7b581323614c615b669f655512a1
Author: Richard Levitte <levitte at openssl.org>
Date:   Mon Mar 7 15:49:09 2016 +0100

    Unified - adapt the generation of rc5 assembler to use GENERATE
    
    This gets rid of the BEGINRAW..ENDRAW sections in crypto/rc5/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 at openssl.org>

commit fe7f8263afc2ad906ac9b834ae6dc7a2ed25c6b7
Author: Richard Levitte <levitte at openssl.org>
Date:   Mon Mar 7 15:49:34 2016 +0100

    Unified - adapt the generation of ripemd assembler to use GENERATE
    
    This gets rid of the BEGINRAW..ENDRAW sections in crypto/ripemd/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 at openssl.org>

commit 57c83b3c3a61796ecd0e2e87109176ac9f8eae30
Author: Richard Levitte <levitte at openssl.org>
Date:   Mon Mar 7 15:47:35 2016 +0100

    Unified - adapt the generation of md5 assembler to use GENERATE
    
    This gets rid of the BEGINRAW..ENDRAW sections in crypto/md5/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 at openssl.org>

commit 4f0d5f1849fba056ae2e626dbce976efc4586383
Author: Richard Levitte <levitte at openssl.org>
Date:   Mon Mar 7 15:47:57 2016 +0100

    Unified - adapt the generation of modes assembler to use GENERATE
    
    This gets rid of the BEGINRAW..ENDRAW sections in crypto/modes/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 at openssl.org>

commit 3aa3af68a52ed8e6fba9c5a7659943714593ac88
Author: Richard Levitte <levitte at openssl.org>
Date:   Mon Mar 7 15:48:25 2016 +0100

    Unified - adapt the generation of poly1305 assembler to use GENERATE
    
    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 at openssl.org>

commit 6d33da3487143023b176ebe8164cf05df6f5fbf6
Author: Richard Levitte <levitte at openssl.org>
Date:   Mon Mar 7 15:46:42 2016 +0100

    Unified - adapt the generation of des assembler to use GENERATE
    
    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 at openssl.org>

commit 73d2fb66efdb63d419f0663b3f41b7db4b14fcd3
Author: Richard Levitte <levitte at openssl.org>
Date:   Mon Mar 7 15:47:09 2016 +0100

    Unified - adapt the generation of ec assembler to use GENERATE
    
    This gets rid of the BEGINRAW..ENDRAW sections in crypto/ec/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 at openssl.org>

commit 5384d1e4ebd58f31a06b2f5d1f6c4b28f63d72ed
Author: Richard Levitte <levitte at openssl.org>
Date:   Mon Mar 7 15:43:26 2016 +0100

    Unified - adapt the generation of camellia assembler to use GENERATE
    
    This gets rid of the BEGINRAW..ENDRAW sections in crypto/camellia/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 at openssl.org>

commit db1983980b1a8978f65ce631aae48b5769a803c6
Author: Richard Levitte <levitte at openssl.org>
Date:   Mon Mar 7 15:45:39 2016 +0100

    Unified - adapt the generation of cast assembler to use GENERATE
    
    This gets rid of the BEGINRAW..ENDRAW sections in crypto/cast/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 at openssl.org>

commit df0cb57ca3528ed0dd5ba47e77d724dc761a454d
Author: Richard Levitte <levitte at openssl.org>
Date:   Mon Mar 7 15:46:17 2016 +0100

    Unified - adapt the generation of chacha assembler to use GENERATE
    
    This gets rid of the BEGINRAW..ENDRAW sections in crypto/chacha/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 at openssl.org>

commit a4b4bb086bf9de74b3fce00c32d427c003506272
Author: Richard Levitte <levitte at openssl.org>
Date:   Mon Mar 7 19:48:17 2016 +0100

    Because crypto/build.info demands CFLAGS_Q, descrip.mms.tmpl must deliver
    
    Reviewed-by: Andy Polyakov <appro at openssl.org>

commit 0a4edb931b883b9973721ae012e60c028387dd50
Author: Richard Levitte <levitte at openssl.org>
Date:   Mon Mar 7 15:00:45 2016 +0100

    Unified - adapt the generation of cpuid, uplink and buildinf to use GENERATE
    
    This gets rid of the BEGINRAW..ENDRAW sections in crypto/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 at openssl.org>

commit 184bc45f683c76531d7e065b6553ca9086564576
Author: Richard Levitte <levitte at openssl.org>
Date:   Mon Mar 7 15:07:35 2016 +0100

    Unified - adapt the generation of aes assembler to use GENERATE
    
    This gets rid of the BEGINRAW..ENDRAW sections in crypto/aes/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 at openssl.org>

commit 10eab320a5e4b585f640b5f11d21eebaebb1814a
Author: Richard Levitte <levitte at openssl.org>
Date:   Mon Mar 7 15:13:01 2016 +0100

    Unified - adapt the generation of blowfish assembler to use GENERATE
    
    This gets rid of the BEGINRAW..ENDRAW sections in crypto/bf/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 at openssl.org>

-----------------------------------------------------------------------

Summary of changes:
 Configurations/descrip.mms.tmpl          |   1 +
 crypto/Makefile.in                       |  12 ++--
 crypto/aes/Makefile.in                   |  20 +++---
 crypto/aes/asm/aes-586.pl                |   6 ++
 crypto/aes/asm/aesni-x86.pl              |   6 ++
 crypto/aes/asm/vpaes-x86.pl              |   6 ++
 crypto/aes/build.info                    |  81 ++++++++++-------------
 crypto/alphacpuid.pl                     |   6 ++
 crypto/bf/Makefile.in                    |   2 +-
 crypto/bf/asm/bf-586.pl                  |   5 ++
 crypto/bf/build.info                     |   8 +--
 crypto/build.info                        |  43 ++++--------
 crypto/camellia/Makefile.in              |   4 +-
 crypto/camellia/asm/cmll-x86.pl          |   5 ++
 crypto/camellia/build.info               |  13 ++--
 crypto/cast/Makefile.in                  |   2 +-
 crypto/cast/asm/cast-586.pl              |   5 ++
 crypto/cast/build.info                   |   8 +--
 crypto/chacha/Makefile.in                |   4 +-
 crypto/chacha/asm/chacha-c64xplus.pl     |   3 +
 crypto/chacha/asm/chacha-x86.pl          |   5 ++
 crypto/chacha/build.info                 |  11 ++--
 crypto/des/Makefile.in                   |   4 +-
 crypto/des/asm/crypt586.pl               |   5 ++
 crypto/des/asm/des-586.pl                |   5 ++
 crypto/des/build.info                    |  17 ++---
 crypto/ec/Makefile.in                    |   6 +-
 crypto/ec/asm/ecp_nistz256-x86.pl        |   5 ++
 crypto/ec/build.info                     |  14 ++--
 crypto/md5/Makefile.in                   |   4 +-
 crypto/md5/asm/md5-586.pl                |   5 ++
 crypto/md5/build.info                    |  12 ++--
 crypto/modes/Makefile.in                 |  10 +--
 crypto/modes/asm/ghash-alpha.pl          |   2 +-
 crypto/modes/asm/ghash-ia64.pl           |   2 +-
 crypto/modes/asm/ghash-x86.pl            |   5 ++
 crypto/modes/build.info                  |  31 +++------
 crypto/poly1305/Makefile.in              |   4 +-
 crypto/poly1305/asm/poly1305-c64xplus.pl |   3 +
 crypto/poly1305/asm/poly1305-sparcv9.pl  |   3 +
 crypto/poly1305/asm/poly1305-x86.pl      |   5 ++
 crypto/poly1305/build.info               |  17 ++---
 crypto/rc4/Makefile.in                   |   8 +--
 crypto/rc4/asm/rc4-586.pl                |   4 ++
 crypto/rc4/asm/rc4-ia64.pl               |   5 ++
 crypto/rc4/build.info                    |  18 ++----
 crypto/rc5/Makefile.in                   |   2 +-
 crypto/rc5/asm/rc5-586.pl                |   5 ++
 crypto/rc5/build.info                    |   8 +--
 crypto/ripemd/Makefile.in                |   2 +-
 crypto/ripemd/asm/rmd-586.pl             |   5 ++
 crypto/ripemd/build.info                 |   8 +--
 crypto/sha/Makefile.in                   |  20 +++---
 crypto/sha/asm/sha1-586.pl               |   5 ++
 crypto/sha/asm/sha1-ia64.pl              |   4 +-
 crypto/sha/asm/sha256-586.pl             |   5 ++
 crypto/sha/asm/sha512-586.pl             |   5 ++
 crypto/sha/asm/sha512-ia64.pl            |   2 +-
 crypto/sha/build.info                    | 108 ++++++++++++-------------------
 crypto/whrlpool/Makefile.in              |   4 +-
 crypto/whrlpool/asm/wp-mmx.pl            |   5 ++
 crypto/whrlpool/build.info               |   9 +--
 crypto/x86cpuid.pl                       |   6 ++
 ms/uplink-x86.pl                         |   5 ++
 64 files changed, 339 insertions(+), 319 deletions(-)

diff --git a/Configurations/descrip.mms.tmpl b/Configurations/descrip.mms.tmpl
index 84213cc..294c422 100644
--- a/Configurations/descrip.mms.tmpl
+++ b/Configurations/descrip.mms.tmpl
@@ -129,6 +129,7 @@ ENGINESDIR={- $osslprefix -}ENGINES:
 
 CC= {- $target{cc} -}
 CFLAGS= /DEFINE=({- join(",", @{$target{defines}}, @{$config{defines}},"OPENSSLDIR=\"\"\"\$(OPENSSLDIR)\"\"\"","ENGINESDIR=\"\"\"\$(ENGINESDIR)\"\"\"") -}) {- $target{cflags} -} {- $config{cflags} -}
+CFLAGS_Q=$(CFLAGS)
 DEPFLAG= /DEFINE=({- join(",", @{$config{depdefines}}) -})
 LDFLAGS= {- $target{lflags} -}
 EX_LIBS= {- $target{ex_libs} ? ",".$target{ex_libs} : "" -}{- $config{ex_libs} ? ",".$config{ex_libs} : "" -}
diff --git a/crypto/Makefile.in b/crypto/Makefile.in
index 9e407df..7a5a988 100644
--- a/crypto/Makefile.in
+++ b/crypto/Makefile.in
@@ -64,7 +64,7 @@ buildinf.h: ../Makefile
 	$(PERL) $(TOP)/util/mkbuildinf.pl "$(CC) $(CFLAGS_Q)" "$(PLATFORM)" >buildinf.h
 
 x86cpuid.s:	x86cpuid.pl perlasm/x86asm.pl
-	$(PERL) x86cpuid.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) > $@
+	$(PERL) x86cpuid.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) $@
 
 applink.o:	$(TOP)/ms/applink.c
 	$(CC) $(CFLAGS) -c -o $@ $(TOP)/ms/applink.c
@@ -73,18 +73,18 @@ uplink.o:	$(TOP)/ms/uplink.c applink.o
 	$(CC) $(CFLAGS) -c -o $@ $(TOP)/ms/uplink.c
 
 uplink-x86.s:	$(TOP)/ms/uplink-x86.pl
-	$(PERL) $(TOP)/ms/uplink-x86.pl $(PERLASM_SCHEME) > $@
+	$(PERL) $(TOP)/ms/uplink-x86.pl $(PERLASM_SCHEME) $@
 
-x86_64cpuid.s:	x86_64cpuid.pl;	$(PERL) x86_64cpuid.pl $(PERLASM_SCHEME) > $@
+x86_64cpuid.s:	x86_64cpuid.pl;	$(PERL) x86_64cpuid.pl $(PERLASM_SCHEME) $@
 ia64cpuid.s:	ia64cpuid.S;	$(CC) $(CFLAGS) -E ia64cpuid.S > $@
 ppccpuid.s:	ppccpuid.pl;	$(PERL) ppccpuid.pl $(PERLASM_SCHEME) $@
 pariscid.s:	pariscid.pl;	$(PERL) pariscid.pl $(PERLASM_SCHEME) $@
 alphacpuid.s:	alphacpuid.pl
 	(preproc=$$$$.$@.S; trap "rm $$preproc" INT; \
-	$(PERL) alphacpuid.pl > $$preproc && \
+	$(PERL) alphacpuid.pl $$preproc && \
 	$(CC) -E -P $$preproc > $@ && rm $$preproc)
-arm64cpuid.S:	arm64cpuid.pl;	$(PERL) arm64cpuid.pl $(PERLASM_SCHEME) > $@
-armv4cpuid.S:	armv4cpuid.pl;	$(PERL) armv4cpuid.pl $(PERLASM_SCHEME) > $@
+arm64cpuid.S:	arm64cpuid.pl;	$(PERL) arm64cpuid.pl $(PERLASM_SCHEME) $@
+armv4cpuid.S:	armv4cpuid.pl;	$(PERL) armv4cpuid.pl $(PERLASM_SCHEME) $@
 
 subdirs:
 	@target=all; $(RECURSIVE_MAKE)
diff --git a/crypto/aes/Makefile.in b/crypto/aes/Makefile.in
index 6ece343..0439245 100644
--- a/crypto/aes/Makefile.in
+++ b/crypto/aes/Makefile.in
@@ -45,26 +45,26 @@ aes-ia64.s: asm/aes-ia64.S
 	$(CC) $(CFLAGS) -E asm/aes-ia64.S > $@
 
 aes-586.s:	asm/aes-586.pl ../perlasm/x86asm.pl
-	$(PERL) asm/aes-586.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) > $@
+	$(PERL) asm/aes-586.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) $@
 vpaes-x86.s:	asm/vpaes-x86.pl ../perlasm/x86asm.pl
-	$(PERL) asm/vpaes-x86.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) > $@
+	$(PERL) asm/vpaes-x86.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) $@
 aesni-x86.s:	asm/aesni-x86.pl ../perlasm/x86asm.pl
-	$(PERL) asm/aesni-x86.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) > $@
+	$(PERL) asm/aesni-x86.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) $@
 
 aes-x86_64.s: asm/aes-x86_64.pl
-	$(PERL) asm/aes-x86_64.pl $(PERLASM_SCHEME) > $@
+	$(PERL) asm/aes-x86_64.pl $(PERLASM_SCHEME) $@
 vpaes-x86_64.s:	asm/vpaes-x86_64.pl
-	$(PERL) asm/vpaes-x86_64.pl $(PERLASM_SCHEME) > $@
+	$(PERL) asm/vpaes-x86_64.pl $(PERLASM_SCHEME) $@
 bsaes-x86_64.s:	asm/bsaes-x86_64.pl
-	$(PERL) asm/bsaes-x86_64.pl $(PERLASM_SCHEME) > $@
+	$(PERL) asm/bsaes-x86_64.pl $(PERLASM_SCHEME) $@
 aesni-x86_64.s: asm/aesni-x86_64.pl
-	$(PERL) asm/aesni-x86_64.pl $(PERLASM_SCHEME) > $@
+	$(PERL) asm/aesni-x86_64.pl $(PERLASM_SCHEME) $@
 aesni-sha1-x86_64.s:	asm/aesni-sha1-x86_64.pl
-	$(PERL) asm/aesni-sha1-x86_64.pl $(PERLASM_SCHEME) > $@
+	$(PERL) asm/aesni-sha1-x86_64.pl $(PERLASM_SCHEME) $@
 aesni-sha256-x86_64.s:	asm/aesni-sha256-x86_64.pl
-	$(PERL) asm/aesni-sha256-x86_64.pl $(PERLASM_SCHEME) > $@
+	$(PERL) asm/aesni-sha256-x86_64.pl $(PERLASM_SCHEME) $@
 aesni-mb-x86_64.s:	asm/aesni-mb-x86_64.pl
-	$(PERL) asm/aesni-mb-x86_64.pl $(PERLASM_SCHEME) > $@
+	$(PERL) asm/aesni-mb-x86_64.pl $(PERLASM_SCHEME) $@
 
 aes-sparcv9.S: asm/aes-sparcv9.pl
 	$(PERL) asm/aes-sparcv9.pl $(PERLASM_SCHEME) $@
diff --git a/crypto/aes/asm/aes-586.pl b/crypto/aes/asm/aes-586.pl
index 767f204..5a7f1b4 100755
--- a/crypto/aes/asm/aes-586.pl
+++ b/crypto/aes/asm/aes-586.pl
@@ -191,6 +191,10 @@ $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1;
 push(@INC,"${dir}","${dir}../../perlasm");
 require "x86asm.pl";
 
+$output = pop;
+open OUT,">$output";
+*STDOUT=*OUT;
+
 &asm_init($ARGV[0],"aes-586.pl",$x86only = $ARGV[$#ARGV] eq "386");
 &static_label("AES_Te");
 &static_label("AES_Td");
@@ -2985,3 +2989,5 @@ sub deckey()
 &asciz("AES for x86, CRYPTOGAMS by <appro\@openssl.org>");
 
 &asm_finish();
+
+close STDOUT;
diff --git a/crypto/aes/asm/aesni-x86.pl b/crypto/aes/asm/aesni-x86.pl
index 536f035..b85d0c4 100644
--- a/crypto/aes/asm/aesni-x86.pl
+++ b/crypto/aes/asm/aesni-x86.pl
@@ -67,6 +67,10 @@ $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1;
 push(@INC,"${dir}","${dir}../../perlasm");
 require "x86asm.pl";
 
+$output = pop;
+open OUT,">$output";
+*STDOUT=*OUT;
+
 &asm_init($ARGV[0],$0);
 
 &external_label("OPENSSL_ia32cap_P");
@@ -3398,3 +3402,5 @@ my ($l_,$block,$i1,$i3,$i5) = ($rounds_,$key_,$rounds,$len,$out);
 &asciz("AES for Intel AES-NI, CRYPTOGAMS by <appro\@openssl.org>");
 
 &asm_finish();
+
+close STDOUT;
diff --git a/crypto/aes/asm/vpaes-x86.pl b/crypto/aes/asm/vpaes-x86.pl
index 2ba149c..4fcd561 100644
--- a/crypto/aes/asm/vpaes-x86.pl
+++ b/crypto/aes/asm/vpaes-x86.pl
@@ -51,6 +51,10 @@ $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1;
 push(@INC,"${dir}","${dir}../../perlasm");
 require "x86asm.pl";
 
+$output = pop;
+open OUT,">$output";
+*STDOUT=*OUT;
+
 &asm_init($ARGV[0],"vpaes-x86.pl",$x86only = $ARGV[$#ARGV] eq "386");
 
 $PREFIX="vpaes";
@@ -901,3 +905,5 @@ $k_dsbo=0x2c0;		# decryption sbox final output
 &function_end("${PREFIX}_cbc_encrypt");
 
 &asm_finish();
+
+close STDOUT;
diff --git a/crypto/aes/build.info b/crypto/aes/build.info
index 40e01d3..3328abc 100644
--- a/crypto/aes/build.info
+++ b/crypto/aes/build.info
@@ -3,57 +3,42 @@ SOURCE[../../libcrypto]=\
         aes_misc.c aes_ecb.c aes_cfb.c aes_ofb.c \
         aes_ige.c aes_wrap.c {- $target{aes_asm_src} -}
 
+GENERATE[aes-ia64.s]=asm/aes-ia64.S
+
+GENERATE[aes-586.s]=asm/aes-586.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR)
+DEPEND[aes-586.s]=../perlasm/x86asm.pl
+GENERATE[vpaes-x86.s]=asm/vpaes-x86.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR)
+DEPEND[vpaes-586.s]=../perlasm/x86asm.pl
+GENERATE[aesni-x86.s]=asm/aesni-x86.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR)
+DEPEND[aesni-586.s]=../perlasm/x86asm.pl
+
+GENERATE[aes-x86_64.s]=asm/aes-x86_64.pl $(PERLASM_SCHEME)
+GENERATE[vpaes-x86_64.s]=asm/vpaes-x86_64.pl $(PERLASM_SCHEME)
+GENERATE[bsaes-x86_64.s]=asm/bsaes-x86_64.pl $(PERLASM_SCHEME)
+GENERATE[aesni-x86_64.s]=asm/aesni-x86_64.pl $(PERLASM_SCHEME)
+GENERATE[aesni-sha1-x86_64.s]=asm/aesni-sha1-x86_64.pl $(PERLASM_SCHEME)
+GENERATE[aesni-sha256-x86_64.s]=asm/aesni-sha256-x86_64.pl $(PERLASM_SCHEME)
+GENERATE[aesni-mb-x86_64.s]=asm/aesni-mb-x86_64.pl $(PERLASM_SCHEME)
+
+GENERATE[aes-sparcv9.S]=asm/aes-sparcv9.pl $(PERLASM_SCHEME)
+GENERATE[aest4-sparcv9.S]=asm/aest4-sparcv9.pl $(PERLASM_SCHEME)
+DEPEND[aest4-sparcv9.S]=../perlasm/sparcv9_modes.pl
+
+GENERATE[aes-ppc.s]=asm/aes-ppc.pl $(PERLASM_SCHEME)
+GENERATE[vpaes-ppc.s]=asm/vpaes-ppc.pl $(PERLASM_SCHEME)
+GENERATE[aesp8-ppc.s]=asm/aesp8-ppc.pl $(PERLASM_SCHEME)
+
+GENERATE[aes-parisc.s]=asm/aes-parisc.pl $(PERLASM_SCHEME)
+
+GENERATE[aes-mips.S]=asm/aes-mips.pl $(PERLASM_SCHEME)
+
+GENERATE[aesv8-armx.S]=asm/aesv8-armx.pl $(PERLASM_SCHEME)
+GENERATE[vpaes-armv8.S]=asm/vpaes-armv8.pl $(PERLASM_SCHEME)
+
+
 BEGINRAW[Makefile]
 ##### AES assembler implementations
 
-{- $builddir -}/aes-ia64.s: {- $sourcedir -}/asm/aes-ia64.S
-	$(CC) $(CFLAGS) -E asm/aes-ia64.S > $@
-
-{- $builddir -}/aes-586.s:	{- $sourcedir -}/asm/aes-586.pl {- $sourcetop -}/crypto/perlasm/x86asm.pl
-	CC="$(CC)" $(PERL) {- $sourcedir -}/asm/aes-586.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) > $@
-{- $builddir -}/vpaes-x86.s:	{- $sourcedir -}/asm/vpaes-x86.pl {- $sourcetop -}/crypto/perlasm/x86asm.pl
-	CC="$(CC)" $(PERL) {- $sourcedir -}/asm/vpaes-x86.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) > $@
-{- $builddir -}/aesni-x86.s:	{- $sourcedir -}/asm/aesni-x86.pl {- $sourcetop -}/crypto/perlasm/x86asm.pl
-	CC="$(CC)" $(PERL) {- $sourcedir -}/asm/aesni-x86.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) > $@
-
-{- $builddir -}/aes-x86_64.s: {- $sourcedir -}/asm/aes-x86_64.pl
-	CC="$(CC)" $(PERL) {- $sourcedir -}/asm/aes-x86_64.pl $(PERLASM_SCHEME) > $@
-{- $builddir -}/vpaes-x86_64.s:	{- $sourcedir -}/asm/vpaes-x86_64.pl
-	CC="$(CC)" $(PERL) {- $sourcedir -}/asm/vpaes-x86_64.pl $(PERLASM_SCHEME) > $@
-{- $builddir -}/bsaes-x86_64.s:	{- $sourcedir -}/asm/bsaes-x86_64.pl
-	CC="$(CC)" $(PERL) {- $sourcedir -}/asm/bsaes-x86_64.pl $(PERLASM_SCHEME) > $@
-{- $builddir -}/aesni-x86_64.s: {- $sourcedir -}/asm/aesni-x86_64.pl
-	CC="$(CC)" $(PERL) {- $sourcedir -}/asm/aesni-x86_64.pl $(PERLASM_SCHEME) > $@
-{- $builddir -}/aesni-sha1-x86_64.s:	{- $sourcedir -}/asm/aesni-sha1-x86_64.pl
-	CC="$(CC)" $(PERL) {- $sourcedir -}/asm/aesni-sha1-x86_64.pl $(PERLASM_SCHEME) > $@
-{- $builddir -}/aesni-sha256-x86_64.s:	{- $sourcedir -}/asm/aesni-sha256-x86_64.pl
-	CC="$(CC)" $(PERL) {- $sourcedir -}/asm/aesni-sha256-x86_64.pl $(PERLASM_SCHEME) > $@
-{- $builddir -}/aesni-mb-x86_64.s:	{- $sourcedir -}/asm/aesni-mb-x86_64.pl
-	CC="$(CC)" $(PERL) {- $sourcedir -}/asm/aesni-mb-x86_64.pl $(PERLASM_SCHEME) > $@
-
-{- $builddir -}/aes-sparcv9.S: {- $sourcedir -}/asm/aes-sparcv9.pl
-	CC="$(CC)" $(PERL) {- $sourcedir -}/asm/aes-sparcv9.pl $(PERLASM_SCHEME) $@
-{- $builddir -}/aest4-sparcv9.s: {- $sourcedir -}/asm/aest4-sparcv9.pl {- $sourcetop -}/crypto/perlasm/sparcv9_modes.pl
-	CC="$(CC)" $(PERL) {- $sourcedir -}/asm/aest4-sparcv9.pl $(PERLASM_SCHEME) $@
-
-{- $builddir -}/aes-ppc.s:	{- $sourcedir -}/asm/aes-ppc.pl
-	CC="$(CC)" $(PERL) {- $sourcedir -}/asm/aes-ppc.pl $(PERLASM_SCHEME) $@
-{- $builddir -}/vpaes-ppc.s:	{- $sourcedir -}/asm/vpaes-ppc.pl
-	CC="$(CC)" $(PERL) {- $sourcedir -}/asm/vpaes-ppc.pl $(PERLASM_SCHEME) $@
-{- $builddir -}/aesp8-ppc.s:	{- $sourcedir -}/asm/aesp8-ppc.pl
-	CC="$(CC)" $(PERL) {- $sourcedir -}/asm/aesp8-ppc.pl $(PERLASM_SCHEME) $@
-
-{- $builddir -}/aes-parisc.s:	{- $sourcedir -}/asm/aes-parisc.pl
-	CC="$(CC)" $(PERL) {- $sourcedir -}/asm/aes-parisc.pl $(PERLASM_SCHEME) $@
-
-{- $builddir -}/aes-mips.S:	{- $sourcedir -}/asm/aes-mips.pl
-	CC="$(CC)" $(PERL) {- $sourcedir -}/asm/aes-mips.pl $(PERLASM_SCHEME) $@
-
-{- $builddir -}/aesv8-armx.S:	{- $sourcedir -}/asm/aesv8-armx.pl
-	CC="$(CC)" $(PERL) {- $sourcedir -}/asm/aesv8-armx.pl $(PERLASM_SCHEME) $@
-{- $builddir -}/vpaes-armv8.S:	{- $sourcedir -}/asm/vpaes-armv8.pl
-	CC="$(CC)" $(PERL) {- $sourcedir -}/asm/vpaes-armv8.pl $(PERLASM_SCHEME) $@
-
 # GNU make "catch all"
 {- $builddir -}/aes-%.S:	{- $sourcedir -}/asm/aes-%.pl
 	CC="$(CC)" $(PERL) $< $(PERLASM_SCHEME) $@
diff --git a/crypto/alphacpuid.pl b/crypto/alphacpuid.pl
index 5b0e21b..8af0f09 100644
--- a/crypto/alphacpuid.pl
+++ b/crypto/alphacpuid.pl
@@ -1,4 +1,8 @@
 #!/usr/bin/env perl
+
+$output = pop;
+open STDOUT,">$stdout";
+
 print <<'___';
 .text
 
@@ -214,3 +218,5 @@ OPENSSL_instrument_bus2:
 .end	OPENSSL_instrument_bus2
 ___
 }
+
+close STDOUT;
diff --git a/crypto/bf/Makefile.in b/crypto/bf/Makefile.in
index ee5c259..398844a 100644
--- a/crypto/bf/Makefile.in
+++ b/crypto/bf/Makefile.in
@@ -40,7 +40,7 @@ lib:	$(LIBOBJ)
 	@touch lib
 
 bf-586.s:	asm/bf-586.pl ../perlasm/x86asm.pl ../perlasm/cbc.pl
-	$(PERL) asm/bf-586.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) > $@
+	$(PERL) asm/bf-586.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) $@
 
 files:
 	$(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO
diff --git a/crypto/bf/asm/bf-586.pl b/crypto/bf/asm/bf-586.pl
index b74cfba..319a638 100644
--- a/crypto/bf/asm/bf-586.pl
+++ b/crypto/bf/asm/bf-586.pl
@@ -5,6 +5,9 @@ push(@INC,"${dir}","${dir}../../perlasm");
 require "x86asm.pl";
 require "cbc.pl";
 
+$output = pop;
+open STDOUT,">$output";
+
 &asm_init($ARGV[0],"bf-586.pl",$ARGV[$#ARGV] eq "386");
 
 $BF_ROUNDS=16;
@@ -22,6 +25,8 @@ $tmp4="edx";
 &cbc("BF_cbc_encrypt","BF_encrypt","BF_decrypt",1,4,5,3,-1,-1);
 &asm_finish();
 
+close STDOUT;
+
 sub BF_encrypt
 	{
 	local($name,$enc)=@_;
diff --git a/crypto/bf/build.info b/crypto/bf/build.info
index 7d208d2..466f134 100644
--- a/crypto/bf/build.info
+++ b/crypto/bf/build.info
@@ -1,9 +1,5 @@
 LIBS=../../libcrypto
 SOURCE[../../libcrypto]=bf_skey.c bf_ecb.c bf_enc.c bf_cfb64.c bf_ofb64.c 
 
-BEGINRAW[Makefile]
-##### BF assembler implementations
-
-{- $builddir -}/bf-586.s:	{- $sourcedir -}/asm/bf-586.pl {- $sourcetop -}/crypto/perlasm/x86asm.pl {- $sourcetop -}/crypto/perlasm/cbc.pl
-	CC="$(CC)" $(PERL) {- $sourcedir -}/asm/bf-586.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) > $@
-ENDRAW[Makefile]
+GENERATE[bf-586.s]=asm/bf-586.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR)
+DEPEND[bf-586.s]=../perlasm/x86asm.pl ../perlasm/cbc.pl
diff --git a/crypto/build.info b/crypto/build.info
index 471a9fd..01d3766 100644
--- a/crypto/build.info
+++ b/crypto/build.info
@@ -11,38 +11,19 @@ EXTRA=  ../ms/uplink-x86.pl ../ms/uplink.c ../ms/applink.c \
         ppccpuid.pl pariscid.pl alphacpuid.pl arm64cpuid.pl armv4cpuid.pl
 
 DEPEND[cversion.o]=buildinf.h
+GENERATE[buildinf.h]=../util/mkbuildinf.pl "$(CC) $(CFLAGS_Q)" "$(PLATFORM)"
+DEPEND[buildinf.h]=configdata.pm
 
-BEGINRAW[descrip.mms]
-[.crypto]buildinf.h : configdata.pm
-	$(PERL) {- catfile(catdir($sourcedir, "[-]"), "util", "mkbuildinf.pl") -} "$(CC) $(CFLAGS)" "$(PLATFORM)" > [.crypto]buildinf.h
-ENDRAW[descrip.mms]
+GENERATE[uplink-x86.s]=../ms/uplink-x86.pl $(PERLASM_SCHEME)
 
-BEGINRAW[Makefile]
-crypto/buildinf.h : configdata.pm
-	$(PERL) $(SRCDIR)/util/mkbuildinf.pl "$(CC) $(CFLAGS_Q)" "$(PLATFORM)" > crypto/buildinf.h
+GENERATE[x86cpuid.s]=x86cpuid.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR)
+DEPEND[x86cpuid.s]=perlasm/x86asm.pl
 
-##### APPLINK, UPLINK and CPUID assembler implementations
+GENERATE[x86_64cpuid.s]=x86_64cpuid.pl $(PERLASM_SCHEME)
 
-{- $builddir -}/uplink-x86.s:	$(SRCDIR)/ms/uplink-x86.pl
-	CC="$(CC)" $(PERL) $(SRCDIR)/ms/uplink-x86.pl $(PERLASM_SCHEME) > $@
-
-{- $builddir -}/x86cpuid.s:	{- $sourcedir -}/x86cpuid.pl {- $sourcedir -}/perlasm/x86asm.pl
-	CC="$(CC)" $(PERL) {- $sourcedir -}/x86cpuid.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) > $@
-
-{- $builddir -}/x86_64cpuid.s:	{- $sourcedir -}/x86_64cpuid.pl
-	CC="$(CC)" $(PERL) {- $sourcedir -}/x86_64cpuid.pl $(PERLASM_SCHEME) > $@
-{- $builddir -}/ia64cpuid.s:	{- $sourcedir -}/ia64cpuid.S
-	$(CC) $(CFLAGS) -E {- $sourcedir -}/ia64cpuid.S > $@
-{- $builddir -}/ppccpuid.s:	{- $sourcedir -}/ppccpuid.pl
-	CC="$(CC)" $(PERL) {- $sourcedir -}/ppccpuid.pl $(PERLASM_SCHEME) $@
-{- $builddir -}/pariscid.s:	{- $sourcedir -}/pariscid.pl
-	CC="$(CC)" $(PERL) {- $sourcedir -}/pariscid.pl $(PERLASM_SCHEME) $@
-{- $builddir -}/alphacpuid.s:	{- $sourcedir -}/alphacpuid.pl
-	(preproc=$$$$.$@.S; trap "rm $$preproc" INT; \
-	CC="$(CC)" $(PERL) {- $sourcedir -}/alphacpuid.pl > $$preproc && \
-	$(CC) -E -P $$preproc > $@ && rm $$preproc)
-{- $builddir -}/arm64cpuid.S:	{- $sourcedir -}/arm64cpuid.pl
-	CC="$(CC)" $(PERL) {- $sourcedir -}/arm64cpuid.pl $(PERLASM_SCHEME) > $@
-{- $builddir -}/armv4cpuid.S:	{- $sourcedir -}/armv4cpuid.pl
-	CC="$(CC)" $(PERL) {- $sourcedir -}/armv4cpuid.pl $(PERLASM_SCHEME) > $@
-ENDRAW[Makefile]
+GENERATE[ia64cpuid.s]=ia64cpuid.S
+GENERATE[ppccpuid.s]=ppccpuid.pl $(PERLASM_SCHEM
+GENERATE[pariscid.s]=pariscid.pl $(PERLASM_SCHEM
+GENERATE[alphacpuid.s]=alphacpuid.pl
+GENERATE[arm64cpuid.S]=arm64cpuid.pl $(PERLASM_SCHEME)
+GENERATE[armv4cpuid.S]=armv4cpuid.pl $(PERLASM_SCHEME)
diff --git a/crypto/camellia/Makefile.in b/crypto/camellia/Makefile.in
index e32a73b..e809152 100644
--- a/crypto/camellia/Makefile.in
+++ b/crypto/camellia/Makefile.in
@@ -42,9 +42,9 @@ lib:	$(LIBOBJ)
 	@touch lib
 
 cmll-x86.s:	asm/cmll-x86.pl ../perlasm/x86asm.pl
-	$(PERL) asm/cmll-x86.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) > $@
+	$(PERL) asm/cmll-x86.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) $@
 cmll-x86_64.s:  asm/cmll-x86_64.pl
-	$(PERL) asm/cmll-x86_64.pl $(PERLASM_SCHEME) > $@
+	$(PERL) asm/cmll-x86_64.pl $(PERLASM_SCHEME) $@
 cmllt4-sparcv9.S: asm/cmllt4-sparcv9.pl ../perlasm/sparcv9_modes.pl
 	$(PERL) asm/cmllt4-sparcv9.pl $(PERLASM_SCHEME) $@
 
diff --git a/crypto/camellia/asm/cmll-x86.pl b/crypto/camellia/asm/cmll-x86.pl
index 027302a..de354aa 100644
--- a/crypto/camellia/asm/cmll-x86.pl
+++ b/crypto/camellia/asm/cmll-x86.pl
@@ -42,6 +42,9 @@ require "x86asm.pl";
 
 $OPENSSL=1;
 
+$output = pop;
+open STDOUT,">$output";
+
 &asm_init($ARGV[0],"cmll-586.pl",$ARGV[$#ARGV] eq "386");
 
 @T=("eax","ebx","ecx","edx");
@@ -1136,3 +1139,5 @@ my ($s0,$s1,$s2,$s3) = @T;
 &asciz("Camellia for x86 by <appro\@openssl.org>");
 
 &asm_finish();
+
+close STDOUT;
diff --git a/crypto/camellia/build.info b/crypto/camellia/build.info
index b5c1114..6f50b24 100644
--- a/crypto/camellia/build.info
+++ b/crypto/camellia/build.info
@@ -3,11 +3,8 @@ SOURCE[../../libcrypto]=\
         cmll_ecb.c cmll_ofb.c cmll_cfb.c cmll_ctr.c \
         {- $target{cmll_asm_src} -}
 
-BEGINRAW[Makefile]
-{- $builddir -}/cmll-x86.s:	{- $sourcedir -}/asm/cmll-x86.pl {- $sourcetop -}/crypto/perlasm/x86asm.pl
-	CC="$(CC)" $(PERL) {- $sourcedir -}/asm/cmll-x86.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) > $@
-{- $builddir -}/cmll-x86_64.s:  {- $sourcedir -}/asm/cmll-x86_64.pl
-	CC="$(CC)" $(PERL) {- $sourcedir -}/asm/cmll-x86_64.pl $(PERLASM_SCHEME) > $@
-{- $builddir -}/cmllt4-sparcv9.S: {- $sourcedir -}/asm/cmllt4-sparcv9.pl {- $sourcetop -}/crypto/perlasm/sparcv9_modes.pl
-	CC="$(CC)" $(PERL) {- $sourcedir -}/asm/cmllt4-sparcv9.pl $(PERLASM_SCHEME) $@
-ENDRAW[Makefile]
+GENERATE[cmll-x86.s]=asm/cmll-x86.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR)
+DEPEND[cmll-x86.s]=../perlasm/x86asm.pl
+GENERATE[cmll-x86_64.s]=asm/cmll-x86_64.pl $(PERLASM_SCHEME)
+GENERATE[cmllt4-sparcv9.S]=asm/cmllt4-sparcv9.pl $(PERLASM_SCHEME)
+DEPEND[cmllt4-sparcv9.S]=../perlasm/sparcv9-modes.pl
diff --git a/crypto/cast/Makefile.in b/crypto/cast/Makefile.in
index 06f65e2..c43eecb 100644
--- a/crypto/cast/Makefile.in
+++ b/crypto/cast/Makefile.in
@@ -40,7 +40,7 @@ lib:	$(LIBOBJ)
 	@touch lib
 
 cast-586.s:	asm/cast-586.pl ../perlasm/x86asm.pl ../perlasm/cbc.pl
-	$(PERL)	asm/cast-586.pl $(PERLASM_SCHEME) $(CLAGS) $(PROCESSOR) > $@
+	$(PERL)	asm/cast-586.pl $(PERLASM_SCHEME) $(CLAGS) $(PROCESSOR) $@
 
 files:
 	$(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO
diff --git a/crypto/cast/asm/cast-586.pl b/crypto/cast/asm/cast-586.pl
index ec2eab1..267d699 100644
--- a/crypto/cast/asm/cast-586.pl
+++ b/crypto/cast/asm/cast-586.pl
@@ -11,6 +11,9 @@ push(@INC,"${dir}","${dir}../../perlasm");
 require "x86asm.pl";
 require "cbc.pl";
 
+$output=pop;
+open STDOUT,">$output";
+
 &asm_init($ARGV[0],"cast-586.pl",$ARGV[$#ARGV] eq "386");
 
 $CAST_ROUNDS=16;
@@ -36,6 +39,8 @@ $S4="CAST_S_table3";
 
 &asm_finish();
 
+close STDOUT;
+
 sub CAST_encrypt {
     local($name,$enc)=@_;
 
diff --git a/crypto/cast/build.info b/crypto/cast/build.info
index 84c100e..20b6f6c 100644
--- a/crypto/cast/build.info
+++ b/crypto/cast/build.info
@@ -2,9 +2,5 @@ LIBS=../../libcrypto
 SOURCE[../../libcrypto]=\
         c_skey.c c_ecb.c {- $target{cast_asm_src} -} c_cfb64.c c_ofb64.c
 
-BEGINRAW[Makefile]
-##### CAST assembler implementations
-
-{- $builddir -}/cast-586.s:	{- $sourcedir -}/asm/cast-586.pl {- $sourcetop -}/crypto/perlasm/x86asm.pl {- $sourcetop -}/crypto/perlasm/cbc.pl
-	CC="$(CC)" $(PERL)	{- $sourcedir -}/asm/cast-586.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) > $@
-ENDRAW[Makefile]
+GENERATE[cast-586.s]=asm/cast-586.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR)
+DEPEND[cast-586.s]=../perlasm/x86asm.pl ../perlasm/cbc.pl
diff --git a/crypto/chacha/Makefile.in b/crypto/chacha/Makefile.in
index 33e41d5..c34224c 100644
--- a/crypto/chacha/Makefile.in
+++ b/crypto/chacha/Makefile.in
@@ -37,9 +37,9 @@ lib:	$(LIBOBJ)
 	@touch lib
 
 chacha-x86.s:		asm/chacha-x86.pl
-	$(PERL) asm/chacha-x86.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) > $@
+	$(PERL) asm/chacha-x86.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) $@
 chacha-x86_64.s:	asm/chacha-x86_64.pl
-	$(PERL) asm/chacha-x86_64.pl $(PERLASM_SCHEME) > $@
+	$(PERL) asm/chacha-x86_64.pl $(PERLASM_SCHEME) $@
 chacha-ppc.s:	asm/chacha-ppc.pl
 	$(PERL) asm/chacha-ppc.pl $(PERLASM_SCHEME) $@
 
diff --git a/crypto/chacha/asm/chacha-c64xplus.pl b/crypto/chacha/asm/chacha-c64xplus.pl
index 55854d0..b2ea406 100755
--- a/crypto/chacha/asm/chacha-c64xplus.pl
+++ b/crypto/chacha/asm/chacha-c64xplus.pl
@@ -17,6 +17,9 @@
 # dependent on input length. This module on the other hand is free
 # from such limiation.
 
+$output=pop;
+open STDOUT,">$output";
+
 ($OUT,$INP,$LEN,$KEYB,$COUNTERA)=("A4","B4","A6","B6","A8");
 ($KEYA,$COUNTERB,$STEP)=("A7","B7","A3");
 
diff --git a/crypto/chacha/asm/chacha-x86.pl b/crypto/chacha/asm/chacha-x86.pl
index 850c917..8b9696f 100755
--- a/crypto/chacha/asm/chacha-x86.pl
+++ b/crypto/chacha/asm/chacha-x86.pl
@@ -31,6 +31,9 @@ $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1;
 push(@INC,"${dir}","${dir}../../perlasm");
 require "x86asm.pl";
 
+$output=pop;
+open STDOUT,">$output";
+
 &asm_init($ARGV[0],"chacha-x86.pl",$ARGV[$#ARGV] eq "386");
 
 $xmm=$ymm=0;
@@ -1130,3 +1133,5 @@ sub XOPROUND {
 }
 
 &asm_finish();
+
+close STDOUT;
diff --git a/crypto/chacha/build.info b/crypto/chacha/build.info
index f2db5f0..3dd1f74 100644
--- a/crypto/chacha/build.info
+++ b/crypto/chacha/build.info
@@ -1,16 +1,13 @@
 LIBS=../../libcrypto
 SOURCE[../../libcrypto]={- $target{chacha_asm_src} -}
 
+GENERATE[chacha-x86.s]=asm/chacha-x86.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR)
+GENERATE[chacha-x86_64.s]=asm/chacha-x86_64.pl $(PERLASM_SCHEME)
+GENERATE[chacha-ppc.s]=asm/chacha-ppc.pl $(PERLASM_SCHEME)
+
 BEGINRAW[Makefile(unix)]
 ##### CHACHA assembler implementations
 
-{- $builddir -}/chacha-x86.s:		{- $sourcedir -}/asm/chacha-x86.pl
-	CC="$(CC)" $(PERL) {- $sourcedir -}/asm/chacha-x86.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) > $@
-{- $builddir -}/chacha-x86_64.s:	{- $sourcedir -}/asm/chacha-x86_64.pl
-	CC="$(CC)" $(PERL) {- $sourcedir -}/asm/chacha-x86_64.pl $(PERLASM_SCHEME) > $@
-{- $builddir -}/chacha-ppc.s:	{- $sourcedir -}/asm/chacha-ppc.pl
-	CC="$(CC)" $(PERL) {- $sourcedir -}/asm/chacha-ppc.pl $(PERLASM_SCHEME) $@
-
 {- $builddir -}/chacha-%.S:	{- $sourcedir -}/asm/chacha-%.pl
 	CC="$(CC)" $(PERL) $< $(PERLASM_SCHEME) $@
 ENDRAW[Makefile(unix)]
diff --git a/crypto/des/Makefile.in b/crypto/des/Makefile.in
index c056804..93a715a 100644
--- a/crypto/des/Makefile.in
+++ b/crypto/des/Makefile.in
@@ -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
diff --git a/crypto/des/asm/crypt586.pl b/crypto/des/asm/crypt586.pl
index e36f7d4..d94528f 100644
--- a/crypto/des/asm/crypt586.pl
+++ b/crypto/des/asm/crypt586.pl
@@ -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)=@_;
diff --git a/crypto/des/asm/des-586.pl b/crypto/des/asm/des-586.pl
index bd6a7dd..e56eae4 100644
--- a/crypto/des/asm/des-586.pl
+++ b/crypto/des/asm/des-586.pl
@@ -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/, at ARGV));
 
 &asm_finish();
 
+close STDOUT;
+
 sub DES_encrypt_internal()
 	{
 	&function_begin_B("_x86_DES_encrypt");
diff --git a/crypto/des/build.info b/crypto/des/build.info
index d3c5c1f..ee2f67f 100644
--- a/crypto/des/build.info
+++ b/crypto/des/build.info
@@ -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]
diff --git a/crypto/ec/Makefile.in b/crypto/ec/Makefile.in
index 342b98d..48091d2 100644
--- a/crypto/ec/Makefile.in
+++ b/crypto/ec/Makefile.in
@@ -49,13 +49,13 @@ lib:	$(LIBOBJ)
 	@touch lib
 
 ecp_nistz256-x86.s:	asm/ecp_nistz256-x86.pl
-	$(PERL) asm/ecp_nistz256-x86.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) > $@
+	$(PERL) asm/ecp_nistz256-x86.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) $@
 
 ecp_nistz256-x86_64.s: asm/ecp_nistz256-x86_64.pl
-	$(PERL) asm/ecp_nistz256-x86_64.pl $(PERLASM_SCHEME) > $@
+	$(PERL) asm/ecp_nistz256-x86_64.pl $(PERLASM_SCHEME) $@
 
 ecp_nistz256-avx2.s:   asm/ecp_nistz256-avx2.pl
-	$(PERL) asm/ecp_nistz256-avx2.pl $(PERLASM_SCHEME) > $@
+	$(PERL) asm/ecp_nistz256-avx2.pl $(PERLASM_SCHEME) $@
 
 ecp_nistz256-sparcv9.S:	asm/ecp_nistz256-sparcv9.pl
 	$(PERL) asm/ecp_nistz256-sparcv9.pl $(PERLASM_SCHEME) $@
diff --git a/crypto/ec/asm/ecp_nistz256-x86.pl b/crypto/ec/asm/ecp_nistz256-x86.pl
index 4d55f82..7aa9b0f 100755
--- a/crypto/ec/asm/ecp_nistz256-x86.pl
+++ b/crypto/ec/asm/ecp_nistz256-x86.pl
@@ -35,6 +35,9 @@ $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1;
 push(@INC,"${dir}","${dir}../../perlasm");
 require "x86asm.pl";
 
+$output=pop;
+open STDOUT,">$output";
+
 &asm_init($ARGV[0],"ecp_nistz256-x86.pl",$ARGV[$#ARGV] eq "386");
 
 $sse2=0;
@@ -1829,3 +1832,5 @@ for ($i=0;$i<7;$i++) {
 } &function_end("ecp_nistz256_point_add_affine");
 
 &asm_finish();
+
+close STDOUT;
diff --git a/crypto/ec/build.info b/crypto/ec/build.info
index 469a7dd..e8588a1 100644
--- a/crypto/ec/build.info
+++ b/crypto/ec/build.info
@@ -8,19 +8,15 @@ SOURCE[../../libcrypto]=\
         ecdsa_ossl.c ecdsa_sign.c ecdsa_vrf.c ec_25519.c curve25519.c \
         {- $target{ec_asm_src} -}
 
-BEGINRAW[Makefile]
-{- $builddir -}/ecp_nistz256-x86.s:	{- $sourcedir -}/asm/ecp_nistz256-x86.pl
-	CC="$(CC)" $(PERL) {- $sourcedir -}/asm/ecp_nistz256-x86.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) > $@
+GENERATE[ecp_nistz256-x86.s]=asm/ecp_nistz256-x86.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR)
 
-{- $builddir -}/ecp_nistz256-x86_64.s: {- $sourcedir -}/asm/ecp_nistz256-x86_64.pl
-	CC="$(CC)" $(PERL) {- $sourcedir -}/asm/ecp_nistz256-x86_64.pl $(PERLASM_SCHEME) > $@
+GENERATE[ecp_nistz256-x86_64.s]=asm/ecp_nistz256-x86_64.pl $(PERLASM_SCHEME)
 
-{- $builddir -}/ecp_nistz256-avx2.s:   {- $sourcedir -}/asm/ecp_nistz256-avx2.pl
-	CC="$(CC)" $(PERL) {- $sourcedir -}/asm/ecp_nistz256-avx2.pl $(PERLASM_SCHEME) > $@
+GENERATE[ecp_nistz256-avx2.s]=asm/ecp_nistz256-avx2.pl $(PERLASM_SCHEME)
 
-{- $builddir -}/ecp_nistz256-sparcv9.S:	{- $sourcedir -}/asm/ecp_nistz256-sparcv9.pl
-	CC="$(CC)" $(PERL) {- $sourcedir -}/asm/ecp_nistz256-sparcv9.pl $(PERLASM_SCHEME) $@
+GENERATE[ecp_nistz256-sparcv9.S]=asm/ecp_nistz256-sparcv9.pl $(PERLASM_SCHEME)
 
+BEGINRAW[Makefile]
 {- $builddir -}/ecp_nistz256-%.S:	{- $sourcedir -}/asm/ecp_nistz256-%.pl
 	CC="$(CC)" $(PERL) $< $(PERLASM_SCHEME) $@
 ENDRAW[Makefile]
diff --git a/crypto/md5/Makefile.in b/crypto/md5/Makefile.in
index 625bdc8..7e13a04 100644
--- a/crypto/md5/Makefile.in
+++ b/crypto/md5/Makefile.in
@@ -40,10 +40,10 @@ lib:    $(LIBOBJ)
 	@touch lib
 
 md5-586.s:	asm/md5-586.pl ../perlasm/x86asm.pl
-	$(PERL) asm/md5-586.pl $(PERLASM_SCHEME) $(CFLAGS) > $@
+	$(PERL) asm/md5-586.pl $(PERLASM_SCHEME) $(CFLAGS) $@
 
 md5-x86_64.s:	asm/md5-x86_64.pl
-	$(PERL) asm/md5-x86_64.pl $(PERLASM_SCHEME) > $@
+	$(PERL) asm/md5-x86_64.pl $(PERLASM_SCHEME) $@
 
 md5-ia64.s: asm/md5-ia64.S
 	$(CC) $(CFLAGS) -E asm/md5-ia64.S | \
diff --git a/crypto/md5/asm/md5-586.pl b/crypto/md5/asm/md5-586.pl
index 4971357..b3b756c 100644
--- a/crypto/md5/asm/md5-586.pl
+++ b/crypto/md5/asm/md5-586.pl
@@ -11,6 +11,9 @@ $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1;
 push(@INC,"${dir}","${dir}../../perlasm");
 require "x86asm.pl";
 
+$output=pop;
+open STDOUT,">$output";
+
 &asm_init($ARGV[0],$0);
 
 $A="eax";
@@ -33,6 +36,8 @@ $X="esi";
 &md5_block("md5_block_asm_data_order");
 &asm_finish();
 
+close STDOUT;
+
 sub Np
 	{
 	local($p)=@_;
diff --git a/crypto/md5/build.info b/crypto/md5/build.info
index 6a04f37..a10d582 100644
--- a/crypto/md5/build.info
+++ b/crypto/md5/build.info
@@ -2,17 +2,15 @@ LIBS=../../libcrypto
 SOURCE[../../libcrypto]=\
         md5_dgst.c md5_one.c {- $target{md5_asm_src} -}
 
-BEGINRAW[Makefile]
-{- $builddir -}/md5-586.s:	{- $sourcedir -}/asm/md5-586.pl {- $sourcetop -}/crypto/perlasm/x86asm.pl
-	CC="$(CC)" $(PERL) {- $sourcedir -}/asm/md5-586.pl $(PERLASM_SCHEME) $(CFLAGS) > $@
+GENERATE[md5-586.s]=asm/md5-586.pl $(PERLASM_SCHEME) $(CFLAGS)
+
+GENERATE[md5-x86_64.s]=asm/md5-x86_64.pl $(PERLASM_SCHEME)
 
-{- $builddir -}/md5-x86_64.s:	{- $sourcedir -}/asm/md5-x86_64.pl
-	CC="$(CC)" $(PERL) {- $sourcedir -}/asm/md5-x86_64.pl $(PERLASM_SCHEME) > $@
+GENERATE[md5-sparcv9.S]=asm/md5-sparcv9.pl $(PERLASM_SCHEME)
 
+BEGINRAW[Makefile]
 {- $builddir -}/md5-ia64.s: {- $sourcedir -}/asm/md5-ia64.S
 	$(CC) $(CFLAGS) -E {- $sourcedir -}/asm/md5-ia64.S | \
 	$(PERL) -ne 's/;\s+/;\n/g; print;' > $@
 
-{- $builddir -}/md5-sparcv9.S:	{- $sourcedir -}/asm/md5-sparcv9.pl
-	CC="$(CC)" $(PERL) {- $sourcedir -}/asm/md5-sparcv9.pl $(PERLASM_SCHEME) $@
 ENDRAW[Makefile]
diff --git a/crypto/modes/Makefile.in b/crypto/modes/Makefile.in
index a62486e..c37a8c8 100644
--- a/crypto/modes/Makefile.in
+++ b/crypto/modes/Makefile.in
@@ -41,18 +41,18 @@ lib:	$(LIBOBJ)
 	@touch lib
 
 ghash-ia64.s:	asm/ghash-ia64.pl
-	$(PERL) asm/ghash-ia64.pl $@ $(CFLAGS)
+	$(PERL) asm/ghash-ia64.pl $(CFLAGS) $@
 ghash-x86.s:	asm/ghash-x86.pl
-	$(PERL) asm/ghash-x86.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) > $@
+	$(PERL) asm/ghash-x86.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) $@
 ghash-x86_64.s:	asm/ghash-x86_64.pl
-	$(PERL) asm/ghash-x86_64.pl $(PERLASM_SCHEME) > $@
+	$(PERL) asm/ghash-x86_64.pl $(PERLASM_SCHEME) $@
 aesni-gcm-x86_64.s:	asm/aesni-gcm-x86_64.pl
-	$(PERL) asm/aesni-gcm-x86_64.pl $(PERLASM_SCHEME) > $@
+	$(PERL) asm/aesni-gcm-x86_64.pl $(PERLASM_SCHEME) $@
 ghash-sparcv9.S:	asm/ghash-sparcv9.pl
 	$(PERL) asm/ghash-sparcv9.pl $(PERLASM_SCHEME) $@
 ghash-alpha.s:	asm/ghash-alpha.pl
 	(preproc=$$$$.$@.S; trap "rm $$preproc" INT; \
-	$(PERL) asm/ghash-alpha.pl > $$preproc && \
+	$(PERL) asm/ghash-alpha.pl $$preproc && \
 	$(CC) -E -P $$preproc > $@ && rm $$preproc)
 ghash-parisc.s:	asm/ghash-parisc.pl
 	$(PERL) asm/ghash-parisc.pl $(PERLASM_SCHEME) $@
diff --git a/crypto/modes/asm/ghash-alpha.pl b/crypto/modes/asm/ghash-alpha.pl
index aa36029..df6b3a3 100644
--- a/crypto/modes/asm/ghash-alpha.pl
+++ b/crypto/modes/asm/ghash-alpha.pl
@@ -454,7 +454,7 @@ rem_4bit:
 .align	4
 
 ___
-$output=shift and open STDOUT,">$output";
+$output=pop and open STDOUT,">$output";
 print $code;
 close STDOUT;
 
diff --git a/crypto/modes/asm/ghash-ia64.pl b/crypto/modes/asm/ghash-ia64.pl
index 0354c95..9d49143 100755
--- a/crypto/modes/asm/ghash-ia64.pl
+++ b/crypto/modes/asm/ghash-ia64.pl
@@ -32,7 +32,7 @@
 # Itanium performance should remain the same as the "256B" version,
 # i.e. ~8.5 cycles.
 
-$output=shift and (open STDOUT,">$output" or die "can't open $output: $!");
+$output=pop and (open STDOUT,">$output" or die "can't open $output: $!");
 
 if ($^O eq "hpux") {
     $ADDP="addp4";
diff --git a/crypto/modes/asm/ghash-x86.pl b/crypto/modes/asm/ghash-x86.pl
index 0269169..db6eeae 100644
--- a/crypto/modes/asm/ghash-x86.pl
+++ b/crypto/modes/asm/ghash-x86.pl
@@ -129,6 +129,9 @@ $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1;
 push(@INC,"${dir}","${dir}../../perlasm");
 require "x86asm.pl";
 
+$output=pop;
+open STDOUT,">$output";
+
 &asm_init($ARGV[0],"ghash-x86.pl",$x86only = $ARGV[$#ARGV] eq "386");
 
 $sse2=0;
@@ -1369,6 +1372,8 @@ my ($Xhi,$Xi)=@_;
 &asciz("GHASH for x86, CRYPTOGAMS by <appro\@openssl.org>");
 &asm_finish();
 
+close STDOUT;
+
 # A question was risen about choice of vanilla MMX. Or rather why wasn't
 # SSE2 chosen instead? In addition to the fact that MMX runs on legacy
 # CPUs such as PIII, "4-bit" MMX version was observed to provide better
diff --git a/crypto/modes/build.info b/crypto/modes/build.info
index dfce733..b59780f 100644
--- a/crypto/modes/build.info
+++ b/crypto/modes/build.info
@@ -4,28 +4,17 @@ SOURCE[../../libcrypto]=\
         ccm128.c xts128.c wrap128.c ocb128.c \
         {- $target{modes_asm_src} -}
 
-BEGINRAW[Makefile]
-{- $builddir -}/ghash-ia64.s:	{- $sourcedir -}/asm/ghash-ia64.pl
-	CC="$(CC)" $(PERL) {- $sourcedir -}/asm/ghash-ia64.pl $@ $(CFLAGS)
-{- $builddir -}/ghash-x86.s:	{- $sourcedir -}/asm/ghash-x86.pl
-	CC="$(CC)" $(PERL) {- $sourcedir -}/asm/ghash-x86.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) > $@
-{- $builddir -}/ghash-x86_64.s:	{- $sourcedir -}/asm/ghash-x86_64.pl
-	CC="$(CC)" $(PERL) {- $sourcedir -}/asm/ghash-x86_64.pl $(PERLASM_SCHEME) > $@
-{- $builddir -}/aesni-gcm-x86_64.s:	{- $sourcedir -}/asm/aesni-gcm-x86_64.pl
-	CC="$(CC)" $(PERL) {- $sourcedir -}/asm/aesni-gcm-x86_64.pl $(PERLASM_SCHEME) > $@
-{- $builddir -}/ghash-sparcv9.S:	{- $sourcedir -}/asm/ghash-sparcv9.pl
-	CC="$(CC)" $(PERL) {- $sourcedir -}/asm/ghash-sparcv9.pl $(PERLASM_SCHEME) $@
-{- $builddir -}/ghash-alpha.s:	{- $sourcedir -}/asm/ghash-alpha.pl
-	(preproc=$$$$.$@.S; trap "rm $$preproc" INT; \
-	CC="$(CC)" $(PERL) {- $sourcedir -}/asm/ghash-alpha.pl > $$preproc && \
-	$(CC) -E -P $$preproc > $@ && rm $$preproc)
-{- $builddir -}/ghash-parisc.s:	{- $sourcedir -}/asm/ghash-parisc.pl
-	CC="$(CC)" $(PERL) {- $sourcedir -}/asm/ghash-parisc.pl $(PERLASM_SCHEME) $@
-{- $builddir -}/ghashv8-armx.S:	{- $sourcedir -}/asm/ghashv8-armx.pl
-	CC="$(CC)" $(PERL) {- $sourcedir -}/asm/ghashv8-armx.pl $(PERLASM_SCHEME) $@
-{- $builddir -}/ghashp8-ppc.s:	{- $sourcedir -}/asm/ghashp8-ppc.pl
-	CC="$(CC)" $(PERL) {- $sourcedir -}/asm/ghashp8-ppc.pl $(PERLASM_SCHEME) $@
+GENERATE[ghash-ia64.s]=asm/ghash-ia64.pl $(CFLAGS)
+GENERATE[ghash-x86.s]=asm/ghash-x86.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR)
+GENERATE[ghash-x86_64.s]=asm/ghash-x86_64.pl $(PERLASM_SCHEME)
+GENERATE[aesni-gcm-x86_64.s]=asm/aesni-gcm-x86_64.pl $(PERLASM_SCHEME)
+GENERATE[ghash-sparcv9.S]=asm/ghash-sparcv9.pl $(PERLASM_SCHEME)
+GENERATE[ghash-alpha.s]=asm/ghash-alpha.pl
+GENERATE[ghash-parisc.s]=asm/ghash-parisc.pl $(PERLASM_SCHEME)
+GENERATE[ghashv8-armx.S]=asm/ghashv8-armx.pl $(PERLASM_SCHEME)
+GENERATE[ghashp8-ppc.s]=asm/ghashp8-ppc.pl $(PERLASM_SCHEME)
 
+BEGINRAW[Makefile]
 # GNU make "catch all"
 {- $builddir -}/ghash-%.S:	{- $sourcedir -}/asm/ghash-%.pl
 	CC="$(CC)" $(PERL) $< $(PERLASM_SCHEME) $@
diff --git a/crypto/poly1305/Makefile.in b/crypto/poly1305/Makefile.in
index 2f1b256..e27fcaf 100644
--- a/crypto/poly1305/Makefile.in
+++ b/crypto/poly1305/Makefile.in
@@ -39,9 +39,9 @@ lib:	$(LIBOBJ)
 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
diff --git a/crypto/poly1305/asm/poly1305-c64xplus.pl b/crypto/poly1305/asm/poly1305-c64xplus.pl
index fc765e1..f750a6e 100755
--- a/crypto/poly1305/asm/poly1305-c64xplus.pl
+++ b/crypto/poly1305/asm/poly1305-c64xplus.pl
@@ -19,6 +19,9 @@
 # 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");
diff --git a/crypto/poly1305/asm/poly1305-sparcv9.pl b/crypto/poly1305/asm/poly1305-sparcv9.pl
index f0ce259..5452887 100755
--- a/crypto/poly1305/asm/poly1305-sparcv9.pl
+++ b/crypto/poly1305/asm/poly1305-sparcv9.pl
@@ -42,6 +42,9 @@ my ($r0,$r1,$r2,$r3,$s1,$s2,$s3,$h4)	= map("%l$_",(0..7));
 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"
 
diff --git a/crypto/poly1305/asm/poly1305-x86.pl b/crypto/poly1305/asm/poly1305-x86.pl
index fb9fa2b..4307c99 100755
--- a/crypto/poly1305/asm/poly1305-x86.pl
+++ b/crypto/poly1305/asm/poly1305-x86.pl
@@ -38,6 +38,9 @@ $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1;
 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;
@@ -1795,3 +1798,5 @@ sub vlazy_reduction {
 &align	(4);
 
 &asm_finish();
+
+close STDOUT;
diff --git a/crypto/poly1305/build.info b/crypto/poly1305/build.info
index c93c572..5b548e6 100644
--- a/crypto/poly1305/build.info
+++ b/crypto/poly1305/build.info
@@ -2,18 +2,13 @@ LIBS=../../libcrypto
 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)]
diff --git a/crypto/rc4/Makefile.in b/crypto/rc4/Makefile.in
index fe2ef7d..00e39ec 100644
--- a/crypto/rc4/Makefile.in
+++ b/crypto/rc4/Makefile.in
@@ -39,15 +39,15 @@ lib:	$(LIBOBJ)
 	@touch lib
 
 rc4-586.s:	asm/rc4-586.pl ../perlasm/x86asm.pl
-	$(PERL) asm/rc4-586.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) > $@
+	$(PERL) asm/rc4-586.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) $@
 
 rc4-x86_64.s: asm/rc4-x86_64.pl
-	$(PERL) asm/rc4-x86_64.pl $(PERLASM_SCHEME) > $@
+	$(PERL) asm/rc4-x86_64.pl $(PERLASM_SCHEME) $@
 rc4-md5-x86_64.s:	asm/rc4-md5-x86_64.pl
-	$(PERL) asm/rc4-md5-x86_64.pl $(PERLASM_SCHEME) > $@
+	$(PERL) asm/rc4-md5-x86_64.pl $(PERLASM_SCHEME) $@
 
 rc4-ia64.S: asm/rc4-ia64.pl
-	$(PERL) asm/rc4-ia64.pl $(CFLAGS) > $@
+	$(PERL) asm/rc4-ia64.pl $(CFLAGS) $@
 
 rc4-parisc.s:	asm/rc4-parisc.pl
 	$(PERL) asm/rc4-parisc.pl $(PERLASM_SCHEME) $@
diff --git a/crypto/rc4/asm/rc4-586.pl b/crypto/rc4/asm/rc4-586.pl
index d04e177..a517adb 100644
--- a/crypto/rc4/asm/rc4-586.pl
+++ b/crypto/rc4/asm/rc4-586.pl
@@ -63,6 +63,9 @@ $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1;
 push(@INC,"${dir}","${dir}../../perlasm");
 require "x86asm.pl";
 
+$output=pop;
+open STDOUT,">$output";
+
 &asm_init($ARGV[0],"rc4-586.pl",$x86only = $ARGV[$#ARGV] eq "386");
 
 $xx="eax";
@@ -415,3 +418,4 @@ $idx="edx";
 
 &asm_finish();
 
+close STDOUT;
diff --git a/crypto/rc4/asm/rc4-ia64.pl b/crypto/rc4/asm/rc4-ia64.pl
index 49cd5b5..b83e53a 100644
--- a/crypto/rc4/asm/rc4-ia64.pl
+++ b/crypto/rc4/asm/rc4-ia64.pl
@@ -164,6 +164,9 @@
 #     random input data).
 #
 
+$output = pop;
+open STDOUT,">$output";
+
 $phases = 4;		# number of stages/phases in the pipelined-loop
 $unroll_count = 6;	# number of times we unrolled it
 $pComI = (1 << 0);
@@ -753,3 +756,5 @@ $code.=<<___;
 ___
 
 print $code;
+
+close STDOUT;
diff --git a/crypto/rc4/build.info b/crypto/rc4/build.info
index 8d63bab..b682903 100644
--- a/crypto/rc4/build.info
+++ b/crypto/rc4/build.info
@@ -2,21 +2,17 @@ LIBS=../../libcrypto
 SOURCE[../../libcrypto]=\
         {- $target{rc4_asm_src} -}
 
-BEGINRAW[Makefile]
-{- $builddir -}/rc4-586.s:	{- $sourcedir -}/asm/rc4-586.pl {- $sourcetop -}/crypto/perlasm/x86asm.pl
-	CC="$(CC)" $(PERL) {- $sourcedir -}/asm/rc4-586.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) > $@
+GENERATE[rc4-586.s]=asm/rc4-586.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR)
+DEPEND[rc4-586.s]=../perlasm/x86asm.pl
 
-{- $builddir -}/rc4-x86_64.s: {- $sourcedir -}/asm/rc4-x86_64.pl
-	CC="$(CC)" $(PERL) {- $sourcedir -}/asm/rc4-x86_64.pl $(PERLASM_SCHEME) > $@
-{- $builddir -}/rc4-md5-x86_64.s:	{- $sourcedir -}/asm/rc4-md5-x86_64.pl
-	CC="$(CC)" $(PERL) {- $sourcedir -}/asm/rc4-md5-x86_64.pl $(PERLASM_SCHEME) > $@
+GENERATE[rc4-x86_64.s]=asm/rc4-x86_64.pl $(PERLASM_SCHEME)
+GENERATE[rc4-md5-x86_64.s]=asm/rc4-md5-x86_64.pl $(PERLASM_SCHEME)
 
-{- $builddir -}/rc4-ia64.S: {- $sourcedir -}/asm/rc4-ia64.pl
-	CC="$(CC)" $(PERL) {- $sourcedir -}/asm/rc4-ia64.pl $(CFLAGS) > $@
+GENERATE[rc4-ia64.S]=asm/rc4-ia64.pl $(CFLAGS)
 
-{- $builddir -}/rc4-parisc.s:	{- $sourcedir -}/asm/rc4-parisc.pl
-	CC="$(CC)" $(PERL) {- $sourcedir -}/asm/rc4-parisc.pl $(PERLASM_SCHEME) $@
+GENERATE[rc4-parisc.s]=asm/rc4-parisc.pl $(PERLASM_SCHEME)
 
+BEGINRAW[Makefile]
 {- $builddir -}/rc4-ia64.s: rc4-ia64.S
 	@case `awk '/^#define RC4_INT/{print$$NF}' $(SRCDIR)/include/openssl/opensslconf.h` in \
 	int)	set -x; $(CC) $(CFLAGS) -DSZ=4 -E rc4-ia64.S > $@ ;; \
diff --git a/crypto/rc5/Makefile.in b/crypto/rc5/Makefile.in
index bd7a1c6..501b118 100644
--- a/crypto/rc5/Makefile.in
+++ b/crypto/rc5/Makefile.in
@@ -40,7 +40,7 @@ lib:	$(LIBOBJ)
 	@touch lib
 
 rc5-586.s: asm/rc5-586.pl ../perlasm/x86asm.pl ../perlasm/cbc.pl
-	$(PERL) asm/rc5-586.pl $(PERLASM_SCHEME) $(CFLAGS) > $@
+	$(PERL) asm/rc5-586.pl $(PERLASM_SCHEME) $(CFLAGS) $@
 
 files:
 	$(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO
diff --git a/crypto/rc5/asm/rc5-586.pl b/crypto/rc5/asm/rc5-586.pl
index 61ac6ef..a0d85f2 100644
--- a/crypto/rc5/asm/rc5-586.pl
+++ b/crypto/rc5/asm/rc5-586.pl
@@ -5,6 +5,9 @@ push(@INC,"${dir}","${dir}../../perlasm");
 require "x86asm.pl";
 require "cbc.pl";
 
+$output = pop;
+open STDOUT,">$output";
+
 &asm_init($ARGV[0],"rc5-586.pl");
 
 $RC5_MAX_ROUNDS=16;
@@ -22,6 +25,8 @@ $tmp4="edx";
 &cbc("RC5_32_cbc_encrypt","RC5_32_encrypt","RC5_32_decrypt",0,4,5,3,-1,-1);
 &asm_finish();
 
+close STDOUT;
+
 sub RC5_32_encrypt
 	{
 	local($name,$enc)=@_;
diff --git a/crypto/rc5/build.info b/crypto/rc5/build.info
index 0cf704b..bb6e5a5 100644
--- a/crypto/rc5/build.info
+++ b/crypto/rc5/build.info
@@ -2,9 +2,5 @@ LIBS=../../libcrypto
 SOURCE[../../libcrypto]=\
         rc5_skey.c rc5_ecb.c {- $target{rc5_asm_src} -} rc5cfb64.c rc5ofb64.c
 
-BEGINRAW[Makefile]
-##### RC5 assembler implementations
-
-{- $builddir -}/rc5-586.s: {- $sourcedir -}/asm/rc5-586.pl {- $sourcetop -}/crypto/perlasm/x86asm.pl {- $sourcetop -}/crypto/perlasm/cbc.pl
-	CC="$(CC)" $(PERL) {- $sourcedir -}/asm/rc5-586.pl $(PERLASM_SCHEME) $(CFLAGS) > $@
-ENDRAW[Makefile]
+GENERATE[rc5-586.s]=asm/rc5-586.pl $(PERLASM_SCHEME) $(CFLAGS)
+DEPEND[rc5-586.s]=../perlasm/x86asm.pl ../perlasm/cbc.pl
diff --git a/crypto/ripemd/Makefile.in b/crypto/ripemd/Makefile.in
index 8158a73..ba77fe4 100644
--- a/crypto/ripemd/Makefile.in
+++ b/crypto/ripemd/Makefile.in
@@ -40,7 +40,7 @@ lib:    $(LIBOBJ)
 	@touch lib
 
 rmd-586.s:	asm/rmd-586.pl ../perlasm/x86asm.pl
-	$(PERL) asm/rmd-586.pl $(PERLASM_SCHEME) $(CFLAGS) > $@
+	$(PERL) asm/rmd-586.pl $(PERLASM_SCHEME) $(CFLAGS) $@
 
 files:
 	$(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO
diff --git a/crypto/ripemd/asm/rmd-586.pl b/crypto/ripemd/asm/rmd-586.pl
index e8b2bc2..fd32a73 100644
--- a/crypto/ripemd/asm/rmd-586.pl
+++ b/crypto/ripemd/asm/rmd-586.pl
@@ -9,6 +9,9 @@ $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1;
 push(@INC,"${dir}","${dir}../../perlasm");
 require "x86asm.pl";
 
+$output=pop;
+open STDOUT,">$output";
+
 &asm_init($ARGV[0],$0);
 
 $A="ecx";
@@ -60,6 +63,8 @@ $KR3=0x7A6D76E9;
 &ripemd160_block("ripemd160_block_asm_data_order");
 &asm_finish();
 
+close STDOUT;
+
 sub Xv
 	{
 	local($n)=@_;
diff --git a/crypto/ripemd/build.info b/crypto/ripemd/build.info
index e39f9bd..f71f313 100644
--- a/crypto/ripemd/build.info
+++ b/crypto/ripemd/build.info
@@ -2,9 +2,5 @@ LIBS=../../libcrypto
 SOURCE[../../libcrypto]=\
         rmd_dgst.c rmd_one.c {- $target{rmd160_asm_src} -}
 
-BEGINRAW[Makefile]
-##### RMD160 assembler implementations
-
-{- $builddir -}/rmd-586.s:	{- $sourcedir -}/asm/rmd-586.pl {- $sourcetop -}/crypto/perlasm/x86asm.pl
-	CC="$(CC)" $(PERL) {- $sourcedir -}/asm/rmd-586.pl $(PERLASM_SCHEME) $(CFLAGS) > $@
-ENDRAW[Makefile]
+GENERATE[rmd-586.s]=asm/rmd-586.pl $(PERLASM_SCHEME) $(CFLAGS)
+DEPEND[rmd-586.s]=../perlasm/x86asm.pl
diff --git a/crypto/sha/Makefile.in b/crypto/sha/Makefile.in
index ba06085..e2d20aa 100644
--- a/crypto/sha/Makefile.in
+++ b/crypto/sha/Makefile.in
@@ -40,32 +40,32 @@ lib:    $(LIBOBJ)
 	@touch lib
 
 sha1-586.s:	asm/sha1-586.pl ../perlasm/x86asm.pl
-	$(PERL) asm/sha1-586.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) > $@
+	$(PERL) asm/sha1-586.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) $@
 sha256-586.s:	asm/sha256-586.pl ../perlasm/x86asm.pl
-	$(PERL) asm/sha256-586.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) > $@
+	$(PERL) asm/sha256-586.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) $@
 sha512-586.s:	asm/sha512-586.pl ../perlasm/x86asm.pl
-	$(PERL) asm/sha512-586.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) > $@
+	$(PERL) asm/sha512-586.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) $@
 
 sha1-ia64.s:   asm/sha1-ia64.pl
-	(cd asm; $(PERL) sha1-ia64.pl ../$@ $(CFLAGS))
+	(cd asm; $(PERL) sha1-ia64.pl $(CFLAGS) ../$@)
 sha256-ia64.s: asm/sha512-ia64.pl
-	(cd asm; $(PERL) sha512-ia64.pl ../$@ $(CFLAGS))
+	(cd asm; $(PERL) sha512-ia64.pl $(CFLAGS) ../$@)
 sha512-ia64.s: asm/sha512-ia64.pl
-	(cd asm; $(PERL) sha512-ia64.pl ../$@ $(CFLAGS))
+	(cd asm; $(PERL) sha512-ia64.pl $(CFLAGS) ../$@)
 
 sha256-armv4.S: asm/sha256-armv4.pl
 	$(PERL) $< $(PERLASM_SCHEME) $@
 
 sha1-alpha.s:	asm/sha1-alpha.pl
 	(preproc=$$$$.$@.S; trap "rm $$preproc" INT; \
-	$(PERL) asm/sha1-alpha.pl > $$preproc && \
+	$(PERL) asm/sha1-alpha.pl $$preproc && \
 	$(CC) -E -P $$preproc > $@ && rm $$preproc)
 
 # Solaris make has to be explicitly told
-sha1-x86_64.s:	asm/sha1-x86_64.pl;	$(PERL) asm/sha1-x86_64.pl $(PERLASM_SCHEME) > $@
-sha1-mb-x86_64.s:	asm/sha1-mb-x86_64.pl;	$(PERL) asm/sha1-mb-x86_64.pl $(PERLASM_SCHEME) > $@
+sha1-x86_64.s:	asm/sha1-x86_64.pl;	$(PERL) asm/sha1-x86_64.pl $(PERLASM_SCHEME) $@
+sha1-mb-x86_64.s:	asm/sha1-mb-x86_64.pl;	$(PERL) asm/sha1-mb-x86_64.pl $(PERLASM_SCHEME) $@
 sha256-x86_64.s:asm/sha512-x86_64.pl;	$(PERL) asm/sha512-x86_64.pl $(PERLASM_SCHEME) $@
-sha256-mb-x86_64.s:	asm/sha256-mb-x86_64.pl;	$(PERL) asm/sha256-mb-x86_64.pl $(PERLASM_SCHEME) > $@
+sha256-mb-x86_64.s:	asm/sha256-mb-x86_64.pl;	$(PERL) asm/sha256-mb-x86_64.pl $(PERLASM_SCHEME) $@
 sha512-x86_64.s:asm/sha512-x86_64.pl;	$(PERL) asm/sha512-x86_64.pl $(PERLASM_SCHEME) $@
 sha1-sparcv9.S:	asm/sha1-sparcv9.pl;	$(PERL) asm/sha1-sparcv9.pl $(PERLASM_SCHEME) $@
 sha256-sparcv9.S:asm/sha512-sparcv9.pl;	$(PERL) asm/sha512-sparcv9.pl $(PERLASM_SCHEME) $@
diff --git a/crypto/sha/asm/sha1-586.pl b/crypto/sha/asm/sha1-586.pl
index e0b5d83..cd71d1c 100644
--- a/crypto/sha/asm/sha1-586.pl
+++ b/crypto/sha/asm/sha1-586.pl
@@ -113,6 +113,9 @@ $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1;
 push(@INC,"${dir}","${dir}../../perlasm");
 require "x86asm.pl";
 
+$output=pop;
+open STDOUT,">$output";
+
 &asm_init($ARGV[0],"sha1-586.pl",$ARGV[$#ARGV] eq "386");
 
 $xmm=$ymm=0;
@@ -1474,3 +1477,5 @@ sub Xtail_avx()
 &asciz("SHA1 block transform for x86, CRYPTOGAMS by <appro\@openssl.org>");
 
 &asm_finish();
+
+close STDOUT;
diff --git a/crypto/sha/asm/sha1-ia64.pl b/crypto/sha/asm/sha1-ia64.pl
index 02d35d1..a9d2b7c 100644
--- a/crypto/sha/asm/sha1-ia64.pl
+++ b/crypto/sha/asm/sha1-ia64.pl
@@ -14,6 +14,8 @@
 # Performance under big-endian OS such as HP-UX is 179MBps*1GHz, which
 # is >50% better than HP C and >2x better than gcc.
 
+$output = pop;
+
 $code=<<___;
 .ident  \"sha1-ia64.s, version 1.3\"
 .ident  \"IA-64 ISA artwork by Andy Polyakov <appro\@fy.chalmers.se>\"
@@ -301,5 +303,5 @@ $code.=<<___;
 stringz	"SHA1 block transform for IA64, CRYPTOGAMS by <appro\@openssl.org>"
 ___
 
-$output=shift and open STDOUT,">$output";
+open STDOUT,">$output" if $output;
 print $code;
diff --git a/crypto/sha/asm/sha256-586.pl b/crypto/sha/asm/sha256-586.pl
index e907714..55d833a 100644
--- a/crypto/sha/asm/sha256-586.pl
+++ b/crypto/sha/asm/sha256-586.pl
@@ -63,6 +63,9 @@ $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1;
 push(@INC,"${dir}","${dir}../../perlasm");
 require "x86asm.pl";
 
+$output=pop;
+open STDOUT,">$output";
+
 &asm_init($ARGV[0],"sha512-586.pl",$ARGV[$#ARGV] eq "386");
 
 $xmm=$avx=0;
@@ -1279,3 +1282,5 @@ sub bodyx_00_15 () {			# +10%
 &function_end_B("sha256_block_data_order");
 
 &asm_finish();
+
+close STDOUT;
diff --git a/crypto/sha/asm/sha512-586.pl b/crypto/sha/asm/sha512-586.pl
index 2f6a202..d0f9101 100644
--- a/crypto/sha/asm/sha512-586.pl
+++ b/crypto/sha/asm/sha512-586.pl
@@ -50,6 +50,9 @@ $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1;
 push(@INC,"${dir}","${dir}../../perlasm");
 require "x86asm.pl";
 
+$output=pop;
+open STDOUT,">$output";
+
 &asm_init($ARGV[0],"sha512-586.pl",$ARGV[$#ARGV] eq "386");
 
 $sse2=0;
@@ -909,3 +912,5 @@ sub BODY_00_15_ssse3 {		# "phase-less" copy of BODY_00_15_sse2
 &asciz("SHA512 block transform for x86, CRYPTOGAMS by <appro\@openssl.org>");
 
 &asm_finish();
+
+close STDOUT;
diff --git a/crypto/sha/asm/sha512-ia64.pl b/crypto/sha/asm/sha512-ia64.pl
index 59f889a..4f472d1 100755
--- a/crypto/sha/asm/sha512-ia64.pl
+++ b/crypto/sha/asm/sha512-ia64.pl
@@ -68,7 +68,7 @@
 # To generate code, pass the file name with either 256 or 512 in its
 # name and compiler flags.
 
-$output=shift;
+$output=pop;
 
 if ($output =~ /512.*\.[s|asm]/) {
 	$SZ=8;
diff --git a/crypto/sha/build.info b/crypto/sha/build.info
index 2543414..9f095a8 100644
--- a/crypto/sha/build.info
+++ b/crypto/sha/build.info
@@ -2,74 +2,48 @@ LIBS=../../libcrypto
 SOURCE[../../libcrypto]=\
         sha1dgst.c sha1_one.c sha256.c sha512.c {- $target{sha1_asm_src} -}
 
-BEGINRAW[Makefile]
+GENERATE[sha1-586.s]=asm/sha1-586.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR)
+DEPEND[sha1-586.s]=../perlasm/x86asm.pl
+GENERATE[sha256-586.s]=asm/sha256-586.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR)
+DEPEND[sha256-586.s]=../perlasm/x86asm.pl
+GENERATE[sha512-586.s]=asm/sha512-586.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR)
+DEPEND[sha512-586.s]=../perlasm/x86asm.pl
+
+GENERATE[sha1-ia64.s]=sha1-ia64.pl $(CFLAGS)
+GENERATE[sha256-ia64.s]=sha512-ia64.pl $(CFLAGS)
+GENERATE[sha512-ia64.s]=sha512-ia64.pl $(CFLAGS)
+
+GENERATE[sha256-armv4.S]=asm/sha256-armv4.pl $(PERLASM_SCHEME)
+
+GENERATE[sha1-alpha.s]=asm/sha1-alpha.pl
+
+GENERATE[sha1-x86_64.s]=asm/sha1-x86_64.pl $(PERLASM_SCHEME)
+GENERATE[sha1-mb-x86_64.s]=asm/sha1-mb-x86_64.pl $(PERLASM_SCHEME)
+GENERATE[sha256-x86_64.s]=asm/sha512-x86_64.pl $(PERLASM_SCHEME)
+GENERATE[sha256-mb-x86_64.s]=asm/sha256-mb-x86_64.pl $(PERLASM_SCHEME)
+GENERATE[sha512-x86_64.s]=asm/sha512-x86_64.pl $(PERLASM_SCHEME)
+
+GENERATE[sha1-sparcv9.S]=asm/sha1-sparcv9.pl $(PERLASM_SCHEME)
+GENERATE[sha256-sparcv9.S]=asm/sha512-sparcv9.pl $(PERLASM_SCHEME)
+GENERATE[sha512-sparcv9.S]=asm/sha512-sparcv9.pl $(PERLASM_SCHEME)
+
+GENERATE[sha1-ppc.s]=asm/sha1-ppc.pl $(PERLASM_SCHEME)
+GENERATE[sha256-ppc.s]=asm/sha512-ppc.pl $(PERLASM_SCHEME)
+GENERATE[sha512-ppc.s]=asm/sha512-ppc.pl $(PERLASM_SCHEME)
+GENERATE[sha256p8-ppc.s]=asm/sha512p8-ppc.pl $(PERLASM_SCHEME)
+GENERATE[sha512p8-ppc.s]=asm/sha512p8-ppc.pl $(PERLASM_SCHEME)
+
+GENERATE[sha1-parisc.s]=asm/sha1-parisc.pl $(PERLASM_SCHEME)
+GENERATE[sha256-parisc.s]=asm/sha512-parisc.pl $(PERLASM_SCHEME)
+GENERATE[sha512-parisc.s]=asm/sha512-parisc.pl $(PERLASM_SCHEME)
+
+GENERATE[sha1-mips.S]=asm/sha1-mips.pl $(PERLASM_SCHEME)
+GENERATE[sha256-mips.S]=asm/sha512-mips.pl $(PERLASM_SCHEME)
+GENERATE[sha512-mips.S]=asm/sha512-mips.pl $(PERLASM_SCHEME)
+
+BEGINRAW[Makefile(unix)]
 ##### SHA assembler implementations
 
-{- $builddir -}/sha1-586.s:	{- $sourcedir -}/asm/sha1-586.pl {- $sourcetop -}/crypto/perlasm/x86asm.pl
-	CC="$(CC)" $(PERL) {- $sourcedir -}/asm/sha1-586.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) > $@
-{- $builddir -}/sha256-586.s:	{- $sourcedir -}/asm/sha256-586.pl {- $sourcetop -}/crypto/perlasm/x86asm.pl
-	CC="$(CC)" $(PERL) {- $sourcedir -}/asm/sha256-586.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) > $@
-{- $builddir -}/sha512-586.s:	{- $sourcedir -}/asm/sha512-586.pl {- $sourcetop -}/crypto/perlasm/x86asm.pl
-	CC="$(CC)" $(PERL) {- $sourcedir -}/asm/sha512-586.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) > $@
-
-{- $builddir -}/sha1-ia64.s:   {- $sourcedir -}/asm/sha1-ia64.pl
-	(cd asm; CC="$(CC)" $(PERL) sha1-ia64.pl ../$@ $(CFLAGS))
-{- $builddir -}/sha256-ia64.s: {- $sourcedir -}/asm/sha512-ia64.pl
-	(cd asm; CC="$(CC)" $(PERL) sha512-ia64.pl ../$@ $(CFLAGS))
-{- $builddir -}/sha512-ia64.s: {- $sourcedir -}/asm/sha512-ia64.pl
-	(cd asm; CC="$(CC)" $(PERL) sha512-ia64.pl ../$@ $(CFLAGS))
-
-{- $builddir -}/sha256-armv4.S: {- $sourcedir -}/asm/sha256-armv4.pl
-	CC="$(CC)" $(PERL) $< $(PERLASM_SCHEME) $@
-
-{- $builddir -}/sha1-alpha.s:	{- $sourcedir -}/asm/sha1-alpha.pl
-	(preproc=$$$$.$@.S; trap "rm $$preproc" INT; \
-	CC="$(CC)" $(PERL) {- $sourcedir -}/asm/sha1-alpha.pl > $$preproc && \
-	$(CC) -E -P $$preproc > $@ && rm $$preproc)
-
-# Solaris make has to be explicitly told
-{- $builddir -}/sha1-x86_64.s:	{- $sourcedir -}/asm/sha1-x86_64.pl
-	CC="$(CC)" $(PERL) {- $sourcedir -}/asm/sha1-x86_64.pl $(PERLASM_SCHEME) > $@
-{- $builddir -}/sha1-mb-x86_64.s:	{- $sourcedir -}/asm/sha1-mb-x86_64.pl
-	CC="$(CC)" $(PERL) {- $sourcedir -}/asm/sha1-mb-x86_64.pl $(PERLASM_SCHEME) > $@
-{- $builddir -}/sha256-x86_64.s:{- $sourcedir -}/asm/sha512-x86_64.pl
-	CC="$(CC)" $(PERL) {- $sourcedir -}/asm/sha512-x86_64.pl $(PERLASM_SCHEME) $@
-{- $builddir -}/sha256-mb-x86_64.s:	{- $sourcedir -}/asm/sha256-mb-x86_64.pl
-	CC="$(CC)" $(PERL) {- $sourcedir -}/asm/sha256-mb-x86_64.pl $(PERLASM_SCHEME) > $@
-{- $builddir -}/sha512-x86_64.s:{- $sourcedir -}/asm/sha512-x86_64.pl
-	CC="$(CC)" $(PERL) {- $sourcedir -}/asm/sha512-x86_64.pl $(PERLASM_SCHEME) $@
-{- $builddir -}/sha1-sparcv9.S:	{- $sourcedir -}/asm/sha1-sparcv9.pl
-	CC="$(CC)" $(PERL) {- $sourcedir -}/asm/sha1-sparcv9.pl $(PERLASM_SCHEME) $@
-{- $builddir -}/sha256-sparcv9.S:{- $sourcedir -}/asm/sha512-sparcv9.pl
-	CC="$(CC)" $(PERL) {- $sourcedir -}/asm/sha512-sparcv9.pl $(PERLASM_SCHEME) $@
-{- $builddir -}/sha512-sparcv9.S:{- $sourcedir -}/asm/sha512-sparcv9.pl
-	CC="$(CC)" $(PERL) {- $sourcedir -}/asm/sha512-sparcv9.pl $(PERLASM_SCHEME) $@
-
-{- $builddir -}/sha1-ppc.s:	{- $sourcedir -}/asm/sha1-ppc.pl
-	CC="$(CC)" $(PERL) {- $sourcedir -}/asm/sha1-ppc.pl $(PERLASM_SCHEME) $@
-{- $builddir -}/sha256-ppc.s:	{- $sourcedir -}/asm/sha512-ppc.pl
-	CC="$(CC)" $(PERL) {- $sourcedir -}/asm/sha512-ppc.pl $(PERLASM_SCHEME) $@
-{- $builddir -}/sha512-ppc.s:	{- $sourcedir -}/asm/sha512-ppc.pl
-	CC="$(CC)" $(PERL) {- $sourcedir -}/asm/sha512-ppc.pl $(PERLASM_SCHEME) $@
-{- $builddir -}/sha256p8-ppc.s:	{- $sourcedir -}/asm/sha512p8-ppc.pl
-	CC="$(CC)" $(PERL) {- $sourcedir -}/asm/sha512p8-ppc.pl $(PERLASM_SCHEME) $@
-{- $builddir -}/sha512p8-ppc.s:	{- $sourcedir -}/asm/sha512p8-ppc.pl
-	CC="$(CC)" $(PERL) {- $sourcedir -}/asm/sha512p8-ppc.pl $(PERLASM_SCHEME) $@
-
-{- $builddir -}/sha1-parisc.s:	{- $sourcedir -}/asm/sha1-parisc.pl
-	CC="$(CC)" $(PERL) {- $sourcedir -}/asm/sha1-parisc.pl $(PERLASM_SCHEME) $@
-{- $builddir -}/sha256-parisc.s:{- $sourcedir -}/asm/sha512-parisc.pl
-	CC="$(CC)" $(PERL) {- $sourcedir -}/asm/sha512-parisc.pl $(PERLASM_SCHEME) $@
-{- $builddir -}/sha512-parisc.s:{- $sourcedir -}/asm/sha512-parisc.pl
-	CC="$(CC)" $(PERL) {- $sourcedir -}/asm/sha512-parisc.pl $(PERLASM_SCHEME) $@
-
-{- $builddir -}/sha1-mips.S:	{- $sourcedir -}/asm/sha1-mips.pl
-	CC="$(CC)" $(PERL) {- $sourcedir -}/asm/sha1-mips.pl $(PERLASM_SCHEME) $@
-{- $builddir -}/sha256-mips.S:	{- $sourcedir -}/asm/sha512-mips.pl
-	CC="$(CC)" $(PERL) {- $sourcedir -}/asm/sha512-mips.pl $(PERLASM_SCHEME) $@
-{- $builddir -}/sha512-mips.S:	{- $sourcedir -}/asm/sha512-mips.pl
-	CC="$(CC)" $(PERL) {- $sourcedir -}/asm/sha512-mips.pl $(PERLASM_SCHEME) $@
-
 # GNU make "catch all"
 {- $builddir -}/sha1-%.S:	{- $sourcedir -}/asm/sha1-%.pl
 	CC="$(CC)" $(PERL) $< $(PERLASM_SCHEME) $@
@@ -77,4 +51,4 @@ BEGINRAW[Makefile]
 	CC="$(CC)" $(PERL) $< $(PERLASM_SCHEME) $@
 {- $builddir -}/sha512-%.S:	{- $sourcedir -}/asm/sha512-%.pl
 	CC="$(CC)" $(PERL) $< $(PERLASM_SCHEME) $@
-ENDRAW[Makefile]
+ENDRAW[Makefile(unix)]
diff --git a/crypto/whrlpool/Makefile.in b/crypto/whrlpool/Makefile.in
index a1be9fe..fa51f08 100644
--- a/crypto/whrlpool/Makefile.in
+++ b/crypto/whrlpool/Makefile.in
@@ -40,10 +40,10 @@ lib:	$(LIBOBJ)
 	@touch lib
 
 wp-mmx.s:	asm/wp-mmx.pl ../perlasm/x86asm.pl
-	$(PERL) asm/wp-mmx.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) > $@
+	$(PERL) asm/wp-mmx.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) $@
 
 wp-x86_64.s: asm/wp-x86_64.pl
-	$(PERL) asm/wp-x86_64.pl $(PERLASM_SCHEME) > $@
+	$(PERL) asm/wp-x86_64.pl $(PERLASM_SCHEME) $@
 
 $(LIBOBJ): $(LIBSRC)
 
diff --git a/crypto/whrlpool/asm/wp-mmx.pl b/crypto/whrlpool/asm/wp-mmx.pl
index 7725951..a71a29f 100644
--- a/crypto/whrlpool/asm/wp-mmx.pl
+++ b/crypto/whrlpool/asm/wp-mmx.pl
@@ -49,6 +49,9 @@ $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1;
 push(@INC,"${dir}","${dir}../../perlasm");
 require "x86asm.pl";
 
+$output=pop;
+open STDOUT,">$output";
+
 &asm_init($ARGV[0],"wp-mmx.pl");
 
 sub L()  { &data_byte(@_); }
@@ -493,3 +496,5 @@ for($i=0;$i<8;$i++) {
 
 &function_end_B("whirlpool_block_mmx");
 &asm_finish(); 
+
+close STDOUT;
diff --git a/crypto/whrlpool/build.info b/crypto/whrlpool/build.info
index 5cf6000..ff9d052 100644
--- a/crypto/whrlpool/build.info
+++ b/crypto/whrlpool/build.info
@@ -1,10 +1,7 @@
 LIBS=../../libcrypto
 SOURCE[../../libcrypto]=wp_dgst.c {- $target{wp_asm_src} -}
 
-BEGINRAW[Makefile]
-{- $builddir -}/wp-mmx.s:	{- $sourcedir -}/asm/wp-mmx.pl {- $sourcetop -}/crypto/perlasm/x86asm.pl
-	CC="$(CC)" $(PERL) {- $sourcedir -}/asm/wp-mmx.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) > $@
+GENERATE[wp-mmx.s]=asm/wp-mmx.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR)
+DEPEND[wp-mmx.s]=../perlasm/x86asm.pl
 
-{- $builddir -}/wp-x86_64.s: {- $sourcedir -}/asm/wp-x86_64.pl
-	CC="$(CC)" $(PERL) {- $sourcedir -}/asm/wp-x86_64.pl $(PERLASM_SCHEME) > $@
-ENDRAW[Makefile]
+GENERATE[wp-x86_64.s]=asm/wp-x86_64.pl $(PERLASM_SCHEME)
diff --git a/crypto/x86cpuid.pl b/crypto/x86cpuid.pl
index 8677232..48c4cf2 100644
--- a/crypto/x86cpuid.pl
+++ b/crypto/x86cpuid.pl
@@ -4,6 +4,10 @@ $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1;
 push(@INC, "${dir}perlasm", "perlasm");
 require "x86asm.pl";
 
+$output = pop;
+open OUT,">$output";
+*STDOUT=*OUT;
+
 &asm_init($ARGV[0],"x86cpuid");
 
 for (@ARGV) { $sse2=1 if (/-DOPENSSL_IA32_SSE2/); }
@@ -487,3 +491,5 @@ my $max = "ebp";
 &hidden("OPENSSL_ia32cap_P");
 
 &asm_finish();
+
+close STDOUT;
diff --git a/ms/uplink-x86.pl b/ms/uplink-x86.pl
index 53b998d..4a2f042 100755
--- a/ms/uplink-x86.pl
+++ b/ms/uplink-x86.pl
@@ -6,6 +6,9 @@ require "x86asm.pl";
 
 require "uplink-common.pl";
 
+$output = pop;
+open STDOUT,">$output";
+
 &asm_init($ARGV[0],"uplink-x86");
 
 &external_label("OPENSSL_Uplink");
@@ -31,3 +34,5 @@ for ($i=1;$i<=$N;$i++) {
 &data_word(&label("_\$lazy${i}"));
 }
 &asm_finish();
+
+close OUTPUT;


More information about the openssl-commits mailing list