'Why does make run in PowerShell but not as .sh

I am currently in the process of moving from AtmelStudio 7 to cmake and currently trying to make using a shell script. If I open a terminal in the directory of the makefile and run make, it works fine:

PS C:\Projects\my-cmake-avr\build> make
[ 20%] Building C object CMakeFiles/Something_sequence-atmega644a.elf.dir/main.c.obj
[ 40%] Linking C executable Something_sequence-atmega644a.elf
[ 40%] Built target Something_sequence-atmega644a.elf
[ 60%] Generating Something_sequence-atmega644a.hex
AVR Memory Usage
----------------
Device: atmega644a

Program:     148 bytes (0.2% Full)
(.text + .data + .bootloader)

Data:          0 bytes (0.0% Full)
(.data + .bss + .noinit)


[ 80%] Generating Something_sequence-atmega644a.lst
[100%] Generating Something_sequence-atmega644a-eeprom.hex
[100%] Built target Something_sequence
PS C:\Projects\my-cmake-avr\build>

but running my script make.sh

#!/bin/bash
STRING="Hello Make!"
make
echo "Hit return to continue"
read dummy_variable

will cause this error:

/usr/bin/sh: -c: line 0: syntax error near unexpected token `('
/usr/bin/sh: -c: line 0: `C:/Program Files (x86)/Atmel/Studio/7.0/shellutils/make -s -f CMakeFiles/Makefile2 all'
Makefile:90: recipe for target 'all' failed
make: *** [all] Error 1
Hit return to continue

I googled the error-msg but so far I couldn't figure out what to do. I have already run .sh-scripts on my windows machine, for example the creation of my makefile via cmake:

#!/bin/bash
STRING="Hello Cmake!"
echo $STRING
rm -r build
#cmake -S . -B build/ -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE="C:\Projects\cmake-avr\generic-gcc-avr.cmake"
cmake -G "Unix Makefiles" --log-level=TRACE -B build/ -DCMAKE_TOOLCHAIN_FILE="C:\Projects\cmake-avr\generic-gcc-avr.cmake" C:/Projects/my-cmake-avr
echo "Hit return to continue"
read dummy_variable

any ideas what I could try



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source