Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

/src/version.ml
/haxe
/haxe.debug
/haxelib*
/haxedoc*
/lib
Expand Down
10 changes: 7 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ haxe:
dune build --profile release src/haxe.exe
cp -f _build/default/src/haxe.exe ./"$(HAXE_OUTPUT)"

haxe.debug:
dune build src/haxe.bc
cp -f _build/default/src/haxe.bc ./"$(HAXE_OUTPUT).debug"

plugin: haxe
$(DUNE_COMMAND) build --profile release plugins/$(PLUGIN)/$(PLUGIN).cmxs
mkdir -p plugins/$(PLUGIN)/cmxs/$(SYSTEM_NAME)
Expand Down Expand Up @@ -238,10 +242,10 @@ package_installer_mac: $(INSTALLER_TMP_DIR)/neko-osx.tar.gz package_unix
clean: clean_haxe clean_tools clean_package

clean_haxe:
rm -f -r _build $(HAXE_OUTPUT) $(PREBUILD_OUTPUT)
rm -f -r _build $(HAXE_OUTPUT) $(HAXE_OUTPUT).debug $(PREBUILD_OUTPUT)

clean_tools:
rm -f $(HAXE_OUTPUT) $(PREBUILD_OUTPUT) $(HAXELIB_OUTPUT)
rm -f $(HAXE_OUTPUT) $(PREBUILD_OUTPUT) $(HAXE_OUTPUT).debug $(HAXELIB_OUTPUT)

clean_package:
rm -rf $(PACKAGE_OUT_DIR)
Expand All @@ -256,7 +260,7 @@ FORCE:
.ml.cmo:
$(CC_CMD)

.PHONY: haxe haxelib
.PHONY: haxe haxe.debug haxelib

# our "all:" target doens't work in parallel mode
.NOTPARALLEL:
36 changes: 36 additions & 0 deletions extra/DEBUG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
Run
```
make haxe.debug
```

Set the following environment variables before calling `ocamldebug`.
```
export LD_PRELOAD=$(pkg-config --variable=libdir libuv)/libuv.so
export HAXE_STD_PATH=/path/to/haxe/std
export CAML_LD_LIBRARY_PATH=/path/to/haxe/_build/default/libs/pcre2:/path/to/haxe/_build/default/libs/mbedtls:/path/to/haxe/_build/default/libs/extc:/path/to/haxe/_build/default/libs/extc:/path/to/haxe/_build/default/libs/objsize:$CAML_LD_LIBRARY_PATH
```

If the last one doesn't take, add it as a prefix to `ocamldebug`.
Add the following commands to your `.ocamldebug`, or run them first when starting it.
```
directory /path/to/haxe/_build/default/
directory /path/to/haxe/_build/default/src/.haxe.eobjs/byte
directory /path/to/haxe/_build/default/src/.haxe.objs/byte
directory /path/to/haxe/_build/default/libs/extc/.extc.objs/byte
directory /path/to/haxe/_build/default/libs/extc/.extproc.objs/byte
directory /path/to/haxe/_build/default/libs/extlib-leftovers/.extlib_leftovers.objs/byte
directory /path/to/haxe/_build/default/libs/ilib/.ilib.objs/byte
directory /path/to/haxe/_build/default/libs/javalib/.javalib.objs/byte
directory /path/to/haxe/_build/default/libs/json/.json.objs/byte
directory /path/to/haxe/_build/default/libs/mbedtls/.mbedtls.objs/byte
directory /path/to/haxe/_build/default/libs/neko/.neko.objs/byte
directory /path/to/haxe/_build/default/libs/objsize/.objsize.objs/byte
directory /path/to/haxe/_build/default/libs/pcre2/.pcre2.objs/byte
directory /path/to/haxe/_build/default/libs/swflib/.swflib.objs/byte
directory /path/to/haxe/_build/default/libs/ttflib/.ttflib.objs/byte
directory /path/to/haxe/_build/default/libs/ziplib/.ziplib.objs/byte
```


Tips:
On Unix use `rlwrap ocamldebug /path/to/haxe.debug <base.hxml>` for sensible QOL.
1 change: 1 addition & 0 deletions libs/extc/dune
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
(foreign_stubs
(language c)
(names extc_stubs))
(c_library_flags -lz)
(modules extc)
(wrapped false)
)
Expand Down
1 change: 1 addition & 0 deletions libs/mbedtls/dune
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@
(foreign_stubs
(language c)
(names mbedtls_stubs))
(c_library_flags -lmbedtls -lmbedx509 -lmbedcrypto)
(wrapped false)
)
1 change: 1 addition & 0 deletions libs/pcre2/dune
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@
(foreign_stubs
(language c)
(names pcre2_stubs))
(c_library_flags -lpcre2-8)
(wrapped false)
)
1 change: 0 additions & 1 deletion src/context/abstractCast.ml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
open Globals
open Common
open Ast
open Type
open Typecore
Expand Down
3 changes: 1 addition & 2 deletions src/dune
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,5 @@
(libraries haxe)
(modules haxe)
(link_flags (:include libs.sexp))
; Uncomment to enable bytecode output for ocamldebug support
; (modes byte)
(modes byte native)
)