1#! bash
2###############################################################################
3# BuildScript for hioHost
4#
5# Copyright (C) 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############################################################################
28MODULENAME="hio2demo"
29
30# PROJECTS lists all VC project that will be linked.
31PROJECTS="dual multi simple"
32
33# select one suffix of target file. "exe" or "dll", "lib", "bin"...
34BINSUFFIX=exe
35
36############################################################################
37# do operation
38############################################################################
39
40# Visual C++ IDE install path
41MSDEV=${VS71COMNTOOLS}/../IDE/devenv
42HIO2DEMO_INSTALL_ROOT=../../../x86/hio2demo
43
44if [ "$NDEBUG" ]
45then
46    tgt="Release";
47else
48    tgt="Debug";
49fi
50
51if [ "$1" == "/clean" ]
52then
53    "${MSDEV}" vc++/${MODULENAME}.sln /clean Debug;
54    "${MSDEV}" vc++/${MODULENAME}.sln /clean Release;
55else
56
57    if [ "${VS71COMNTOOLS}" == "" ]
58    then
59        echo Visual Studio is not installed. Do nothing.
60    else
61
62		if [ ! -d ${HIO2DEMO_INSTALL_ROOT} ] ; then \
63			echo "Creating ${HIO2DEMO_INSTALL_ROOT}..." ; \
64			mkdir -p ${HIO2DEMO_INSTALL_ROOT} ; \
65		fi ; \
66
67        for p in $PROJECTS; do \
68            "${MSDEV}" vc++/${MODULENAME}.sln /rebuild ${tgt} /project ${p};
69            if [ "${tgt}" == "Release" ]
70            then
71                echo "Copying RELEASE version..."
72                cp -f vc++/${p}/Release/${p}.${BINSUFFIX} ${HIO2DEMO_INSTALL_ROOT}
73            else
74                echo "Copying DEBUG version..."
75            	cp -f vc++/${p}/Debug/${p}.${BINSUFFIX} ${HIO2DEMO_INSTALL_ROOT}/${p}D.${BINSUFFIX}
76            fi
77        done
78
79    fi
80fi
81