michaelficarra / CoffeeScriptRedux

:sweat: rewrite of the CoffeeScript compiler with proper compiler design principles and a focus on robustness and extensibility
https://michaelficarra.github.com/CoffeeScriptRedux/
BSD 3-Clause "New" or "Revised" License
1.84k stars 110 forks source link

Build with windows #194

Closed vendethiel closed 11 years ago

vendethiel commented 11 years ago

Hi!

So, I wanted to try and make 1/2 things wherever, but I'm having problems with the Makefile.

So ... I know you insisted on using a Makefile, and I love these too, but I don't see how I can use your one on windows, which is making me sad (╥_╥).

mehcode commented 11 years ago

It's an enormous amount of work to make a makefile that runs in both GNU make and windows NMake for more than just simple tasks. I'd recommend using something cross-platform: cmake, waf, etc.

vendethiel commented 11 years ago

Whatever, cmake or cake or anything doesn't matter to me.

marchaefner commented 11 years ago

Cygwin is the (obvious) solution and an acceptable requirement IMO.

The third point however might be a bug, caused by these 3 lines. process.title is not necessarily "node" in node.js (for me it's the current path). In a browser it just does not exist and causes a ReferenceError. (@ghempton: Did i miss something?)

Browser vs node.js detection is notoriously hard / unreliable, but something like this would probably be a better solution.

vendethiel commented 11 years ago

Cygwin is so bad and so horribly done it's never an ok requirement. I'd not use it even if that was the only way I had to build a project.

marchaefner commented 11 years ago

I missed something (sorry for the noise): commonjs-everywhere sets process.title to "browser".

A better detection would then be something like

unless process.title is 'browser'
  require './run'
epidemian commented 11 years ago

Cygwin is so bad and so horribly done it's never an ok requirement. I'd not use it even if that was the only way I had to build a project.

Sad to hear that shell compatibility between *nix-like operating systems and Windows is still so crappy.

I remember, however, that the MinGW project provided a set of command-line tools that emulated the *nix commands, including bash, make, and the very useful things like ls, rm, grep, etc, without requiring a full POSIX system ala Cygwin. I think i had some sort of success building C++ projects on both Windows and Linux with the same Makefile using those tools; but that was long time ago, i don't know what's their current state.

vendethiel commented 11 years ago

I remember, however, that the MinGW project provided a set of command-line tools that emulated the *nix commands, including bash, make, and the very useful things like ls, rm, grep, etc, without requiring a full POSIX system ala Cygwin. I think i had some sort of success building C++ projects on both Windows and Linux with the same Makefile using those tools; but that was long time ago, i don't know what's their current state.

I use that already. Does not do anything for the problems I mentioned here :(.

michaelficarra commented 11 years ago

@marchaefner: that is a relic from browserify days. With commonjs-everywhere, I can just alias src/run.coffee to /dev/null.

@epidemian: believe it or not, windows is a POSIX compliant OS. edit: Apparently, not since NT 4. That shows how long it's been since I've looked at Windows...

vendethiel commented 11 years ago

the only problems (when building) so far seems to be to be the globbing

SRC = $(shell find src -name "*.coffee" -type f | sort)
LIB = $(SRC:src/%.coffee=lib/%.js) lib/parser.js

in $(LIB) but I have no idea whatsoever how to fix it. Googling didn't help a single bit.

michaelficarra commented 11 years ago

@Nami-Doc: maybe this would work better? https://github.com/int3/closure-interpreter/blob/48ce8e7284b57fb376150073d4c36585511ec354/Makefile#L3-L4

vendethiel commented 11 years ago

Seems to work with SRC = $(wildcard src/*.coffee | sort)!

michaelficarra commented 11 years ago

Fixed by #218.