ctr_Repair/trunk/ConsoleDataMigration/sources/build.sh
N2614 d7a5b85b33 BackupとRestoreで参照するSDKを切り替えられるように
警告対策


git-svn-id: file:///Volumes/Transfer/gigaleak_20231201/2020-05-23%20-%20ctr.7z%20+%20svn_v1.068.zip/ctr/svn/ctr_Repair@758 385bec56-5757-e545-9c3a-d8741f4650f1
2013-11-13 07:31:22 +00:00

130 lines
2.7 KiB
Bash
Executable File

#!/usr/bin/env bash
################################
#ビルド用スクリプト
################################
#
# 1. common/version.h を変更する
# 2. 開発実機用ビルドは build.sh UNFIXEDKEY
# 製品実機用ビルドは build.sh PROD
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"
}
# フラグ判定
prodBuild=false
unfixedKeyBuild=false
for arg in $@
do
if [ "$arg" = 'PROD' ]; then
prodBuild=true
fi
if [ "$arg" = 'UNFIXEDKEY' ]; then
unfixedKeyBuild=true
fi
done
OPTION=""
if [ $prodBuild == "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が使えるか
set +e
which xgConsole > /dev/null 2>&1
if [ "$?" -eq 0 ]; then
useIncrediBuild=true
PARALLEL=-j16
else
useIncrediBuild=false
PARALLEL=-j8
fi
set -e
function buildCore
{
command="$1"
if $useIncrediBuild ; then
xgConsole /command="$command $PARALLEL" /profile="profile.xml"
else
$command $PARALLEL
fi
}
function buildBackupAndRestore
{
BuildExec="omake BUILD=$BUILD_TYPE FILTER=CTR-TS.*fast $OPTION"
cd ConsoleBackup
export HORIZON_ROOT=$HORIZON_ROOT_BACKUP
buildCore "$BuildExec"
cd ../
cd ConsoleRestore
export HORIZON_ROOT=$HORIZON_ROOT_RESTORE
buildCore "$BuildExec"
cd ../
}
function buildAutoTest
{
testBuildExec="omake dotests-emumem BUILD=development FILTER=CTR-TS*.fast SKIP_RUN=true"
cd tests
cd common
export HORIZON_ROOT=$HORIZON_ROOT_BACKUP
buildCore "$testBuildExec"
cd ../
cd ConsoleBackup
export HORIZON_ROOT=$HORIZON_ROOT_BACKUP
buildCore "$testBuildExec"
cd ../
cd ConsoleRestore
export HORIZON_ROOT=$HORIZON_ROOT_RESTORE
buildCore "$testBuildExec"
cd ../
cd ../
}
#################### 通常ビルド ####################
# ConsoleBackup、ConsoleRestoreのビルド
buildBackupAndRestore
#リリース用ビルドはツールのみ
if $prodBuild || $unfixedKeyBuild ; then
exit
fi
# CTR自動テストのビルド
buildAutoTest
# PC上のテストのビルド
cd tests/googletest/
if $useIncrediBuild ; then
xgConsole /command="omake $PARALLEL" /profile="../../profile.xml"
else
omake $PARALLEL
fi
cd ../../