Open dragon788 opened 8 years ago
I think CMake is overkill (and yet another tool to install), and I'm not sure how much code could be shared between a Windows-specific Makefile and a non-Windows specific Makefile. The Makefile structure should be really simple - there's been a lot of work in the other templates to reduce it down to "box build && box assure && box deploy". The hope would be that it could be just as simple on Windows, moving most of the logic in the Makefile out to a supporting script/cli app.
I do think it is perfectly acceptable to have another Makefile for those building on Windows. The current structure came about just because when the original author worked at Chef, the build farm was all Macs, so a GNU Makefile made sense.
Perhaps it makes more sense to standardize around MSBuild instead of NMake for the Windows-specific build driver?
MingW/msys has make, so you don't need to install Cygwin. I would prefer we make our Makefile MingW compatible (if it's not already) then create a separate NMake compatible Makefile, but would accept a PR containing one.
I'm actually working a bit on "porting" the Makefile to PowerShell, as that is available out of the box in Windows 7 and up, with packages available back to XP I think, but at least all currently "supported" Microsoft operating systems have it. I'll have some more code pushed to my fork in the next couple of days, and then might open a PR for comments and concerns.
I've looked at this a little more. There is a GNU make for Windows, and it can be run from cmd/PowerShell without requiring a complete rewrite of the Makefile.
The things it seems to be getting hung up on to start with are the calls to shell $(shell cat VERSION)
which on Windows would be COMSPEC aka cmd.exe. There is a way to detect this pretty easily and use an alternate call (like $(shell type VERSION)) from the write-up provided this blog or the alternate option from StackOverflow
I'm working on it in my spare time, but haven't found a lot of time to devote as I'm trying to get a working box as part of my yak shaving for another project and so I have been working around the issue using a few other tricks. Also the Makefile is amazing and staggering in its scope and options, which I'm assuming means it was originally generated via Autotools or something like that.
The Makefile was generated by hand actually, but it does make use of some pretty obscure GNU Makefile constructs to dynamically generate tasks on-the-fly. And indeed not trivial to port to NMake.
For the other platforms great effort has been made to simplify the Makefile by pushing more functionality out to external programs (like 'box build"). The Windows Makefile should follow the same direction, and that will make it much easier to have different flavours of Makefile.
Sent from my thought matrix via the nexus
On Jun 21, 2016, at 12:40, dragon788 notifications@github.com wrote:
I've looked at this a little more. There is a GNU make for Windows, and it can be run from cmd/PowerShell without requiring a complete rewrite of the Makefile. The things it seems to be getting hung up on to start with are the calls to shell $(shell cat VERSION) which on Windows would be COMSPEC aka cmd.exe. There is a way to detect this pretty easily and use an alternate call (like $(shell type VERSION)) from the write-up provided this blog or the alternate option from StackOverflow
I'm working on it in my spare time, but haven't found a lot of time to devote as I'm trying to get a working box as part of my yak shaving for another project and so I have been working around the issue using a few other tricks. Also the Makefile is amazing and staggering in its scope and options, which I'm assuming means it was originally generated via Autotools or something like that.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.
It would be great for those in more restrictive environments that don't allow arbitrary tools like Cygwin on their systems to use "authorized" tools like Visual Studio with NMake to build these VMs. There probably isn't a good way to make the Makefile directly cross platform for NMake and Linux make, but perhaps CMake would be an acceptable middle ground?
https://cognitivewaves.wordpress.com/makefiles-windows/