Invoking MSYS bash from Windows cmd

Taco de Wolff picture Taco de Wolff · May 2, 2010 · Viewed 16.5k times · Source

I'm using GCC on Windows 7 (using the TDM's build). I installed MSYS to be able to execute Make and compile using makefiles. However, it is tedious to every time start up the MSYS Bash shell, navigate to the directory of the project and run make.

What I want is to automate this process. I prefer to have a batch file in Windows, or something similar, from which I then invoke the MSYS Bash shell. It should navigate to the directory the batch file resides in and call make.

Is this possible? Can I send commands to MSYS Bash from cmd (like navigation/invoking make)? Or can I let the MSYS Bash run a "Bash script", which sets the commands to be executed much like batch scripts?

PS: This is something similar to Stack Overflow question Executing MSYS from cmd.exe with arguments.

Answer

clstrfsck picture clstrfsck · May 2, 2010

Not an MSYS expert, but does something like this work for you:

rem Call this something like compile-project.bat
c:
cd \src\project
bash -c "make"