improve 64bit portability
[picodrive.git] / platform / pandora / make_pxml.sh
CommitLineData
0bc89554 1#!/bin/bash
68af34fe 2set -e
ab61cff7 3
68af34fe 4verfile=../common/version.h
5test -f $verfile
6
7major=`head -n 1 $verfile | sed 's/.*"\([0-9]*\)\.\([0-9]*\).*/\1/g'`
8minor=`head -n 1 $verfile | sed 's/.*"\([0-9]*\)\.\([0-9]*\).*/\2/g'`
9# lame, I know..
10build=`git describe HEAD | grep -- - | sed -e 's/.*\-\(.*\)\-.*/\1/'`
ee5d41a1 11test -n "$build" && build_post="-$build"
68af34fe 12test -n "$build" || build=0
13
14trap "rm -f $2" ERR
ab61cff7 15
ee5d41a1 16sed -e 's/@major@/'$major'/' \
17 -e 's/@minor@/'$minor'/' \
18 -e 's/@build@/'$build'/' \
19 -e 's/@build_post@/'$build_post'/' \
20 "$1" > "$2"