1
0
Fork 0

Added simple release script.

This commit is contained in:
LoRd_MuldeR 2021-05-08 19:23:57 +02:00
parent 61fa41c888
commit c3a82530f1
Signed by: mulder
GPG Key ID: 2B5913365F57E03F
4 changed files with 65 additions and 1 deletions

1
.gitignore vendored
View File

@ -4,3 +4,4 @@
/**/lib
/**/obj
/.vs
/out

View File

@ -47,7 +47,7 @@ else ifneq ($(DEBUG),0)
else
CFLAGS += -O3 -DNDEBUG
ifneq ($(FLTO),0)
CFLAGS += -flto -fuse-linker-plugin
CFLAGS += -flto
endif
ifneq ($(FPGO),0)
CFLAGS += -fprofile-$(firstword $(FPGO))

39
mk-release.cmd Normal file
View File

@ -0,0 +1,39 @@
@echo off
setlocal enabledelayedexpansion
set ECHO="%~dp0.\etc\utils\win32\cecho.exe"
if "%MSVC_PATH%"=="" (
set "MSVC_PATH=C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC"
)
if not exist "%MSVC_PATH%\Auxiliary\Build\vcvarsall.bat" (
%ECHO% red "\nMSVC not found. Please check MSVC_PATH and try again^!\n"
pause
goto:eof
)
for %%p in (x86,x64) do (
call "%MSVC_PATH%\Auxiliary\Build\vcvarsall.bat" %%p
for %%c in (Release,Release_SSE2) do (
if not "%%p::%%c" == "x64::Release_SSE2" (
%ECHO% white "\n------------------------------------------------------------------------------"
%ECHO% white "Clean [%%p:%%c]"
%ECHO% white "------------------------------------------------------------------------------\n"
MSBuild.exe /property:Configuration=%%c /property:Platform=%%p /target:Clean /verbosity:normal "%~dp0\Slunk.sln"
if not "!ERRORLEVEL!"=="0" goto:BuildFailed
%ECHO% white "\n------------------------------------------------------------------------------"
%ECHO% white "Compile [%%p:%%c]"
%ECHO% white "------------------------------------------------------------------------------\n"
MSBuild.exe /property:Configuration=%%c /property:Platform=%%p /target:Build /verbosity:normal "%~dp0\Slunk.sln"
if not "!ERRORLEVEL!"=="0" goto:BuildFailed
)
)
)
%ECHO% green "\nBuild completed successfully.\n"
pause
goto:eof
:BuildFailed
%ECHO% red "\nBuild has failed ^!^!^!\n"
pause

24
mk-release.sh Executable file
View File

@ -0,0 +1,24 @@
#!/bin/bash
set -e
cd -- "$(dirname -- "${BASH_SOURCE[0]}")"
readonly USE_STATIC=1
readonly USE_STRIP=1
readonly USE_MTUNE=corei7
PLATFORM="$(uname -a)"
unset SUFFIX
if [[ "${PLATFORM}" == MINGW* || "${PLATFORM}" == CYGWIN* ]]; then
SUFFIX=".exe"
fi
mkdir -p "out"
rm -f "out/slunkcrypt-*"
for cpu in 32 64; do
[[ ${cpu} -lt 64 ]] && march=pentium2 || march=x86-64
make -B CPU=${cpu} MARCH=${march} MTUNE=${USE_MTUNE} STATIC=${USE_STATIC} STRIP=${USE_STRIP} clean all
cp -f "frontend/bin/slunkcrypt${SUFFIX}" "out/slunkcrypt-x${cpu}${SUFFIX}"
done
printf "\033[1;32m\nBuild completed successfully.\033[0m\n\n"