Index: win32/genversion.bat |
diff --git a/win32/genversion.bat b/win32/genversion.bat |
index 7934ebfa102acb8f6b240b188069839d671d5e5a..a9b9353a71ebfa2b64b2a40753f2dc624f768ce9 100644 |
--- a/win32/genversion.bat |
+++ b/win32/genversion.bat |
@@ -2,7 +2,7 @@ |
setlocal enableextensions enabledelayedexpansion |
-for /f %%v in ('git describe --tags --match "v*"') do set version=%%v |
+for /f %%v in ('git --git-dir="%~dp0..\.git" describe --tags --match "v*"') do set version=%%v |
if not "%version%"=="" goto :gotversion |
@@ -16,7 +16,7 @@ goto :gotversion |
:getversion |
-for /f "delims== tokens=2" %%v in (%~dp0..\version.mk) do set version=%%v |
+for /f "delims== tokens=2" %%v in (%~dps0..\version.mk) do set version=%%v |
set version=!version:^"=! |
set version=!version: =! |
@@ -26,7 +26,7 @@ set version=!version: =! |
set version_out=#define %2 "%version%" |
set version_mk=%2 = "%version%" |
-echo %version_out%> %1_temp |
+echo %version_out%> "%1_temp" |
if %version%==unknown goto :skipgenerate |
@@ -35,12 +35,12 @@ echo %version_mk%>> "%~dp0..\version.mk" |
:skipgenerate |
-echo n | comp %1_temp %1 > NUL 2> NUL |
+echo n | comp "%1_temp" "%1" > NUL 2> NUL |
if not errorlevel 1 goto exit |
-copy /y %1_temp %1 |
+copy /y "%1_temp" "%1" |
:exit |
-del %1_temp |
+del "%1_temp" |