forked from sctb/lumen
-
Notifications
You must be signed in to change notification settings - Fork 2
/
make.bat
65 lines (56 loc) · 1.51 KB
/
make.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
@ECHO off
@SET LUMEN_HOME=%~dp0
IF NOT "x%1" == "x" GOTO :%1
:all
CALL make bundle
if %errorlevel% neq 0 goto error
GOTO :end
:clean
set LUMEN_CWD=%CD%
cd "%LUMEN_HOME%bin"
IF EXIST lumen-language DEL /F /Q lumen-language
IF EXIST lumen-language.exe DEL /F /Q lumen-language.exe
IF EXIST lumen-node.exe DEL /F /Q lumen-node.exe
cd "%LUMEN_CWD%"
GOTO :end
:bundle
set LUMEN_ERROR=0
set LUMEN_CWD=%CD%
cd "%LUMEN_HOME%"
IF NOT EXIST bin\lumen-language.exe CALL npx luvit-luvi . -o bin\lumen-language.exe
if %errorlevel% neq 0 set LUMEN_ERROR=%errorlevel%
IF NOT EXIST bin\lumen-node.exe CALL npx pkg index.js -t win -o bin\lumen-node.exe
if %errorlevel% neq 0 set LUMEN_ERROR=%errorlevel%
cd "%LUMEN_HOME%bin"
IF NOT EXIST lumen-language CALL mklink /H lumen-language lumen-language.exe
if %errorlevel% neq 0 set LUMEN_ERROR=%errorlevel%
cd "%LUMEN_CWD%"
set errorlevel=%LUMEN_ERROR%
if %errorlevel% neq 0 goto error
GOTO :end
:test
CALL make all
set LUMEN_ERROR=0
ECHO node:
CALL "%LUEMN_HOME%bin\lumen-node" "%LUMEN_HOME%test.l"
if %errorlevel% neq 0 set LUMEN_ERROR=%errorlevel%
ECHO luvi:
SET LUA_PATH=%LUMEN_HOME%bin\?.lua;;%LUA_PATH%
CALL "%LUEMN_HOME%bin\lumen-language" "%LUMEN_HOME%test.l"
if %errorlevel% neq 0 set LUMEN_ERROR=%errorlevel%
set errorlevel=%LUMEN_ERROR%
if %errorlevel% neq 0 goto error
GOTO :end
:-B
:rebuild
CALL make clean
CALL make all
CALL make test
GOTO :end
:bootstrap
CALL make bundle
CALL make test
GOTO :end
:error
exit /b %errorlevel%
:end