Search code examples
visual-studio-2010makefilemingwmingw32

can mingw build a visual studio-2010 project?


I have a visual studio-2010 project which contains lots of source files and header files. Now I need to autobuild this project under the latest Debian GNU/Linux. So I choose to use MinGW. But I need a makefile of this visual studio project. Is there a easy way to translate a vs project into a makefile? Or MinGW can directly build a visual studio project with additional packages or libraries? Any ideas will be appreciated.


Solution

  • If you want to port building of your program permanently to GNU/Linux, I'd recommend to switch to the autotools (autoconf and automake). The autotools are very widespread and have excellent cross-compilation support. (on the other hand, also a somewhat earned reputation for weirdness.) While there is no auto-translation from VS projects I'm aware of, compilation of a single program can be as simple to set up as finding all source and header files, listing them in the Makefile.am appropriately and writing a rule for Windows objects.

    If the transition to MinGW isn't written in stone or a continuing two-compiler build scenario is likely, go with cmake like the commenters suggested. While I've always found CMake to be a major pain for non-maintainer builds (common for open-source software), it has a good reputation for generating all kinds of build description files like Makefiles and VS projects.

    One way or the other, you'll have to convert your project by hand. It can be quite easy for a normal project structure, but it has to be done.