File tree Expand file tree Collapse file tree 2 files changed +28
-3
lines changed
Expand file tree Collapse file tree 2 files changed +28
-3
lines changed Original file line number Diff line number Diff line change 3838 gcc -static -o dist/moon -Ilua-${{ matrix.lua_version }}/src/ bin/binaries/moon.c lpeg-1.0.2/lpvm.c lpeg-1.0.2/lpcap.c lpeg-1.0.2/lptree.c lpeg-1.0.2/lpcode.c lpeg-1.0.2/lpprint.c lua-${{ matrix.lua_version }}/src/liblua.a -lm -ldl
3939
4040 - name : Test run
41- run : dist/moon -e 'print "hello world"'
41+ run : |
42+ dist/moon -h
43+ dist/moon -e 'print "hello world"'
4244
4345 - name : Upload artifact
4446 uses : actions/upload-artifact@v6
8587 gcc -static -o dist/moon.exe -Ilua-${{ matrix.lua_version }}/src/ bin/binaries/moon.c lpeg-1.0.2/lpvm.c lpeg-1.0.2/lpcap.c lpeg-1.0.2/lptree.c lpeg-1.0.2/lpcode.c lpeg-1.0.2/lpprint.c lua-${{ matrix.lua_version }}/src/liblua.a -lm
8688
8789 - name : Test run
88- run : dist/moon.exe -e 'print "hello world"'
90+ run : |
91+ dist/moon.exe -h
92+ dist/moon.exe -e 'print "hello world"'
8993
9094 - name : Upload artifact
9195 uses : actions/upload-artifact@v6
Original file line number Diff line number Diff line change @@ -4,7 +4,10 @@ LUAROCKS = luarocks --lua-version=$(LUA_VERSION)
44LUA_PATH_MAKE = $(shell $(LUAROCKS ) path --lr-path) ;./?.lua;./?/init.lua
55LUA_CPATH_MAKE = $(shell $(LUAROCKS ) path --lr-cpath) ;./?.so
66
7- .PHONY : test local build watch lint count show
7+ LUA_SRC_VERSION ?= 5.1.5
8+ LPEG_VERSION ?= 1.0.2
9+
10+ .PHONY : test local build watch lint count show test_binary
811
912build :
1013 LUA_PATH=' $(LUA_PATH_MAKE)' LUA_CPATH=' $(LUA_CPATH_MAKE)' $(LUA ) bin/moonc moon/ moonscript/
4447
4548count :
4649 wc -l $$(git ls-files | grep 'moon$$' ) | sort -n | tail
50+
51+ # Binary build targets for local verification (Linux only)
52+ lua-$(LUA_SRC_VERSION ) /src/liblua.a :
53+ curl -L -O https://www.lua.org/ftp/lua-$(LUA_SRC_VERSION ) .tar.gz
54+ tar -xzf lua-$(LUA_SRC_VERSION ) .tar.gz
55+ cd lua-$(LUA_SRC_VERSION ) /src && make liblua.a MYCFLAGS=-DLUA_USE_POSIX
56+
57+ lpeg-$(LPEG_VERSION ) /lptree.c :
58+ curl -L -o lpeg.tar.gz https://www.inf.puc-rio.br/~roberto/lpeg/lpeg-$(LPEG_VERSION ) .tar.gz
59+ tar -xzf lpeg.tar.gz
60+
61+ dist/moon : lua-$(LUA_SRC_VERSION ) /src/liblua.a lpeg-$(LPEG_VERSION ) /lptree.c
62+ mkdir -p dist
63+ gcc -static -o dist/moon -Ilua-$(LUA_SRC_VERSION ) /src/ bin/binaries/moon.c lpeg-$(LPEG_VERSION ) /lpvm.c lpeg-$(LPEG_VERSION ) /lpcap.c lpeg-$(LPEG_VERSION ) /lptree.c lpeg-$(LPEG_VERSION ) /lpcode.c lpeg-$(LPEG_VERSION ) /lpprint.c lua-$(LUA_SRC_VERSION ) /src/liblua.a -lm -ldl
64+
65+ test_binary : dist/moon
66+ dist/moon -h
67+ dist/moon -e ' print "hello world"'
You can’t perform that action at this time.
0 commit comments