diff options
-rw-r--r-- | src/ps4build.bat | 32 |
1 files changed, 26 insertions, 6 deletions
diff --git a/src/ps4build.bat b/src/ps4build.bat index 337a44fa..e4a7defe 100644 --- a/src/ps4build.bat +++ b/src/ps4build.bat | |||
@@ -2,7 +2,19 @@ | |||
2 | @rem Donated to the public domain. | 2 | @rem Donated to the public domain. |
3 | @rem | 3 | @rem |
4 | @rem Open a "Visual Studio .NET Command Prompt" (64 bit host compiler) | 4 | @rem Open a "Visual Studio .NET Command Prompt" (64 bit host compiler) |
5 | @rem or "VS2015 x64 Native Tools Command Prompt". | ||
6 | @rem | ||
5 | @rem Then cd to this directory and run this script. | 7 | @rem Then cd to this directory and run this script. |
8 | @rem | ||
9 | @rem Recommended invocation: | ||
10 | @rem | ||
11 | @rem ps4build release build, amalgamated, 64-bit GC | ||
12 | @rem ps4build debug debug build, amalgamated, 64-bit GC | ||
13 | @rem | ||
14 | @rem Additional command-line options (not generally recommended): | ||
15 | @rem | ||
16 | @rem gc32 (before debug) 32-bit GC | ||
17 | @rem noamalg (after debug) non-amalgamated build | ||
6 | 18 | ||
7 | @if not defined INCLUDE goto :FAIL | 19 | @if not defined INCLUDE goto :FAIL |
8 | @if not defined SCE_ORBIS_SDK_DIR goto :FAIL | 20 | @if not defined SCE_ORBIS_SDK_DIR goto :FAIL |
@@ -15,6 +27,14 @@ | |||
15 | @set DASMDIR=..\dynasm | 27 | @set DASMDIR=..\dynasm |
16 | @set DASM=%DASMDIR%\dynasm.lua | 28 | @set DASM=%DASMDIR%\dynasm.lua |
17 | @set ALL_LIB=lib_base.c lib_math.c lib_bit.c lib_string.c lib_table.c lib_io.c lib_os.c lib_package.c lib_debug.c lib_jit.c lib_ffi.c | 29 | @set ALL_LIB=lib_base.c lib_math.c lib_bit.c lib_string.c lib_table.c lib_io.c lib_os.c lib_package.c lib_debug.c lib_jit.c lib_ffi.c |
30 | @set GC64=-DLUAJIT_ENABLE_GC64 | ||
31 | @set DASC=vm_x64.dasc | ||
32 | |||
33 | @if "%1" neq "gc32" goto :NOGC32 | ||
34 | @shift | ||
35 | @set GC64= | ||
36 | @set DASC=vm_x86.dasc | ||
37 | :NOGC32 | ||
18 | 38 | ||
19 | %LJCOMPILE% host\minilua.c | 39 | %LJCOMPILE% host\minilua.c |
20 | @if errorlevel 1 goto :BAD | 40 | @if errorlevel 1 goto :BAD |
@@ -28,10 +48,10 @@ if exist minilua.exe.manifest^ | |||
28 | @if not errorlevel 8 goto :FAIL | 48 | @if not errorlevel 8 goto :FAIL |
29 | 49 | ||
30 | @set DASMFLAGS=-D P64 -D NO_UNWIND | 50 | @set DASMFLAGS=-D P64 -D NO_UNWIND |
31 | minilua %DASM% -LN %DASMFLAGS% -o host\buildvm_arch.h vm_x86.dasc | 51 | minilua %DASM% -LN %DASMFLAGS% -o host\buildvm_arch.h %DASC% |
32 | @if errorlevel 1 goto :BAD | 52 | @if errorlevel 1 goto :BAD |
33 | 53 | ||
34 | %LJCOMPILE% /I "." /I %DASMDIR% -DLUAJIT_TARGET=LUAJIT_ARCH_X64 -DLUAJIT_OS=LUAJIT_OS_OTHER -DLUAJIT_DISABLE_JIT -DLUAJIT_DISABLE_FFI -DLUAJIT_NO_UNWIND host\buildvm*.c | 54 | %LJCOMPILE% /I "." /I %DASMDIR% %GC64% -DLUAJIT_TARGET=LUAJIT_ARCH_X64 -DLUAJIT_OS=LUAJIT_OS_OTHER -DLUAJIT_DISABLE_JIT -DLUAJIT_DISABLE_FFI -DLUAJIT_NO_UNWIND host\buildvm*.c |
35 | @if errorlevel 1 goto :BAD | 55 | @if errorlevel 1 goto :BAD |
36 | %LJLINK% /out:buildvm.exe buildvm*.obj | 56 | %LJLINK% /out:buildvm.exe buildvm*.obj |
37 | @if errorlevel 1 goto :BAD | 57 | @if errorlevel 1 goto :BAD |
@@ -54,7 +74,7 @@ buildvm -m folddef -o lj_folddef.h lj_opt_fold.c | |||
54 | @if errorlevel 1 goto :BAD | 74 | @if errorlevel 1 goto :BAD |
55 | 75 | ||
56 | @rem ---- Cross compiler ---- | 76 | @rem ---- Cross compiler ---- |
57 | @set LJCOMPILE="%SCE_ORBIS_SDK_DIR%\host_tools\bin\orbis-clang" -c -Wall -DLUAJIT_DISABLE_FFI | 77 | @set LJCOMPILE="%SCE_ORBIS_SDK_DIR%\host_tools\bin\orbis-clang" -c -Wall -DLUAJIT_DISABLE_FFI %GC64% |
58 | @set LJLIB="%SCE_ORBIS_SDK_DIR%\host_tools\bin\orbis-ar" rcus | 78 | @set LJLIB="%SCE_ORBIS_SDK_DIR%\host_tools\bin\orbis-ar" rcus |
59 | @set INCLUDE="" | 79 | @set INCLUDE="" |
60 | 80 | ||
@@ -63,14 +83,14 @@ orbis-as -o lj_vm.o lj_vm.s | |||
63 | @if "%1" neq "debug" goto :NODEBUG | 83 | @if "%1" neq "debug" goto :NODEBUG |
64 | @shift | 84 | @shift |
65 | @set LJCOMPILE=%LJCOMPILE% -g -O0 | 85 | @set LJCOMPILE=%LJCOMPILE% -g -O0 |
66 | @set TARGETLIB=libluajitD.a | 86 | @set TARGETLIB=libluajitD_ps4.a |
67 | goto :BUILD | 87 | goto :BUILD |
68 | :NODEBUG | 88 | :NODEBUG |
69 | @set LJCOMPILE=%LJCOMPILE% -O2 | 89 | @set LJCOMPILE=%LJCOMPILE% -O2 |
70 | @set TARGETLIB=libluajit.a | 90 | @set TARGETLIB=libluajit_ps4.a |
71 | :BUILD | 91 | :BUILD |
72 | del %TARGETLIB% | 92 | del %TARGETLIB% |
73 | @if "%1"=="amalg" goto :AMALG | 93 | @if "%1" neq "noamalg" goto :AMALG |
74 | for %%f in (lj_*.c lib_*.c) do ( | 94 | for %%f in (lj_*.c lib_*.c) do ( |
75 | %LJCOMPILE% %%f | 95 | %LJCOMPILE% %%f |
76 | @if errorlevel 1 goto :BAD | 96 | @if errorlevel 1 goto :BAD |