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="sample" 30 31# PROJECTS lists all VC project that will be linked. 32PROJECTS="sample" 33 34# select one suffix of target file. "exe" or "dll", "lib", "bin"... 35BINSUFFIX=exe 36 37 38############################################################################ 39# do operation 40############################################################################ 41 42case "${BINSUFFIX}" in 43 "exe") 44 X86_INSTALL_ROOT=${REVOLUTION_SDK_ROOT}/X86/bin 45;; 46 "dll") 47 X86_INSTALL_ROOT=${REVOLUTION_SDK_ROOT}/X86/lib 48;; 49 "lib") 50 X86_INSTALL_ROOT=${REVOLUTION_SDK_ROOT}/X86/lib 51;; 52 "bin") 53 X86_INSTALL_ROOT=${REVOLUTION_SDK_ROOT}/X86/bin 54;; 55esac 56 57# Visual C++ IDE install path 58MSDEV=${VS80COMNTOOLS}/../IDE/devenv.com 59MSDEV_EXPRESS=${VS80COMNTOOLS}/../IDE/VCExpress.exe 60MSDEV_VC2003=${VS71COMNTOOLS}/../IDE/devenv 61 62if [ ! -e "$MSDEV" ]; then 63 if [ -e "$MSDEV_EXPRESS" ]; then 64 MSDEV=${MSDEV_EXPRESS} 65 else 66 MSDEV=${MSDEV_VC2003} 67 fi 68fi 69 70echo $MSDEV 71if [ "$NDEBUG" ] 72then 73 tgt="Release"; 74else 75 tgt="Debug"; 76fi 77 78if [ "$1" == "/clean" ] 79then 80 "${MSDEV}" vc++/${MODULENAME}.sln /clean Debug; 81 "${MSDEV}" vc++/${MODULENAME}.sln /clean Release; 82else 83 84 if [ ! -e "${MSDEV}" ] 85 then 86 echo Visual Studio is not installed. Do nothing. 87 else 88 89 if [ ! -d ${X86_INSTALL_ROOT} ] ; then \ 90 echo "Creating ${X86_INSTALL_ROOT}..." ; \ 91 mkdir -p ${X86_INSTALL_ROOT} ; \ 92 fi ; \ 93 94 for p in $PROJECTS; do \ 95 "${MSDEV}" vc++/${MODULENAME}.sln /rebuild ${tgt} /project ${p}; 96 if [ "${tgt}" == "Release" ] 97 then 98 echo "Copying RELEASE version..." 99 cp -f vc++/Release/${p}.${BINSUFFIX} ${X86_INSTALL_ROOT} 100 else 101 echo "Copying DEBUG version..." 102 cp -f vc++/Debug/${p}.${BINSUFFIX} ${X86_INSTALL_ROOT}/${p}D.${BINSUFFIX} 103 fi 104 done 105 106 fi 107fi 108