summaryrefslogtreecommitdiff
path: root/src/msvcbuild.bat
diff options
context:
space:
mode:
authorMike Pall <mike>2009-12-08 19:46:35 +0100
committerMike Pall <mike>2009-12-08 19:46:35 +0100
commit55b16959717084884fd4a0cbae6d19e3786c20c7 (patch)
treec8a07a43c13679751ed25a9d06796e9e7b2134a6 /src/msvcbuild.bat
downloadluajit-2.0.0-beta1.tar.gz
luajit-2.0.0-beta1.tar.bz2
luajit-2.0.0-beta1.zip
RELEASE LuaJIT-2.0.0-beta1v2.0.0-beta1
Diffstat (limited to 'src/msvcbuild.bat')
-rw-r--r--src/msvcbuild.bat53
1 files changed, 53 insertions, 0 deletions
diff --git a/src/msvcbuild.bat b/src/msvcbuild.bat
new file mode 100644
index 00000000..8bdc4d8a
--- /dev/null
+++ b/src/msvcbuild.bat
@@ -0,0 +1,53 @@
1@rem Script to build LuaJIT with MSVC.
2@rem Copyright (C) 2005-2009 Mike Pall. See Copyright Notice in luajit.h
3@rem
4@rem Open a "Visual Studio .NET Command Prompt", cd to this directory
5@rem and run this script.
6
7@if not defined INCLUDE goto :FAIL
8
9@setlocal
10@set LJCOMPILE=cl /nologo /c /MD /O2 /W3 /D_CRT_SECURE_NO_DEPRECATE
11@set LJLINK=link /nologo
12@set LJMT=mt /nologo
13@set DASMDIR=..\dynasm
14@set DASM=lua %DASMDIR%\dynasm.lua
15@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
16
17if not exist buildvm_x86.h^
18 %DASM% -LN -o buildvm_x86.h buildvm_x86.dasc
19
20%LJCOMPILE% /I "." /I %DASMDIR% buildvm*.c
21%LJLINK% /out:buildvm.exe buildvm*.obj
22if exist buildvm.exe.manifest^
23 %LJMT% -manifest buildvm.exe.manifest -outputresource:buildvm.exe
24
25buildvm -m peobj -o lj_vm.obj
26buildvm -m ffdef -o lj_ffdef.h %ALL_LIB%
27buildvm -m libdef -o lj_libdef.h %ALL_LIB%
28buildvm -m recdef -o lj_recdef.h %ALL_LIB%
29buildvm -m vmdef -o ..\lib\vmdef.lua %ALL_LIB%
30buildvm -m folddef -o lj_folddef.h lj_opt_fold.c
31
32@if "%1"=="amalg" goto :AMALGDLL
33%LJCOMPILE% /DLUA_BUILD_AS_DLL lj_*.c lib_*.c
34%LJLINK% /DLL /out:lua51.dll lj_*.obj lib_*.obj
35@goto :MTDLL
36:AMALGDLL
37%LJCOMPILE% /DLUA_BUILD_AS_DLL ljamalg.c
38%LJLINK% /DLL /out:lua51.dll ljamalg.obj lj_vm.obj
39:MTDLL
40if exist lua51.dll.manifest^
41 %LJMT% -manifest lua51.dll.manifest -outputresource:lua51.dll;2
42
43%LJCOMPILE% luajit.c
44%LJLINK% /out:luajit.exe luajit.obj lua51.lib
45if exist luajit.exe.manifest^
46 %LJMT% -manifest luajit.exe.manifest -outputresource:luajit.exe
47
48del *.obj *.manifest buildvm.exe
49
50@goto :END
51:FAIL
52@echo You must open a "Visual Studio .NET Command Prompt" to run this script
53:END