Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto-generate defines and metas from JSON files #8195

Merged
merged 19 commits into from
May 23, 2019
Merged
Show file tree
Hide file tree
Changes from 17 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
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ install_linux: &install_linux
# Build haxe
- make package_src -s
- opam config exec -- make -s STATICLINK=1 libs
- opam config exec -- make -s STATICLINK=1 prebuild
- opam config exec -- make -s -j STATICLINK=1 haxe
- opam config exec -- make -s haxelib
- make package_bin -s
Expand Down Expand Up @@ -140,6 +141,7 @@ install_osx: &install_osx
- ocamlopt -v
# Build haxe
- make -s STATICLINK=1 "LIB_PARAMS=/usr/local/opt/zlib/lib/libz.a /usr/local/lib/libpcre.a" libs
- make -s STATICLINK=1 "LIB_PARAMS=/usr/local/opt/zlib/lib/libz.a /usr/local/lib/libpcre.a" prebuild
- make -s -j STATICLINK=1 "LIB_PARAMS=/usr/local/opt/zlib/lib/libz.a /usr/local/lib/libpcre.a" haxe
- make -s haxelib
- make package_bin -s
Expand Down
18 changes: 14 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ MAKEFILENAME?=Makefile
PLATFORM?=unix

OUTPUT=haxe
PREBUILD_OUTPUT=prebuild
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it should be added to .gitignore

EXTENSION=
LFLAGS=
STATICLINK?=0
Expand Down Expand Up @@ -130,7 +131,16 @@ else
echo let version_extra = None > _build/src/compiler/version.ml
endif

build_src: | $(BUILD_SRC) _build/src/syntax/grammar.ml _build/src/compiler/version.ml
_build/src/core/defineList.ml: src-json/define.json prebuild
./$(PREBUILD_OUTPUT) define $< > $@

_build/src/core/metaList.ml: src-json/meta.json prebuild
./$(PREBUILD_OUTPUT) meta $< > $@

build_src: | $(BUILD_SRC) _build/src/syntax/grammar.ml _build/src/compiler/version.ml _build/src/core/defineList.ml _build/src/core/metaList.ml

prebuild: _build/src/core/json/json.ml _build/src/prebuild/main.ml
$(COMPILER) -safe-string -linkpkg -g -o $(PREBUILD_OUTPUT) -package sedlex -package extlib -I _build/src/core/json _build/src/core/json/json.ml _build/src/prebuild/main.ml

haxe: build_src
$(MAKE) -f $(MAKEFILENAME) build_pass_1
Expand Down Expand Up @@ -297,10 +307,10 @@ clean_libs:
$(foreach lib,$(EXTLIB_LIBS),$(MAKE) -C libs/$(lib) clean &&) true

clean_haxe:
rm -f -r _build $(OUTPUT)
rm -f -r _build $(OUTPUT) $(PREBUILD_OUTPUT)

clean_tools:
rm -f $(OUTPUT) haxelib
rm -f $(OUTPUT) $(PREBUILD_OUTPUT) haxelib

clean_package:
rm -rf $(PACKAGE_OUT_DIR)
Expand All @@ -315,4 +325,4 @@ FORCE:
.ml.cmo:
$(CC_CMD)

.PHONY: haxe libs haxelib
.PHONY: prebuild haxe libs haxelib
1 change: 1 addition & 0 deletions Makefile.win
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ PLATFORM=win
MAKEFILENAME=Makefile.win
include Makefile
OUTPUT=haxe.exe
PREBUILD_OUTPUT=prebuild.exe
EXTENSION=.exe
PACKAGE_SRC_EXTENSION=.zip

Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ install:

build_script:
- 'cd %APPVEYOR_BUILD_FOLDER%'
- '%CYG_ROOT%/bin/bash -lc "cd \"$OLDPWD\" && make -s -f Makefile.win libs && make -j -s -f Makefile.win haxe && make -s -f Makefile.win haxelib"'
- '%CYG_ROOT%/bin/bash -lc "cd \"$OLDPWD\" && make -s -f Makefile.win libs && make -s -f Makefile.win prebuild && make -j -s -f Makefile.win haxe && make -s -f Makefile.win haxelib"'
- 'set PATH=%PATH%;%APPVEYOR_BUILD_FOLDER%'
- 'set HAXEPATH=%APPVEYOR_BUILD_FOLDER%'
- '%CYG_ROOT%/bin/bash -lc "cd \"$OLDPWD\" && cygcheck haxe.exe"'
Expand Down
Loading