Skip to content

Commit

Permalink
[make] Generate haxelib binary with nekotools boot -c on Mac/Linux
Browse files Browse the repository at this point in the history
`nekotools boot` is a bit of a hack and some tools that deal with executables on linux can strip away the haxelib bytecode if it is done this way.

`nekotools boot -c` will generate a .c file which can then be compiled manually.
  • Loading branch information
tobil4sk committed May 3, 2024
1 parent 0adc110 commit cc54d0a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,11 @@ copy_haxetoolkit: /cygdrive/c/HaxeToolkit/haxe/haxe.exe
endif

# haxelib should depends on haxe, but we don't want to do that...
haxelib:
(cd $(CURDIR)/extra/haxelib_src && $(CURDIR)/$(HAXE_OUTPUT) client.hxml && nekotools boot run.n)
mv extra/haxelib_src/run$(EXTENSION) $(HAXELIB_OUTPUT)
haxelib_unix:
(cd $(CURDIR)/extra/haxelib_src && $(CURDIR)/$(HAXE_OUTPUT) client.hxml && nekotools boot -c run.n)
${CC} $(CURDIR)/extra/haxelib_src/run.c -o $(HAXELIB_OUTPUT) -lneko

haxelib: haxelib_$(PLATFORM)

tools: haxelib

Expand Down
5 changes: 5 additions & 0 deletions Makefile.win
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ PACKAGE_FILES=$(HAXE_OUTPUT) $(HAXELIB_OUTPUT) std \
"$$(cygcheck $(CURDIR)/$(HAXE_OUTPUT) | grep libmbedtls.dll | sed -e 's/^\s*//')" \
"$$(cygcheck $(CURDIR)/$(HAXE_OUTPUT) | grep libmbedx509.dll | sed -e 's/^\s*//')"

# haxelib should depends on haxe, but we don't want to do that...
haxelib_win:
(cd $(CURDIR)/extra/haxelib_src && $(CURDIR)/$(HAXE_OUTPUT) client.hxml && nekotools boot run.n)
mv extra/haxelib_src/run$(EXTENSION) $(HAXELIB_OUTPUT)

echo_package_files:
echo $(PACKAGE_FILES)

Expand Down

0 comments on commit cc54d0a

Please sign in to comment.