You may need to use platform checks to switch between behaviour suited for MSYS2 and the default one. $(info The version of MSYS you are running is $(msys_version) (0 meaning not MSYS at all)) Msys_version := $(if $(findstring Msys, $(shell uname -o)),$(word 1, $(subst. On any other system with uname present, it will set it to 0. If you run it through mingw32-make.exe from one of the MSYS shells, it will set msys_version to 1 or 2 as appropriate. If you run it through mingw32-make.exe from cmd.exe you will likely get an error since uname will not be found on your PATH. You can use the following Makefile snippet to detect whether you are running GNU make from an MSYS or an MSYS2 shell. Unless you know what you're doing, use the regular make. The downside is that it doesn't work with many Makefiles. The latter one is called mingw32-make on command line, is fully native and doesn't depend on msys2 shells.
MSYS2 provides two versions of make, one in the make package and one in the mingw-w64-make packages.
HOW TO RUN MINGW SOFTWARE
While in our humble opinions, MSYS2 makes collaborative, organised development of open-source software on Windows a workable proposition, there are a few things to be aware of that we commonly run into, mostly due to the design decisions made by Microsoft, our preference for using native tools and compilers rather than cross msys2-to-native ones and our wish to be as flexible as we can be. Undefined references and linking to DLLs/SOs Guarded time functions, ANSI format specifiers Calling conventions, stdcall, and autotools