1 @rem Script to build LuaJIT with MSVC.
\r
2 @rem Copyright (C) 2005-2009 Mike Pall. See Copyright Notice in luajit.h
\r
4 @rem Open a "Visual Studio .NET Command Prompt", cd to this directory
\r
5 @rem and run this script.
\r
7 @if not defined INCLUDE goto :FAIL
\r
10 @set LJCOMPILE=cl /nologo /c /MD /O2 /W3 /D_CRT_SECURE_NO_DEPRECATE
\r
11 @set LJLINK=link /nologo
\r
12 @set LJMT=mt /nologo
\r
13 @set DASMDIR=..\dynasm
\r
14 @set DASM=lua %DASMDIR%\dynasm.lua
\r
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
\r
17 if not exist buildvm_x86.h^
\r
18 %DASM% -LN -o buildvm_x86.h buildvm_x86.dasc
\r
20 %LJCOMPILE% /I "." /I %DASMDIR% buildvm*.c
\r
21 %LJLINK% /out:buildvm.exe buildvm*.obj
\r
22 if exist buildvm.exe.manifest^
\r
23 %LJMT% -manifest buildvm.exe.manifest -outputresource:buildvm.exe
\r
25 buildvm -m peobj -o lj_vm.obj
\r
26 buildvm -m ffdef -o lj_ffdef.h %ALL_LIB%
\r
27 buildvm -m libdef -o lj_libdef.h %ALL_LIB%
\r
28 buildvm -m recdef -o lj_recdef.h %ALL_LIB%
\r
29 buildvm -m vmdef -o ..\lib\vmdef.lua %ALL_LIB%
\r
30 buildvm -m folddef -o lj_folddef.h lj_opt_fold.c
\r
32 @if "%1"=="amalg" goto :AMALGDLL
\r
33 %LJCOMPILE% /DLUA_BUILD_AS_DLL lj_*.c lib_*.c
\r
34 %LJLINK% /DLL /out:lua51.dll lj_*.obj lib_*.obj
\r
37 %LJCOMPILE% /DLUA_BUILD_AS_DLL ljamalg.c
\r
38 %LJLINK% /DLL /out:lua51.dll ljamalg.obj lj_vm.obj
\r
40 if exist lua51.dll.manifest^
\r
41 %LJMT% -manifest lua51.dll.manifest -outputresource:lua51.dll;2
\r
43 %LJCOMPILE% luajit.c
\r
44 %LJLINK% /out:luajit.exe luajit.obj lua51.lib
\r
45 if exist luajit.exe.manifest^
\r
46 %LJMT% -manifest luajit.exe.manifest -outputresource:luajit.exe
\r
48 del *.obj *.manifest buildvm.exe
\r
52 @echo You must open a "Visual Studio .NET Command Prompt" to run this script
\r