4 ms·
My only gripe with Makefiles is the lack of support on Windows. I work on several Go projects, all of which use a Makefile. It makes for a great experience on M
by bacongobbler 9y ago
My only gripe with Makefiles is the lack of support on Windows. I work on several Go projects, all of which use a Makefile. It makes for a great experience on MacOS and Linux, but on Windows I have to break down the Makefile logic into powershell scripts or run raw `go test/build`. Both are fine, but just pointing out the fact that it's not a silver bullet if your project is intended to work across multiple platforms (like a CLI).
- firethief 9y agoDoes WSL not solve that?
- wtetzner 9y agoIf you do your build under WSL, you'll get a Linux binary. Which may or may not be OK, depending on what you're after.
- rcarmo 9y agoNope. Here: https://github.com/golang/go/wiki/WindowsCrossCompiling https://github.com/golang/go/wiki/WindowsCrossCompiling
- wtetzner 9y agoAh, that's a good point. You just need to remember to set the right environment variables. Unless you need to link against MSVC stuff, although I don't know if Go supports that anyway.
- e12e 9y agoDoesn't look like go works with msvc yet - the following issue was a fascinating read (partly because of the optimism and persistence displayed, partly in a ohmigoditsatrainwreckcantlookaway-way ;) https://github.com/golang/go/issues/20982 https://github.com/golang/go/issues/20982
- sythe2o0 9y agoIt isn't always as simple as setting some environment variables. None of the projects I work on will compile when told to compile for another OS_ARCH because of the dependencies they have.
- rpeden 9y agoIf you use Cmder[1] as your terminal, and you install the full package, make is bundled with it and works exactly as you'd expect it to. I do this with a couple of cross platform Go projects, and make works nicely on macOS, Linux, and Windows. Of course, this is less useful if it's a team project, because then everyone will have to install Cmder (or at least msys) to use the Makefile on a Windows system. [1]http://cmder.net/ http://cmder.net/
- bacongobbler 9y agoSure, I have `make` installed and I'm using cmder, but some things do not translate well in Windows. https://cognitivewaves.wordpress.com/makefiles-windows/ https://cognitivewaves.wordpress.com/makefiles-windows/
- int_19h 9y agoMSYS2 offers a nice and relatively lean Unix-like build environment on top of Win32. It's especially convenient if your dependencies happen to be in their Pacman package repo (and if not, you can submit them to it...).