2016-03-15 01:36:37 +00:00
|
|
|
@echo off
|
2016-01-14 12:31:48 +00:00
|
|
|
set BRA=Unknown
|
|
|
|
set REV=illegal
|
2023-12-06 03:54:59 +00:00
|
|
|
set GL1=Dummy
|
2016-01-14 12:31:48 +00:00
|
|
|
|
2014-03-15 16:59:03 +00:00
|
|
|
copy nul: /b +%1\comptime.c tmp.$$$ > nul
|
|
|
|
move tmp.$$$ %1\comptime.c > nul
|
2016-01-14 12:31:48 +00:00
|
|
|
|
|
|
|
if exist .git goto gitrev
|
2016-01-16 19:35:34 +00:00
|
|
|
if exist ..\.git goto gitrev
|
2016-01-14 12:31:48 +00:00
|
|
|
if exist .svn goto svnrev
|
|
|
|
goto filwri
|
|
|
|
|
|
|
|
:gitrev
|
|
|
|
set GIT=%2
|
|
|
|
if "%GIT%"=="" set GIT=git
|
2023-12-06 03:54:59 +00:00
|
|
|
for /f "tokens=* usebackq" %%s in (`%GIT% rev-parse --abbrev-ref HEAD`) do @set BRA=%%s
|
|
|
|
for /f "tokens=* usebackq" %%s in (`%GIT% rev-parse HEAD`) do @set REV=%%s
|
2023-12-31 15:56:37 +00:00
|
|
|
for /f "tokens=* usebackq" %%s in (`%GIT% log -1 --format^=%%f`) do @set GL1=%%s
|
2016-01-14 12:31:48 +00:00
|
|
|
set REV=%REV:~0,8%
|
|
|
|
goto filwri
|
|
|
|
|
|
|
|
:svnrev
|
|
|
|
set BRA=Subversion
|
2016-03-14 21:47:02 +00:00
|
|
|
for /f "usebackq" %%s in (`svnversion .`) do @set REV=%%s
|
2016-01-14 12:36:27 +00:00
|
|
|
set REV=r%REV%
|
2016-01-14 12:31:48 +00:00
|
|
|
goto filwri
|
|
|
|
|
|
|
|
:filwri
|
2016-03-14 21:47:02 +00:00
|
|
|
echo // Do not edit! This file was autogenerated > %1\comptime.h
|
|
|
|
echo // by the %0 batch file >> %1\comptime.h
|
|
|
|
echo // >> %1\comptime.h
|
|
|
|
echo const char* compbranch = "%BRA%"; >> %1\comptime.h
|
|
|
|
echo const char* comprevision = "%REV%"; >> %1\comptime.h
|
2023-12-06 03:54:59 +00:00
|
|
|
echo const char* compnote = "%GL1%"; >> %1\comptime.h
|