Avoid "&&" in windows-makefile.tmpl
authorTanzinul Islam <tanzinul.islam@gmail.com>
Sat, 7 Nov 2020 12:52:30 +0000 (12:52 +0000)
committerDmitry Belyavskiy <beldmit@gmail.com>
Mon, 19 Apr 2021 09:05:53 +0000 (11:05 +0200)
The `make.exe` utility shipped with Embarcadero C++Builder has a special
meaning for the [`&&` operator in commands][1]. This meaning is retained
even in Microsoft NMake compatibility mode (`make -N`). Split all
commands using this shell (`cmd.exe`) operator into two commands.

[1]: http://docwiki.embarcadero.com/RADStudio/Sydney/en/MAKE_Rules_(Explicit_and_Implicit)_and_Commands#MAKE_Command_Operators

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/13540)

Configurations/windows-makefile.tmpl

index 050d618a23faf9b583cfce25b8bff70440cca34d..56baa5430166c0a3ae48a27ffbf2e982583478de 100644 (file)
@@ -29,7 +29,7 @@
  sub dependmagic {
      my $target = shift;
 
-     return "$target: build_generated\n\t\$(MAKE) /\$(MAKEFLAGS) depend && \$(MAKE) /\$(MAKEFLAGS) _$target\n_$target";
+     return "$target: build_generated\n\t\$(MAKE) /\$(MAKEFLAGS) depend\n\t\$(MAKE) /\$(MAKEFLAGS) _$target\n_$target";
  }
  '';
 -}
@@ -706,7 +706,8 @@ EOF
 $target: "$gen0" $deps
        set ASM=\$(AS)
        $generator \$@.S
-       \$(CPP) $incs $cppflags $defs \$@.S > \$@.i && move /Y \$@.i \$@
+       \$(CPP) $incs $cppflags $defs \$@.S > \$@.i
+       move /Y \$@.i \$@
         del /Q \$@.S
 EOF
               }
@@ -719,7 +720,8 @@ EOF
           }
           return <<"EOF";
 $target: "$gen0" $deps
-       \$(CPP) $incs $cppflags $defs "$gen0" > \$@.i && move /Y \$@.i \$@
+       \$(CPP) $incs $cppflags $defs "$gen0" > \$@.i
+       move /Y \$@.i \$@
 EOF
       } elsif ($gen0 =~ m|^.*\.in$|) {
           #
@@ -819,7 +821,8 @@ EOF
      } elsif ($srcs[0] =~ /.S$/) {
          return <<"EOF";
 $obj: $deps
-       \$(CC) /EP -D__ASSEMBLER__ $cflags $defs $srcs > \$@.asm && \$(AS) $asflags \$(ASOUTFLAG)\$\@ \$@.asm
+       \$(CC) /EP -D__ASSEMBLER__ $cflags $defs $srcs > \$@.asm
+       \$(AS) $asflags \$(ASOUTFLAG)\$\@ \$@.asm
 EOF
      }
      my $recipe = <<"EOF";
@@ -861,7 +864,7 @@ $dll: $deps
        IF EXIST $full.manifest DEL /F /Q $full.manifest
        IF EXIST \$@ DEL /F /Q \$@
        \$(LD) \$(LDFLAGS) \$(LIB_LDFLAGS) \\
-               /implib:$import \$(LDOUTFLAG)$dll$shared_def @<< || (DEL /Q \$(\@B).* $import && EXIT 1)
+               /implib:$import \$(LDOUTFLAG)$dll$shared_def @<< || (DEL /Q \$(\@B).* $import; EXIT 1)
 $objs
 $linklibs\$(LIB_EX_LIBS)
 <<
@@ -894,7 +897,7 @@ EOF
 $dso: $deps
        IF EXIST $dso.manifest DEL /F /Q $dso.manifest
        \$(LD) \$(LDFLAGS) \$(DSO_LDFLAGS) \\
-               \$(LDOUTFLAG)$dso$shared_def @<< || (DEL /Q \$(\@B).* $dso_n.* && EXIT 1)
+               \$(LDOUTFLAG)$dso$shared_def @<< || (DEL /Q \$(\@B).* $dso_n.*; EXIT 1)
 $objs
 $linklibs \$(DSO_EX_LIBS)
 <<