aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMike Pall <mike>2011-06-29 19:26:31 +0200
committerMike Pall <mike>2011-06-29 19:26:31 +0200
commit8ccf89718c2aedabcc5009db1d372574e802966e (patch)
tree3c0150ecee6986f7bcfcd443759dea6ef906802e /src
parent0af502f43877cddbb60aca4d1446a3634607143d (diff)
downloadluajit-8ccf89718c2aedabcc5009db1d372574e802966e.tar.gz
luajit-8ccf89718c2aedabcc5009db1d372574e802966e.tar.bz2
luajit-8ccf89718c2aedabcc5009db1d372574e802966e.zip
Add debug option to msvcbuild.bat and improve error handling.
Diffstat (limited to 'src')
-rw-r--r--src/msvcbuild.bat34
1 files changed, 33 insertions, 1 deletions
diff --git a/src/msvcbuild.bat b/src/msvcbuild.bat
index cd182362..c7e5df66 100644
--- a/src/msvcbuild.bat
+++ b/src/msvcbuild.bat
@@ -24,46 +24,78 @@
24 24
25if not exist buildvm_x86.h^ 25if not exist buildvm_x86.h^
26 %DASM% -LN -o buildvm_x86.h buildvm_x86.dasc 26 %DASM% -LN -o buildvm_x86.h buildvm_x86.dasc
27@if errorlevel 1 goto :BAD
27if not exist buildvm_x64win.h^ 28if not exist buildvm_x64win.h^
28 %DASM% -LN -D X64 -D X64WIN -o buildvm_x64win.h buildvm_x86.dasc 29 %DASM% -LN -D X64 -D X64WIN -o buildvm_x64win.h buildvm_x86.dasc
30@if errorlevel 1 goto :BAD
29 31
30%LJCOMPILE% /I "." /I %DASMDIR% buildvm*.c 32%LJCOMPILE% /I "." /I %DASMDIR% buildvm*.c
33@if errorlevel 1 goto :BAD
31%LJLINK% /out:buildvm.exe buildvm*.obj 34%LJLINK% /out:buildvm.exe buildvm*.obj
35@if errorlevel 1 goto :BAD
32if exist buildvm.exe.manifest^ 36if exist buildvm.exe.manifest^
33 %LJMT% -manifest buildvm.exe.manifest -outputresource:buildvm.exe 37 %LJMT% -manifest buildvm.exe.manifest -outputresource:buildvm.exe
34 38
35buildvm -m peobj -o lj_vm.obj 39buildvm -m peobj -o lj_vm.obj
40@if errorlevel 1 goto :BAD
36buildvm -m bcdef -o lj_bcdef.h %ALL_LIB% 41buildvm -m bcdef -o lj_bcdef.h %ALL_LIB%
42@if errorlevel 1 goto :BAD
37buildvm -m ffdef -o lj_ffdef.h %ALL_LIB% 43buildvm -m ffdef -o lj_ffdef.h %ALL_LIB%
44@if errorlevel 1 goto :BAD
38buildvm -m libdef -o lj_libdef.h %ALL_LIB% 45buildvm -m libdef -o lj_libdef.h %ALL_LIB%
46@if errorlevel 1 goto :BAD
39buildvm -m recdef -o lj_recdef.h %ALL_LIB% 47buildvm -m recdef -o lj_recdef.h %ALL_LIB%
48@if errorlevel 1 goto :BAD
40buildvm -m vmdef -o ..\lib\vmdef.lua %ALL_LIB% 49buildvm -m vmdef -o ..\lib\vmdef.lua %ALL_LIB%
50@if errorlevel 1 goto :BAD
41buildvm -m folddef -o lj_folddef.h lj_opt_fold.c 51buildvm -m folddef -o lj_folddef.h lj_opt_fold.c
52@if errorlevel 1 goto :BAD
42 53
54@if "%1" neq "debug" goto :NODEBUG
55@shift
56@set LJCOMPILE=%LJCOMPILE% /Zi /Fdluajit.pdb
57@set LJLINK=%LJLINK% /debug /PDB:luajit.pdb
58:NODEBUG
43@if "%1"=="amalg" goto :AMALGDLL 59@if "%1"=="amalg" goto :AMALGDLL
44@if "%1"=="static" goto :STATIC 60@if "%1"=="static" goto :STATIC
45%LJCOMPILE% /DLUA_BUILD_AS_DLL lj_*.c lib_*.c 61%LJCOMPILE% /DLUA_BUILD_AS_DLL lj_*.c lib_*.c
62@if errorlevel 1 goto :BAD
46%LJLINK% /DLL /out:lua51.dll lj_*.obj lib_*.obj 63%LJLINK% /DLL /out:lua51.dll lj_*.obj lib_*.obj
64@if errorlevel 1 goto :BAD
47@goto :MTDLL 65@goto :MTDLL
48:STATIC 66:STATIC
49%LJCOMPILE% /DLUA_BUILD_AS_DLL lj_*.c lib_*.c 67%LJCOMPILE% /DLUA_BUILD_AS_DLL lj_*.c lib_*.c
68@if errorlevel 1 goto :BAD
50%LJLIB% /OUT:lua51.lib lj_*.obj lib_*.obj 69%LJLIB% /OUT:lua51.lib lj_*.obj lib_*.obj
70@if errorlevel 1 goto :BAD
51@goto :MTDLL 71@goto :MTDLL
52:AMALGDLL 72:AMALGDLL
53%LJCOMPILE% /DLUA_BUILD_AS_DLL ljamalg.c 73%LJCOMPILE% /DLUA_BUILD_AS_DLL ljamalg.c
74@if errorlevel 1 goto :BAD
54%LJLINK% /DLL /out:lua51.dll ljamalg.obj lj_vm.obj 75%LJLINK% /DLL /out:lua51.dll ljamalg.obj lj_vm.obj
76@if errorlevel 1 goto :BAD
55:MTDLL 77:MTDLL
56if exist lua51.dll.manifest^ 78if exist lua51.dll.manifest^
57 %LJMT% -manifest lua51.dll.manifest -outputresource:lua51.dll;2 79 %LJMT% -manifest lua51.dll.manifest -outputresource:lua51.dll;2
58 80
59%LJCOMPILE% luajit.c 81%LJCOMPILE% luajit.c
82@if errorlevel 1 goto :BAD
60%LJLINK% /out:luajit.exe luajit.obj lua51.lib 83%LJLINK% /out:luajit.exe luajit.obj lua51.lib
84@if errorlevel 1 goto :BAD
61if exist luajit.exe.manifest^ 85if exist luajit.exe.manifest^
62 %LJMT% -manifest luajit.exe.manifest -outputresource:luajit.exe 86 %LJMT% -manifest luajit.exe.manifest -outputresource:luajit.exe
63 87
64del *.obj *.manifest buildvm.exe 88@del *.obj *.manifest buildvm.exe
89@echo.
90@echo === Successfully built LuaJIT ===
65 91
66@goto :END 92@goto :END
93:BAD
94@echo.
95@echo *******************************************************
96@echo *** Build FAILED -- Please check the error messages ***
97@echo *******************************************************
98@goto :END
67:FAIL 99:FAIL
68@echo You must open a "Visual Studio .NET Command Prompt" to run this script 100@echo You must open a "Visual Studio .NET Command Prompt" to run this script
69:END 101:END