This repository has been archived by the owner on Jan 3, 2021. It is now read-only.
forked from LongSoft/UEFITool
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
40 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
set BASE_DIR=%cd% | ||
set BUILD_DIR=%BASE_DIR%\Win | ||
set RELEASE_DIR=%BUILD_DIR%\release | ||
set EXEC_NAME=OZMTool | ||
|
||
set GIT=git | ||
set QMAKE=qmake | ||
set MAKE=nmake | ||
set CONFIG_OPTION=release | ||
set OS_ID=win | ||
set ZIP=7za | ||
set PACKER=upx | ||
|
||
for /f %%i in ('%GIT% describe') do set VERSION=%%i | ||
set VERSION_HEADER=%BASE_DIR%\version.h | ||
|
||
echo #ifndef VERSION_H > %VERSION_HEADER% | ||
echo #define VERSION_H >> %VERSION_HEADER% | ||
echo #define GIT_VERSION "%VERSION%" >> %VERSION_HEADER% | ||
echo #endif // VERSION_H >> %VERSION_HEADER% | ||
|
||
mkdir %BUILD_DIR% | ||
cd %BUILD_DIR% | ||
echo "Building..." | ||
%QMAKE% -config %CONFIG_OPTION% %BASE_DIR% | ||
%MAKE% | ||
echo "Copying files..." | ||
mkdir %RELEASE_DIR% | ||
copy %BUILD_DIR%\%EXEC_NAME% %RELEASE_DIR% | ||
copy %BASE_DIR%\README %RELEASE_DIR% | ||
|
||
echo "Packing it up..." | ||
cd %RELEASE_DIR% | ||
%PACKER% -9 %EXEC_NAME% | ||
%ZIP% a %BASE_DIR%\%EXEC_NAME%_%VERSION%_%OS_ID%.7z * | ||
|
||
echo "Reverting version.h" | ||
%GIT% checkout %VERSION_HEADER% | ||
|
||
echo "Done!" |