Configurations/unix-Makefile.tmpl: don't leave empty .s files behind.
authorAndy Polyakov <appro@openssl.org>
Fri, 11 Mar 2016 10:55:44 +0000 (11:55 +0100)
committerAndy Polyakov <appro@openssl.org>
Fri, 11 Mar 2016 14:29:49 +0000 (15:29 +0100)
If pre-processor failed, an empty .s file could be left behind,
which could get successfully compiled if one simply re-ran make
and cause linking failures. Not anymore. Remove even intermediate .S
in case of pre-processor failure.

Reviewed-by: Richard Levitte <levitte@openssl.org>
Configurations/unix-Makefile.tmpl

index 3718467fac5ed334f7833f2c21107bd98d94f077..05844f00a45df2c9c4216c2758a5b03b2f293f41 100644 (file)
@@ -850,9 +850,9 @@ EOF
                    (my $target = $args{src}) =~ s|\.S$|.s|;
                    return <<"EOF";
 $target: $args{generator}->[0]
-       ( trap "rm -f \$@.S" INT; \\
+       ( trap "rm -f \$@.*" INT 0; \\
          $generator \$@.S; \\
-         \$(CC) \$(CFLAGS) $incs -E -P \$@.S > \$@ && rm -f \$@.S )
+         \$(CC) \$(CFLAGS) $incs -E -P \$@.S > \$@.i && mv -f \$@.i \$@ )
 EOF
               }
               # Otherwise....