make.bat: optimize vc download

pull/4990/head
yuyi 2020-05-22 16:46:55 +08:00 committed by GitHub
parent 1cc52b0fae
commit fe0b587b1f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 8 deletions

1
.gitignore vendored
View File

@ -18,6 +18,7 @@ a.out
.noprefix.vrepl_temp .noprefix.vrepl_temp
# ignore v build files # ignore v build files
/vc
/v.c /v.c
/v.*.c /v.*.c
/v.c.out /v.c.out

View File

@ -5,12 +5,15 @@ echo Building V
pushd %~dp0 pushd %~dp0
if exist "vc" ( if exist "vc" (
rd /s /q vc echo Updating vc...
cd vc
git pull
cd ..
) else (
echo Cloning vc...
git clone --depth 1 --quiet https://github.com/vlang/vc
) )
echo Downloading v.c...
git clone --depth 1 --quiet https://github.com/vlang/vc
REM option to force msvc or gcc REM option to force msvc or gcc
if "%~1"=="-gcc" goto :gcc_strap if "%~1"=="-gcc" goto :gcc_strap
if "%~1"=="-msvc" goto :msvc_strap if "%~1"=="-msvc" goto :msvc_strap
@ -39,11 +42,9 @@ REM and it will be restored when v is a stable version.
v.exe self v.exe self
if %ERRORLEVEL% NEQ 0 ( if %ERRORLEVEL% NEQ 0 (
echo v.exe failed to compile itself - Create an issue at 'https://github.com/vlang' echo v.exe failed to compile itself - Create an issue at 'https://github.com/vlang'
rd /s /q vc
goto :error goto :error
) )
rd /s /q vc
del v_old.exe del v_old.exe
goto :success goto :success
@ -81,12 +82,10 @@ REM and it will be restored when v is a stable version.
v.exe self v.exe self
if %ERRORLEVEL% NEQ 0 ( if %ERRORLEVEL% NEQ 0 (
echo V failed to build itself with error %ERRORLEVEL% echo V failed to build itself with error %ERRORLEVEL%
rd /s /q vc
del %ObjFile% del %ObjFile%
goto :compile_error goto :compile_error
) )
rd /s /q vc
del v_old.exe del v_old.exe
del %ObjFile% del %ObjFile%