Distributed GNU Make for Win32 - winapi

Is there a version of GNU Make, or GNU Make compatible application, which supports distributed builds on Win32?
We currently have a large project using gnu makefiles. We use the Win32 version of GMake to build. Our build environment supports parallel builds without a problem, and we'd like to try and perform a distributed build if possible.
Any ideas?

distcc is the grand-father of doing this, though I'm not sure it would be easy to get running on win32. cygwin might make this possible.

I'd try Cygwin but the performance might be poor because of the emulation layer.

I hope I've understood Your problem properely, but
You can use:
Cygwin
or
mingw
MinGw is a complete port of GNU binutils for windows.

ElectricAccelerator from Electric Cloud does exactly this. It's a parallel, distributed replacement for gmake and nmake. If your build problem is bad enough and you have some budget to spend on a solution, you should check it out:
ElectricAccelerator home page
Disclaimer: I'm the tech lead for the Accelerator team at Electric Cloud.

Related

IDE use a VM compiler?

I'm starting to work on my master thesis at the moment and I have a (maybe) specific question...
I want to stay on windows OS and run a Linux VM via VirtualBox combined with Vagrant. No Problem. I like the feature to reset the VM via vagrant easily.
The next target is using features like auto-completing or similar while developing in C++. This would help me to work with unknown includes/libraries.
Is it possible to access the filesystem/compiler of the VM while using an IDE (like clion) installed on windows? Without explicit loading of the gui und running the IDE on it? Kinda like working with cygwin? I don't want to use cygwin because it doesn't support c++11 standard (or is there a way???)
Maybe you know an alternative way. I would be glad for all hints solving my problem.
I don't know much about cygwin, though I would be surprised if they cannot get recent versions of gcc. But for certain, you can use MSYS2 to get very recent versions of gcc and many other linux packages, which will support C++11.
It's a matter of opinion how best to do cross-platform development, but an alternative worth mentioning is to use cmake for your project. When you want to code in windows, it can make MSVC 2015 project files for you -- when you want to compile in linux, it can find the dependencies and generate a makefile for you to use. IIUC, cmake is the most widely used cross-platform build system right now, besides gnu make itself. (I'm pretty sure it's more popular than "autotools" nowadays, and its definitely more popular than scons.) The advantage is that you avoid the need to maintain multiple platform-specific project files that essentially say the same thing with different formatting.

GNU make with xlc compiler

Hoping for a bit of insight here. I have source code for one of our projects, with no documentation on how to compile, and all people who wrote it having left :) We have an issue in it and lucky moi has been tasked to investigate.
Currently I'm trying to build on AIX, the makefile keeps on complaining with either
make: 1254-055 Dependency line needs colon or double colon operator.
or
make: 1254-057 Shell command needs a leading tab.
The CPP options seem to be xlc options, and the software has been compiled many times before. The makefile contains control characters from windows in it and does have tabs against some of the entries but not all the shell commands.
Any thoughts on what could be the issue running make on the code? I haven't installed GNU make as of yet, could this solve the issues?
Classic SysV make is much more picky about formatting than gnumake is, never mind the feature set is much more restricted. I don't even bother writing "classic" compatible Makefiles anymore - too painful.
Even though we use the native compilers (xlc) on AIX, we still use gmake as our dependency/build tool.
I recommend installing a managed copy of gmake, downloadable from a couple sources:
Direct from IBM thru the AIX/Linux toolbox.
As an RPM from here.
From Bull here.
As lpp packages from pware here.
Good luck!
I think you might need to use gmake even on AIX. The original make may not be working as expected. The Windows control character may or may not matter (usually does not), but can be edited out on vi.
With C++ sources, in my company :
On AIX, we use make (and xlC_r compiler).
On AS400, we use gmake (and ixlc compiler). Because make exists, but is PASE only.
gmake was certainly found on some old website... there are many other GNU programs on our iSeries. I haven't found any trace of it beside the PGM.

How do I compile a crosscompiler targeting Linux x64 on a Windows host?

I am planning on harvesting my gaming HTPCs spare cycles for compiling my software using distcc, but I will need to set up a cross compiler. The problem is that Google is sadly lacking in relevant information.
I think Cygwin is the purest form of evil, but is the easiest way of doing what you want.
You will just have to install the correct version of gcc from the cygwin installer.
This website has the answer here

Is it possible to use GCC without Cygwin or MinGW?

GCC is a very well respected multi-language compiler (from what I've gathered). One thing I've not been able to definitively find out is: Is it possible to use GCC on windows without anything extra like Cygwin or MinGW?
I've learned that if you use GCC on Cygwin, there is a dependency on a DLL. If you use GCC with MinGW, you eliminate that dependency but you still must have MinGW to use GCC.
Is it possible to build GCC and utilize it by itself, completely native to Windows? Like Microsoft's Compiler? After reading around, my guess is no. But I'd still like more info, if possible.
If not, why does GCC require environments like Cygwin or MinGW? I understand this now. It is because GCC requires a Unix/POSIX environment. Why it does, it still beyond me.
I did find this and it helps but doesn't really answer my question: Why does GCC-Windows depend on cygwin?
To refine my question, I guess what I'm trying to understand why GCC can't stand on it's own -- Where I have just "GCC.exe".
For MinGW, you need MinGW in the sense that MinGW provides the implementation of the gcc language system. I don't see how your question makes sense - it's like "Can I use VC++ without installing VC++?"
To clarify: MinGW is the GCC compiler executable(s), headers and support objects. There isn't anything else. There is a related but independant package called MSYS which provides some posix utilities, but you do not need this in any way in order to use the MinGW version of GCC.
What is exactly the problem with mingw? And what is native?
mingw used to generate pretty much standalone binaries, and maybe that is even more native than MSVC's, which require msvcrt, a component that needs to be installed sometimes.
So maybe you could explain what you tried with mingw, and what the exact problem is.
To disable mingw's extra dependency simply don't use exceptions (-fno-exceptions), I haven't used cygwin so not sure.
I don't think so. I've had to compile some command line apps for people in the past and always had to use cygwin.
I think the biggest reason being posix compatibility, which is what cygwin strives to bring to Win32.
Linaro used to provide that long time ago, a GCC that runs naively on Windows without MinGW or Cygwin. I am currently using that GCC 4.9 on a Windows 10 PC to compile UEFI and it is working like charm.
https://releases.linaro.org/archive/14.09/components/toolchain/binaries/gcc-linaro-arm-none-eabi-4.9-2014.09_win32.zip
simply install wsl on your computer.

Is there any material about makefile in Windows?

Is there any difference between makefile in Windows and Linux?
If I know how to use it in Linux, is it necessary to learn
something new when in Windows system?
The fine folks over at GnuWin32 have Gnu make built for Windows as a native binary. It works well, but does have a few minor quirks due to a well-intentioned hack that tries to equate a target named foo with the file foo.exe. The GnuWin32 package does include a nice PDF of the manual, IIRC.
I use it on XP alongside GCC from the MinGW project, as well as with several different embedded systems cross compiler toolchains. MinGW also provides a native build of Gnu Make.
We do use Cygwin for a couple of projects, in particular one where the system-on-a-chip vendor provided a complete, working toolchain and build environment hosted in Cygwin. Moving it to a native Windows shaped build would be prohibitively expensive, and would make it harder to accept updates from the vendor.
If you want to use mostly native Windows tools, but need to start by running configure on an existing source kit, then take a look at MSYS. This started as a fork of Cygwin by the MinGW developers, and it intends to provide a minimal set of unix-like tools with a bash shell so that configure can be used on Windows. It isn't as complete as Cygwin, but it is a lot lighter weight.
You will find that the manual for Gnu Make is mostly true. However, you have to keep in mind that the content of a Makefile is not written in a single language. The stuff that defines variables and lays out the dependancy tree is one language. Each line of an action is a miniature shell script that is in the language of the default shell (which might be CMD.EXE rather than /bin/sh on Windows), and each command has options and arguments.
If you are comfortable with your *nix build environment, then Cygwin might be the path of least pain. But MSYS is often sufficient, and there is something to be said for adopting the native tools of the target platform so that you have a sense of how your users see Windows, in which case MinGW and GnuWin32 are handy resources to know about.
In addition to what iftrue note that Microsoft has a Makefile based build tool called nmake with some changes in syntax/semantics from the traditional *nix based make tool. This page lists some of the differences.
Well, if you download "cygwin", you can run the "make" tool directly on windows, but you may want to look into a true cross-platform build tool such as "cmake". It's like make, but it's a bit more spiffy and is inherently cross-platform.

Resources