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.
Execute Shell Script Files Open Command Prompt and navigate to the folder where the script file is available. Type Bash script-filename.sh and hit the enter key. It will execute the script, and depending on the file, you should see an output.
MSYS is an application that gives the user a Bourne shell that can run configure scripts and Makefiles. No compilers come with MSYS. In the Cygwin, MinGW, and MSYS hierarchy, it is at the bottom the food chain in terms of tools provided. However, it is very easy to use and build the OS project with MSYS.
Just add executables to your Windows PATH:
C:\msys64\mingw64\bin
C:\msys64\usr\bin
Keep in mind, this adds a lot of executables to your path which might conflict with other applications. The ..\usr\bin
directory contains all installed MSYS2 packages. There is a lot of unnecessary stuff. ..mingw64\bin
directory has a smaller list.
Source
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"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With