Windows build: build foo.d after foo.obj
authorRichard Levitte <levitte@openssl.org>
Tue, 23 Oct 2018 08:35:48 +0000 (10:35 +0200)
committerRichard Levitte <levitte@openssl.org>
Mon, 29 Oct 2018 13:27:00 +0000 (14:27 +0100)
We made the build of foo.obj depend on foo.d, meaning the latter gets
built first.  Unfortunately, the way the compiler works, we are forced
to redirect all output to foo.d, meaning that if the source contains
an error, the build fails without showing those errors.

We therefore remove the dependency and force the build of foo.d to
always happen after build of foo.obj.

Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/7469)

Configurations/windows-makefile.tmpl

index 44cc7d0fc95fd5ea449b3b606a03b9a5721fa8aa..c4987f2407ef01b5c51c1716e7bbe2f0d64ef5e5 100644 (file)
@@ -615,16 +615,14 @@ $obj$objext: $deps
        \$(CC) /EP /D__ASSEMBLER__ $cflags $srcs > \$@.asm && \$(AS) $asflags \$(ASOUTFLAG)\$\@ \$@.asm
 EOF
      }
        \$(CC) /EP /D__ASSEMBLER__ $cflags $srcs > \$@.asm && \$(AS) $asflags \$(ASOUTFLAG)\$\@ \$@.asm
 EOF
      }
-     return <<"EOF"    if (!$disabled{makedepend});
-$obj$depext: $deps
-       \$(CC) $cflags /Zs /showIncludes $srcs 2>&1 > $obj$depext
-$obj$objext: $obj$depext
-       \$(CC) $cflags -c \$(COUTFLAG)\$\@ $srcs
-EOF
-    return <<"EOF"     if ($disabled{makedepend});
+     my $recipe = <<"EOF";
 $obj$objext: $deps
        \$(CC) $cflags -c \$(COUTFLAG)\$\@ $srcs
 EOF
 $obj$objext: $deps
        \$(CC) $cflags -c \$(COUTFLAG)\$\@ $srcs
 EOF
+     $recipe .= <<"EOF"        unless $disabled{makedepend};
+       \$(CC) $cflags /Zs /showIncludes $srcs 2>&1 > $obj$depext
+EOF
+     return $recipe;
  }
 
  # We *know* this routine is only called when we've configure 'shared'.
  }
 
  # We *know* this routine is only called when we've configure 'shared'.