The Haxe compiler sources are hosted on GitHub under the HaxeFoundation account. The Haxe repository has several submodules, so cloning it should be done with the --recursive
flag like so:
git clone --recursive https://github.com/HaxeFoundation/haxe.git
Alternatively, source .zip archives or tarballs can be obtained from the GitHub Haxe release overview. However, the git submodules are not included, so you will have to manually place the source code of submodules into appropreate sub-folders.
For Haxe 4 and later, please read the extra/BUILDING.md
file in the source folder.
For Haxe 3.x, read below.
The dependencies can be easily installed by Homebrew. In fact, if you only want to use the latest development branch of Haxe, without modifying the source, simply run:
brew install haxe --HEAD
Use brew reinstall haxe --HEAD
to upgrade in the future.
If you want to start hacking the Haxe compiler, it is better to clone manually and use the Makefile:
brew cask install xquartz
brew install ocaml camlp4 pcre neko
make
:make
make install
sudo apt-get install neko
.make
:make
make install
mingw64-i686-zlib
and mingw64-i686-pcre
(used by Haxe).
You might need to switch "View" in top-right corner to "Not Installed" to see it in the list. When installer doesn't provide option to install packages, navigate to "C:\OCaml32\home\nadako.opam\4.02.3+mingw32c\bin" and run command-line cygwin-install.exe gui
.Run OCaml32 terminal from the desktop shortcut, from it:
opam install camlp4 sedlex ocamlfind xml-light extlib rope ptmap sha
Add these to the start of your PATH (actual paths may differ depending on your install path, username, and OCaml version):
C:\OCaml32\bin
C:\OCaml32\usr\i686-w64-mingw32\sys-root\mingw\bin
C:\OCaml32\home\nadako\.opam\4.02.3+mingw32c\bin
C:\OCaml32\usr\local\bin
Add new env variables (actual paths may differ depending on your install path, username, and OCaml version):
OCAML_TOPLEVEL_PATH=C:\OCaml32\home\nadako\.opam\4.02.3+mingw32c\lib\toplevel
OCAMLLIB=C:\OCaml32\home\nadako\.opam\4.02.3+mingw32c\lib\ocaml
I couldn't get opam
itself running through cmd/powershell because it needs some more environment that's inited in .bashrc
, but I think installing opam packages from within Cygwin terminal is acceptable.
make ADD_REVISION=1 -f Makefile.win
Interrupt/Exception caught (code = 0xc00000fd, addr = 0x4227d3
, this helps: http://hdrlab.org.nz/articles/windows-development/make-interrupt-exception-caught-code-0xc00000fd-addr-0x4217b/
TL;DR: put the environment variables at the start of your PATH, not at the end.where make
. It should print out the path of the command that will execute (should be C:\OCaml32\bin\make.exe
).su -
pkg install ocaml ocaml-camlp4 ocaml-findlib pcre gmake git neko
cd ~ && git clone --recursive https://github.com/HaxeFoundation/haxe.git
cd haxe && gmake "CFLAGS=-I /usr/local/include/"
su -
followed by cd /home/username/haxe && gmake install
If you want to update, it's usually enough to just recompile the compiler by updating your checkout using git pull
followed by issueing the command gmake haxe
.