Repository: neovim
Issue: Build failed on Windows
Labels: bug,build,platform:windows

### Problem

The newest Makefile gives this:

    E:\neovim_sources>make -v
    GNU Make 4.4.1
    Built for x86_64-pc-msys
    Copyright (C) 1988-2023 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>
    This is free software: you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law.
    
    E:\neovim_sources>cmake --version
    cmake version 3.30.5
    
    CMake suite maintained and supported by Kitware (kitware.com/cmake).

    E:\neovim_sources>make distclean
    if (Test-Path  ".deps") { remove-item -recurse  ".deps" }
    if (Test-Path  build) { remove-item -recurse  build }
    make clean
    make[1]: Entering directory '/e/neovim_sources'
    /usr/bin/make -C test/old/testdir clean
    make[2]: Entering directory '/e/neovim_sources/test/old/testdir'
    rm -f -rf *.out *.failed *.res *.rej *.orig *.tlog opt_test.vim test_result.log test.log messages starttime test.out X* viminfo test.ok valgrind.* .*.swp .*.swo .gdbinit /e/neovim_sources/test/old/testdir/X-test-tmpdir del ../../../runtime/doc/.*.swp
    make[2]: Leaving directory '/e/neovim_sources/test/old/testdir'
    /usr/bin/make -C runtime/indent clean
    make[2]: Entering directory '/e/neovim_sources/runtime/indent'
    rm -f testdir/*.fail testdir/*.out
    make[2]: Leaving directory '/e/neovim_sources/runtime/indent'
    make[1]: Leaving directory '/e/neovim_sources'


    E:\neovim_sources>make CMAKE_BUILD_TYPE=Release CMAKE_INSTALL_PREFIX=D:/nvim install
    At line:1 char:3
    + if [ -f build/.ran-cmake ]; then \
    +   ~
    Missing '(' after 'if' in if statement.
    At line:1 char:5
    + if [ -f build/.ran-cmake ]; then \
    +     ~
    Missing type name after '['.
    At line:2 char:57
    +   cached_prefix=At line:1 char:21 + cmake -L -N build | 2>/dev/null g ...
    +                                                         ~
    Expressions are only allowed as the first element of a pipeline.
    At line:2 char:69
    + ... efix=At line:1 char:21 + cmake -L -N build | 2>/dev/null grep 'CMAKE_ ...
    +                                                              ~~~~
    Unexpected token 'grep' in expression or statement.
    At line:2 char:240
    + ... ment of a pipeline. At line:1 char:33 + cmake -L -N build | 2>/dev/nu ...
    +                                                                 ~
    Expressions are only allowed as the first element of a pipeline.
    At line:2 char:252
    + ... ine. At line:1 char:33 + cmake -L -N build | 2>/dev/null grep 'CMAKE_ ...
    +                                                              ~~~~
    Unexpected token 'grep' in expression or statement.
    At line:3 char:5
    +   if ! [ "D:/nvim" = "$cached_prefix" ]; then \
    +     ~
    Missing '(' after 'if' in if statement.
    At line:3 char:9
    +   if ! [ "D:/nvim" = "$cached_prefix" ]; then \
    +         ~
    Missing type name after '['.
    At line:3 char:7
    +   if ! [ "D:/nvim" = "$cached_prefix" ]; then \
    +       ~
    Missing expression after unary operator '!'.
    At line:3 char:8
    +   if ! [ "D:/nvim" = "$cached_prefix" ]; then \
    +        ~
    Unexpected token '[' in expression or statement.
        + CategoryInfo          : ParserError: (:) [], ParentContainsErrorRecordException
        + FullyQualifiedErrorId : MissingOpenParenthesisInIfStatement
    
    make: *** [Makefile:50: checkprefix] Error 1
`

### Steps to reproduce

        
        make CMAKE_BUILD_TYPE=Release CMAKE_INSTALL_PREFIX=D:/nvim install

### Expected behavior

no error message and make succeeds.

### Nvim version (nvim -v)

nvim v0.11.0-dev-649+ge48179f31-dirty

### Vim (not Nvim) behaves the same?

no

### Operating system/version

windows 10  22H2 (19045. 5073)

### Terminal name/version

cmd/powershell 7

### $TERM environment variable

-

### Installation

-