Created
September 8, 2014 13:18
-
-
Save Taverius/61adf957adb72e0a41ce to your computer and use it in GitHub Desktop.
Vim build script with VS13
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
setlocal | |
:: Build variables | |
set TARGETOS=WINNT | |
set APPVER=6.1 | |
set WINVER=0x0800 | |
set USE_MSVCRT=yes | |
set CPUNR=haswell | |
set DEBUG=no | |
set DIRECTX=yes | |
set FEATURES=HUGE | |
set GUI=yes | |
set OLE=yes | |
set MBYTE=yes | |
set IME=yes | |
set DYNAMIC_IME=yes | |
set GIME=yes | |
set PYTHON=C:\Dev\Python\27-x86 | |
set DYNAMIC_PYTHON=yes | |
set PYTHON_VER=27 | |
set RUBY=C:\Dev\Ruby\200 | |
set DYNAMIC_RUBY=yes | |
set RUBY_VER=200 | |
set RUBY_VER_LONG=2.0.0 | |
set LUA=C:\Dev\Lua\2.1 | |
set DYNAMIC_LUA=yes | |
:: set PERL=C:\Dev\Perl\perl | |
:: set DYNAMIC_PERL=yes | |
:: set PERL_VER=518 | |
set POSTSCRIPT=yes | |
set NETBEANS=no | |
set XPM=no | |
:: Setup fox x64 (GVimExt only) | |
echo ==== Setting up environment for x64 | |
call "%PROGRAMFILES(x86)%\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" x64 | |
if %ERRORLEVEL% NEQ 0 goto :Error_env_x64 | |
:: pause | |
:: Main | |
if exist trunk\src (chdir trunk\src) else goto :Error_cd_trunk | |
:: Initial cleanup | |
echo ==== All x86 - Pre-build cleanup | |
nmake /NOLOGO -f Make_mvc.mak clean | |
if %ERRORLEVEL% NEQ 0 goto :Error_clean_all_x86 | |
:: pause | |
echo ==== All x64 - Pre-build cleanup | |
nmake /NOLOGO -f Make_mvc.mak CPU=AMD64 clean | |
if %ERRORLEVEL% NEQ 0 goto :Error_clean_all_x64 | |
:: pause | |
:: GVimExt | |
if exist GVimExt (chdir GVimExt) else goto :Error_cd_gvimext | |
:: GVimExt x64 | |
echo ==== GVimExt64 - Pre-build cleanup | |
if exist gvimext64.dll erase gvimext64.dll | |
nmake /NOLOGO -f Makefile CPU=AMD64 clean | |
if %ERRORLEVEL% NEQ 0 goto :Error_gvimext_x64_clean | |
:: pause | |
echo ==== GVimExt64 - Building | |
nmake /NOLOGO -f Makefile CPU=AMD64 | |
if %ERRORLEVEL% NEQ 0 goto :Error_gvimext_x64_build | |
:: pause | |
rename gvimext.dll gvimext64.dll | |
if not exist gvimext64.dll goto :Error_gvimext_x64_move | |
echo ==== GVimExt64 - Done | |
:: Setup fox x86 (Everything) | |
echo ==== Setting up environment for x86 | |
call "%PROGRAMFILES(x86)%\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" x86 | |
if %ERRORLEVEL% NEQ 0 goto :Error_env_x86 | |
:: pause | |
:: GVimExt x86 | |
echo ==== GVimExt86 - Pre-build cleanup | |
if exist gvimext32.dll erase gvimext32.dll | |
nmake /NOLOGO -f Makefile clean | |
if %ERRORLEVEL% NEQ 0 goto :Error_gvimext_x86_clean | |
:: pause | |
echo ==== GVimExt86 - Building | |
nmake /NOLOGO -f Makefile | |
if %ERRORLEVEL% NEQ 0 goto :Error_gvimext_x86_build | |
:: pause | |
copy /V gvimext.dll gvimext32.dll | |
if not exist gvimext32.dll goto :Error_gvimext_x86_move | |
echo ==== GVimExt86 - Done | |
:: Back to main | |
chdir .. | |
:: GVim with OLE | |
echo ==== GVim - Pre-build cleanup | |
if exist gvim_ole.exe erase gvim_ole.exe | |
for /d %%a in (Obj*) do rmdir /s /q %%a | |
echo ==== GVim - Building | |
nmake /NOLOGO -f Make_mvc.mak gvim.exe | |
if %ERRORLEVEL% NEQ 0 goto :Error_gvim_build | |
:: pause | |
rename gvim.exe gvim_ole.exe | |
if not exist gvim_ole.exe goto :Error_gvim_move | |
echo ==== GVim - Done | |
:: Console Vim | |
echo ==== Vim - Pre-Build cleanup | |
if exist vimd32.exe erase vimd32.exe | |
if exist vimw32.exe erase vimw32.exe | |
for /d %%a in (Obj*) do rmdir /s /q %%a | |
echo ==== Vim - Building | |
set DIRECTX=no | |
set GUI=no | |
set OLE=no | |
set POSTSCRIPT=no | |
nmake /NOLOGO -f Make_mvc.mak clean | |
nmake /NOLOGO -f Make_mvc.mak vim.exe | |
if %ERRORLEVEL% NEQ 0 goto :Error_vim_build | |
:: pause | |
copy /V vim.exe vimd32.exe | |
if not exist vimd32.exe goto :Error_vimd_move | |
rename vim.exe vimw32.exe | |
if not exist vimw32.exe goto :Error_vimw_move | |
echo ==== Vim - Done | |
:: Install, Uninstal, VimRun, XXD | |
echo ==== Install/Uninstal/Vimrun/XXD - Pre-build cleanup | |
if exist installw32.exe erase installw32.exe | |
if exist uninstalw32.exe erase uninstalw32.exe | |
if exist xxd\xxdw32.exe erase xxd\xxdw32.exe | |
echo ==== Install/Uninstal/Vimrun/XXD - Building | |
nmake /NOLOGO -f Make_mvc.mak install.exe uninstal.exe vimrun.exe xxd/xxd.exe | |
if %ERRORLEVEL% NEQ 0 goto :Error_misc_build | |
rename install.exe installw32.exe | |
if not exist installw32.exe goto :Error_misc_install | |
rename uninstal.exe uninstalw32.exe | |
if not exist uninstalw32.exe goto :Error_misc_uninstall | |
rename xxd\xxd.exe xxdw32.exe | |
move xxd\xxdw32.exe .\ | |
if not exist xxdw32.exe goto :Error_misc_xxd | |
echo ==== Install/Uninstal/Vimrun/XXD - Done | |
:: Prepare installation | |
echo. | |
echo ==== Runtime - Assembling runtime files | |
:: Copy gvimext32.dll to gvimext.dll | |
if exist GvimExt\gvimext32.dll ( | |
if exist GvimExt\gvimext.dll erase GvimExt\gvimext.dll | |
copy /V GvimExt\gvimext32.dll GvimExt\gvimext.dll || goto :Error_runtime_gvimext | |
) else ( | |
goto :Error_runtime_gvimext | |
) | |
chdir .. | |
:: Copy vimtutor.bat | |
if exist vimtutor.bat ( | |
if exist runtime\vimtutor.bat erase runtime\vimtutor.bat | |
copy /V vimtutor.bat runtime\vimtutor.bat || goto :Error_runtime_vimtutor | |
) else ( | |
goto :Error_runtime_vimtutor | |
) | |
:: Copy README.txt | |
if exist README.txt ( | |
if exist runtime\README.txt erase runtime\README.txt | |
copy /V README.txt runtime\README.txt || goto :Error_runtime_readme | |
) else ( | |
goto :Error_runtime_readme | |
) | |
:: copy uganda.txt | |
if exist runtime\doc\uganda.txt ( | |
if exist runtime\doc\uganda.nsis.txt erase runtime\doc\uganda.nsis.txt | |
copy /V runtime\doc\uganda.txt runtime\doc\uganda.nsis.txt || goto :Error_runtime_uganda | |
) else ( | |
goto :Error_runtime_uganda | |
) | |
:: copy libintl.dll | |
if exist ..\intl.dll ( | |
if exist runtime\libintl.dll erase runtime\libintl.dll | |
copy /V ..\intl.dll runtime\libintl.dll || goto :Error_runtime_libintl | |
) else ( | |
goto :Error_runtime_libintl | |
) | |
:: copy iconv.dll | |
if exist ..\iconv.dll ( | |
if exist runtime\iconv.dll erase runtime\iconv.dll | |
copy /V ..\iconv.dll runtime\iconv.dll || goto :Error_runtime_iconv | |
) else ( | |
goto :Error_runtime_iconv | |
) | |
echo ==== Runtime - Done | |
:: Mui NSIS | |
chdir ..\vim-installer-mui2\nsis | |
echo. | |
echo ==== NSIS - Preparing | |
if exist ..\..\trunk\Filelist ( | |
if exist Filelist erase Filelist | |
copy /V ..\..\trunk\Filelist Filelist || goto :Error_nsis_filelist | |
) else ( | |
goto :Error_nsis_filelist | |
) | |
if exist gvim-mine.nsi erase gvim-mine.nsi | |
if exist *.exe erase *.exe | |
C:\Dev\GnuWin32\bin\sed ^ | |
-e "s/!define VER_MINOR .*$/!define VER_MINOR 4/" ^ | |
-e "s/!define VIMSRC .*$/!define VIMSRC \"..\\..\\trunk\\src\"/" ^ | |
-e "s/!define VIMRT .*$/!define VIMRT \"..\\..\\trunk\\runtime\"/" ^ | |
-e "s/!define VIMTOOLS .*$/!define VIMTOOLS \"..\\..\"/" ^ | |
-e "s/!define HAVE_UPX/#!define HAVE_UPX/" ^ | |
-e "s/#!define HAVE_ICONV/!define HAVE_ICONV/" ^ | |
-e "s/!define HAVE_VIS_VIM/#!define HAVE_VIS_VIM/" gvim.nsi > gvim-mine.nsi | |
if %ERRORLEVEL% NEQ 0 goto :Error_nsis_sed | |
"%ProgramFiles(x86)%\NSIS\makensis" gvim-mine.nsi | |
if %ERRORLEVEL% NEQ 0 goto :End | |
move *.exe ..\.. | |
goto:End | |
:: ==== Errors | |
:Error_env_x64 | |
echo ==== Setting up x64 environment failed | |
goto:Error_Pause | |
:Error_env_x86 | |
echo ==== Setting up x86 environment failed | |
goto:Error_Pause | |
:Error_cd_trunk | |
echo ==== \trunk\src does not exist | |
goto:Error_Pause | |
:Error_cd_gvimext | |
echo ==== \GVimExt does not exist | |
goto:Error_Pause | |
:Error_clean_all_x64 | |
echo ==== All x64 - Pre-build cleanup failed | |
goto:Error_Pause | |
:Error_clean_all_x86 | |
echo ==== All x86 - Pre-build cleanup failed | |
goto:Error_Pause | |
:Error_gvimext_x64_clean | |
echo ==== GVimExt64 - Pre-build cleanup failed | |
goto:Error_Pause | |
:Error_gvimext_x64_build | |
echo ==== GVimExt64 - Building failed | |
goto:Error_Pause | |
:Error_gvimext_x64_move | |
echo ==== GVimExt64 - Could not create gvimext64.dll | |
goto:Error_Pause | |
:Error_gvimext_x86_clean | |
echo ==== GVimExt86 - Pre-build cleanup failed | |
goto:Error_Pause | |
:Error_gvimext_x86_build | |
echo ==== GVimExt86 - Building failed | |
goto:Error_Pause | |
:Error_gvimext_x86_move | |
echo ==== GVimExt86 - Could not create gvimext64.dll | |
goto:Error_Pause | |
:Error_gvim_build | |
echo ==== GVim - Building failed | |
goto:Error_Pause | |
:Error_gvim_move | |
echo ==== GVim - Could not create gvim_ole.exe | |
goto:Error_Pause | |
:Error_vim_build | |
echo ==== Vim - Building failed | |
goto:Error_Pause | |
:Error_vimd_move | |
echo ==== Vim - Could not create vimd32.exe | |
goto:Error_Pause | |
:Error_vimw_move | |
echo ==== Vim - Could not create vimw32.exe | |
goto:Error_Pause | |
:Error_misc_build | |
echo ==== Install/Uninstal/Vimrun/XXD - Building failed | |
goto:Error_Pause | |
:Error_misc_install | |
echo ==== Install/Uninstal/Vimrun/XXD - Could not create installw32.exe | |
goto:Error_Pause | |
:Error_misc_uninstall | |
echo ==== Install/Uninstal/Vimrun/XXD - Could not create uninstalw32.exe | |
goto:Error_Pause | |
:Error_misc_xxd | |
echo ==== Install/Uninstal/Vimrun/XXD - Could not create xxdw32.exe | |
goto:Error_Pause | |
:Error_runtime_gvimext | |
echo ==== Runtime - Could not copy gvimext32.dll | |
goto:Error_Pause | |
:Error_runtime_vimtutor | |
echo ==== Runtime - Could not copy vimtutor.bat | |
goto:Error_Pause | |
:Error_runtime_readme | |
echo ==== Runtime - Could not copy README.txt | |
goto:Error_Pause | |
:Error_runtime_uganda | |
echo ==== Runtime - Could not copy uganda.nsis.txt | |
goto:Error_Pause | |
:Error_runtime_libintl | |
echo ==== Runtime - Could not copy libintl.dll | |
goto:Error_Pause | |
:Error_runtime_iconv | |
echo ==== Runtime - Could not copy iconv.dll | |
goto:Error_Pause | |
:Error_nsis_filelist | |
echo ==== NSIS - Could not copy Filelist | |
goto:Error_Pause | |
:Error_nsis_sed | |
echo ==== NSIS - gvim.nsi processing failed | |
goto:Error_Pause | |
:Error_Pause | |
pause | |
:End |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment