1 1.3 rafal # $NetBSD: gen_workspace.sh,v 1.3 2008/02/26 21:46:38 rafal Exp $ 2 1.1 uch # 3 1.1 uch # Copyright (c) 1999, 2000 Christopher G. Demetriou. All rights reserved. 4 1.1 uch # 5 1.1 uch # Redistribution and use in source and binary forms, with or without 6 1.1 uch # modification, are permitted provided that the following conditions 7 1.1 uch # are met: 8 1.1 uch # 1. Redistributions of source code must retain the above copyright 9 1.1 uch # notice, this list of conditions and the following disclaimer. 10 1.1 uch # 2. Redistributions in binary form must reproduce the above copyright 11 1.1 uch # notice, this list of conditions and the following disclaimer in the 12 1.1 uch # documentation and/or other materials provided with the distribution. 13 1.1 uch # 3. All advertising materials mentioning features or use of this software 14 1.1 uch # must display the following acknowledgement: 15 1.1 uch # This product includes software developed by Christopher G. Demetriou 16 1.1 uch # for the NetBSD Project. 17 1.1 uch # 4. The name of the author may not be used to endorse or promote products 18 1.1 uch # derived from this software without specific prior written permission 19 1.1 uch # 20 1.1 uch # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 21 1.1 uch # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 22 1.1 uch # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 23 1.1 uch # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 24 1.1 uch # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 25 1.1 uch # NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 26 1.1 uch # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 27 1.1 uch # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 28 1.1 uch # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 29 1.1 uch # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 1.1 uch 31 1.1 uch AWK=awk 32 1.1 uch if [ `uname` = SunOS ]; then 33 1.1 uch AWK=nawk 34 1.1 uch fi 35 1.1 uch 36 1.1 uch vc_ver=$1 37 1.1 uch shift 38 1.1 uch WORKSPACE_FILE=$1 39 1.1 uch shift 40 1.1 uch SORTED_PROJECTS=`(for project in $*; do 41 1.1 uch echo $project 42 1.1 uch done) | sort` 43 1.1 uch 44 1.1 uch ( 45 1.1 uch case $vc_ver in 46 1.2 uch "vc5") 47 1.2 uch echo "Microsoft Developer Studio Workspace File, Format Version 5.00" 48 1.2 uch suffix=dsp 49 1.2 uch ;; 50 1.1 uch "vc6") 51 1.1 uch echo "Microsoft Developer Studio Workspace File, Format Version 6.00" 52 1.1 uch suffix=dsp 53 1.1 uch ;; 54 1.3 rafal "evc3"|"evc4") 55 1.1 uch echo "Microsoft eMbedded Visual Tools Workspace File, Format Version 3.00" 56 1.1 uch suffix=vcp 57 1.1 uch ;; 58 1.1 uch *) 59 1.1 uch echo "Unsupported Visual C++ version." 1>&2 60 1.1 uch exit 1 61 1.1 uch esac 62 1.1 uch 63 1.1 uch cat << __EOF__ 64 1.1 uch # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 65 1.1 uch 66 1.1 uch ############################################################################### 67 1.1 uch __EOF__ 68 1.1 uch 69 1.1 uch for project in $SORTED_PROJECTS; do 70 1.1 uch echo "" 71 1.1 uch echo "Project: \"$project\"=.\\$project\\$project.$suffix - Package Owner=<4>" 72 1.1 uch echo "" 73 1.1 uch echo "Package=<5>" 74 1.1 uch echo "{{{" 75 1.1 uch echo "}}}" 76 1.1 uch echo "" 77 1.1 uch echo "Package=<4>" 78 1.1 uch echo "{{{" 79 1.1 uch for libdep in `( . $project/$project.config; echo $LIBDEP_LIST )`; do 80 1.1 uch echo " Begin Project Dependency" 81 1.1 uch echo " Project_Dep_Name $libdep" 82 1.1 uch echo " End Project Dependency" 83 1.1 uch done 84 1.1 uch echo "}}}" 85 1.1 uch echo "" 86 1.1 uch echo "###############################################################################" 87 1.1 uch done 88 1.1 uch 89 1.1 uch cat << __EOF__ 90 1.1 uch 91 1.1 uch Global: 92 1.1 uch 93 1.1 uch Package=<5> 94 1.1 uch {{{ 95 1.1 uch }}} 96 1.1 uch 97 1.1 uch Package=<3> 98 1.1 uch {{{ 99 1.1 uch }}} 100 1.1 uch 101 1.1 uch ############################################################################### 102 1.1 uch 103 1.1 uch __EOF__ 104 1.1 uch ) | awk ' { printf "%s\r\n", $0 }' > ${WORKSPACE_FILE} 105