diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2010-08-26 14:39:08 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2010-08-26 14:39:08 +0200 |
commit | f00465eecdcf50965e8ca455527a49759bfcddbd (patch) | |
tree | 6a02a5938cc42df55c4335701ebde778d0351803 /build/meta/vc10proj | |
parent | ae283997b95c18181091e530ba554624cd93a0e2 (diff) |
Add meta-build subsystem
Meta-build is used to create (or, more precisely, maintain) other build
systems. The idea is to create templates for other build systems (automake,
VC++ projects) which are then processed by meta-build to fill in the
details such as files to compile, etc. The template system is built on
top of GNU m4. Currently supported build systems are autoconf, automake,
VC++ 9, and VC++ 10.
Diffstat (limited to 'build/meta/vc10proj')
-rwxr-xr-x | build/meta/vc10proj | 78 |
1 files changed, 78 insertions, 0 deletions
diff --git a/build/meta/vc10proj b/build/meta/vc10proj new file mode 100755 index 0000000..a8cae97 --- /dev/null +++ b/build/meta/vc10proj @@ -0,0 +1,78 @@ +#! /usr/bin/env bash + +# file : build/meta/vc10proj +# author : Boris Kolpackov <boris@codesynthesis.com> +# copyright : Copyright (c) 2009-2010 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=unix2dos + +# 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 + +$m4 -P -D__meta_base__=$meta $meta/vc10proj.m4 $input.filters >$output.filters +$u2d $output.filters |