megamarc / Tilengine

Free 2D graphics engine with raster effects for retro/classic style game development
https://www.tilengine.org
Mozilla Public License 2.0
839 stars 95 forks source link

MinGW-w64 Makefile support #78

Open GithubPrankster opened 3 years ago

GithubPrankster commented 3 years ago

Hello! It's been a while and I wanted to try using Tilengine again with a more mature understanding of programming. However, being that I'm on Windows and I utilize the MSYS2 tools. (they provide UNIX-like programs and shells to give Windows program development a similar workflow to Linux) the C compiler is MinGW-w64 and thus different from the one with Visual Studio.

Unfortunately however, the Makefile in Tilengine does not support this kind of enviromment. I tried modifying it to add a 'MSYS2' target myself however the resulting library file seemed useless and didn't link correctly to anything. I'll try again soon but that's it for now.

megamarc commented 3 years ago

Hi, I don't know MSYS2 environment myself, so I cannot provide a cross-platform, cross-toolchain universal makefile. I recommend sticking to standard tools on each OS: Visual Studio Community on Windows, and GNU make on Linux. However I can recommend you using the excellent tiny C compiler. It can generate native x64 executables on Windows, it acts as a drop-in replacement for gcc. This is the tool I use to build x64 binaries of the samples under windows.

GithubPrankster commented 3 years ago

What type of Makefile do you utilize for TCC builds however?

megamarc commented 3 years ago

No makefile, just a basic batch file: https://github.com/megamarc/Tilengine/blob/master/samples/build.bat