mirror of
https://github.com/rvtr/ctr_Repair.git
synced 2025-10-31 13:51:08 -04:00
git-svn-id: file:///Volumes/Transfer/gigaleak_20231201/2020-05-23%20-%20ctr.7z%20+%20svn_v1.068.zip/ctr/svn/ctr_Repair@716 385bec56-5757-e545-9c3a-d8741f4650f1
91 lines
2.2 KiB
Bash
Executable File
91 lines
2.2 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
################################
|
|
#ビルド用スクリプト
|
|
################################
|
|
#
|
|
# 1. common/version.h を変更する
|
|
# 2. 開発実機用ビルドは build.sh UNFIXEDKEY
|
|
# 製品実機用ビルドは build.sh RELEASE
|
|
|
|
set -u
|
|
set -e
|
|
|
|
# バージョン取得
|
|
function getVersion
|
|
{
|
|
VERSION_MAJOR=$(cat common/version.h |grep VERSION_MAJOR|awk -F' ' '{print $3}'|sed 's/"//g')
|
|
VERSION_MINOR=$(cat common/version.h |grep VERSION_MINOR|awk -F' ' '{print $3}'|sed 's/"//g')
|
|
VERSION_MICRO=$(cat common/version.h |grep VERSION_MICRO|awk -F' ' '{print $3}'|sed 's/"//g')
|
|
VERSION_STR="VERSION_MAJOR=$VERSION_MAJOR VERSION_MINOR=$VERSION_MINOR VERSION_MICRO=$VERSION_MICRO"
|
|
}
|
|
|
|
# フラグ判定
|
|
releaseBuild=false;
|
|
unfixedKeyBuild=false
|
|
for arg in $@
|
|
do
|
|
if [ "$arg" = 'RELEASE' ]; then
|
|
releaseBuild=true
|
|
fi
|
|
|
|
if [ "$arg" = 'UNFIXEDKEY' ]; then
|
|
unfixedKeyBuild=true
|
|
fi
|
|
done
|
|
|
|
OPTION=""
|
|
if [ $releaseBuild == "true" ] ; then
|
|
getVersion
|
|
BUILD_TYPE=release,development
|
|
OPTION="PROD_BUILD=true $VERSION_STR"
|
|
elif [ $unfixedKeyBuild == "true" ] ; then
|
|
getVersion
|
|
BUILD_TYPE=release,development
|
|
OPTION="UNFIXEDKEY_BUILD=true $VERSION_STR"
|
|
else
|
|
BUILD_TYPE=development
|
|
fi
|
|
|
|
# IncrediBuildが使えるか
|
|
which xgConsole > /dev/null 2>&1
|
|
if [ "$?" -eq 0 ]; then
|
|
useIncrediBuild=true
|
|
PARALLEL=-j16
|
|
else
|
|
PARALLEL=-j8
|
|
fi
|
|
|
|
#################### 通常ビルド ####################
|
|
# ツールのビルド
|
|
toolBuildExec="omake BUILD=$BUILD_TYPE FILTER=CTR-TS.*fast $OPTION"
|
|
if [ $useIncrediBuild ] ; then
|
|
xgConsole /command="$toolBuildExec $PARALLEL" /profile="profile.xml"
|
|
else
|
|
$toolBuildExec $PARALLEL
|
|
fi
|
|
|
|
#リリース用ビルドはツールのみ
|
|
if [ $releaseBuild ] || [ $unfixedKeyBuild ] ; then
|
|
exit
|
|
fi
|
|
|
|
# CTR自動テストのビルド
|
|
testBuildExec="omake dotests-emumem BUILD=development FILTER=CTR-TS*.fast SKIP_RUN=true"
|
|
cd tests
|
|
if [ $useIncrediBuild ] ; then
|
|
xgConsole /command="$testBuildExec $PARALLEL" /profile="../profile.xml"
|
|
else
|
|
$testBuildExec $PARALLEL
|
|
fi
|
|
cd ../
|
|
|
|
# PC上のテストのビルド
|
|
cd tests/googletest/
|
|
if [ $useIncrediBuild ] ; then
|
|
xgConsole /command="omake $PARALLEL" /profile="../../profile.xml"
|
|
else
|
|
omake $PARALLEL
|
|
fi
|
|
|
|
cd ../../ |