summaryrefslogtreecommitdiff
path: root/build-0.3/meta/vc10proj
blob: cd6b5b3ed950b926f36a89c0aca50738000a1d44 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#! /usr/bin/env bash

# file      : build/meta/vc10proj
# copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC
# license   : GNU GPL v2; see accompanying LICENSE file

# Process VC++ 10 project file templates.
#
# Options:
#
# -o <output-file>
#
# Arguments:
#
# <template-file>
#
trap 'exit 1' ERR

function error ()
{
  echo "$*" 1>&2
}

output=

while [ $# -gt 0 ]; do
  case $1 in
    -o)
      output=$2
      shift 2
      ;;
    *)
      break
      ;;
  esac
done

input=$1

if [ "$input" = "" ]; then
  error "no input file"
  exit 1
fi

if [ "$output" = "" ]; then
  error "no output file"
  exit 1
fi

m4=m4
u2d=todos

# Assume this script is never found via PATH.
#
meta=`dirname $0`

build="$meta/.."
install=$build/install/install


# Determine available configurations.
#
conf=`sed -n -e \
's/^[ 	]*<ProjectConfiguration Include="\([^"]*\)">$/"\1",/p;d' $input`
conf=`echo $conf | sed -e 's/,$//'`

export configurations=$conf

# Make sure the output directory exist.
#
$install -d -m 755 `dirname $output`

$m4 -P -D__meta_base__=$meta $meta/vc10proj.m4 $input >$output
$u2d $output
chmod 644 $output

$m4 -P -D__meta_base__=$meta $meta/vc10proj.m4 $input.filters >$output.filters
$u2d $output.filters
chmod 644 $output.filters