1#! bash 2############################################################################### 3# BuildScript for SampleTool 4# 5# Copyright (C) 2005-2006 Nintendo. All rights reserved. 6# 7# These coded instructions, statements, and computer programs contain 8# proprietary information of Nintendo of America Inc. and/or Nintendo 9# Company Ltd., and are protected by Federal copyright law. They may 10# not be disclosed to third parties or copied or duplicated in any form, 11# in whole or in part, without the prior written consent of Nintendo. 12############################################################################### 13 14# 15# compile sampletool Executable 16# 17# Usage: buildscript compile all the solution or projects 18# buildscript /clean deletes all the intermediate files 19# buildscript /rebuild rebuild all the solution or projects 20# buildscript /project build/rebuild/clean/ the projects 21# 22# if Visual Studio is not installed, do nothing. 23# 24 25############################################################################ 26# setup 27############################################################################ 28# MODULENAME is *.sln filename. It is same as $(SDK)/build/tools/$MODULENAME. 29MODULENAME="gddemo" 30 31PROJECTS="gd_indtex_host gd_init_host gd_light_host gd_matrix_host gd_tev_host gd_texture_host" 32 33# select one suffix of target file. "exe" or "dll", "lib", "bin"... 34BINSUFFIX=exe 35 36 37############################################################################ 38# do operation 39############################################################################ 40 41case "${BINSUFFIX}" in 42 "exe") 43 X86_INSTALL_ROOT=${REVOLUTION_SDK_ROOT}/X86/bin 44;; 45 "dll") 46 X86_INSTALL_ROOT=${REVOLUTION_SDK_ROOT}/X86/lib 47;; 48 "lib") 49 X86_INSTALL_ROOT=${REVOLUTION_SDK_ROOT}/X86/lib 50;; 51 "bin") 52 X86_INSTALL_ROOT=${REVOLUTION_SDK_ROOT}/X86/bin 53;; 54esac 55 56# Visual C++ IDE install path 57MSDEV=${VS80COMNTOOLS}/../IDE/devenv.com 58MSDEV_EXPRESS=${VS80COMNTOOLS}/../IDE/VCExpress.exe 59 60if [ ! -e "$MSDEV" ]; then 61 if [ -e "$MSDEV_EXPRESS" ]; then 62 MSDEV=${MSDEV_EXPRESS} 63 fi 64fi 65 66if [ "$NDEBUG" ] 67then 68 tgt="Release"; 69else 70 tgt="Debug"; 71fi 72 73if [ "$1" == "/clean" ] 74then 75 "${MSDEV}" vc++/${MODULENAME}.sln /clean Debug; 76 "${MSDEV}" vc++/${MODULENAME}.sln /clean Release; 77else 78 79 if [ "${VS80COMNTOOLS}" == "" ] 80 then 81 echo Visual Studio is not installed. Do nothing. 82 else 83 84 if [ ! -d ${X86_INSTALL_ROOT} ] ; then \ 85 echo "Creating ${X86_INSTALL_ROOT}..." ; \ 86 mkdir -p ${X86_INSTALL_ROOT} ; \ 87 fi ; \ 88 89 for p in $PROJECTS; do \ 90 "${MSDEV}" vc++/${MODULENAME}.sln /rebuild ${tgt} /project ${p}; 91# if [ "${tgt}" == "Release" ] 92# then 93# echo "Copying RELEASE version..." 94# cp -f vc++/Release/${p}.${BINSUFFIX} ${X86_INSTALL_ROOT} 95# else 96# echo "Copying DEBUG version..." 97# cp -f vc++/Debug/${p}.${BINSUFFIX} ${X86_INSTALL_ROOT}/${p}D.${BINSUFFIX} 98# fi 99 done 100 101 fi 102fi 103