source: rtems/contrib/mingw/build.sh @ 808db8e

4.104.114.84.95
Last change on this file since 808db8e was 808db8e, checked in by Chris Johns <chrisj@…>, on Aug 4, 2006 at 9:48:38 AM

Fix the return code when used with tee.

  • Property mode set to 100755
File size: 1.3 KB
Line 
1#! /bin/sh
2#
3# $Id$
4#
5# RTEMS Build script.
6#
7# This script builds the RPM files then the Windows executables.
8#
9# Note: This file should be placed in crossrpms.
10#
11
12command_line="$0 $*"
13
14terminate()
15{
16  echo "error: $*" >&2
17  exit 1
18  echo "after"
19}
20
21check()
22{
23 if [ $? -ne 0 ]; then
24  terminate $*
25 fi
26}
27
28debug=
29hosts=
30prefix=
31no_run=
32relocate=
33source=
34targets=
35version=
36log=build.txt
37
38while [ $# -gt 0 ];
39do
40 case $1 in
41  -d)
42   set -x
43   debug="-d"
44   ;;
45  -h)
46   shift
47   hosts="-h $1"
48   ;;
49  -l)
50   shift
51   log=$1
52   ;;
53  -n)
54   no_run="-n"
55   ;;
56  -p)
57   shift
58   prefix="-p $1"
59   ;;
60  -r)
61   shift
62   relocation="-r $1"
63   ;;
64  -s)
65   shift
66   source="-s $1"
67   ;;
68  -t)
69   shift
70   targets="-t $1"
71   ;;
72  -v)
73   shift
74   version="-v $1"
75   ;;
76  --help)
77   echo "$0 -dn -h <hosts> -p <prefix> -s <source> -t <targets> -v <version>"
78   exit 2
79   ;;
80  *)
81   terminate "error: invalid option (try --help): $1"
82   ;;
83 esac
84 shift
85done
86
87echo "$command_line" > $log
88
89scripts=$(dirname $0)
90
91$scripts/build-rpms.sh -i $debug $no_run $prefix $source $targets $hosts $version 2>&1 | tee -a $log
92if [ ${PIPESTATUS[0]} -ne 0 ]; then
93 terminate "Making the RPM files."
94fi
95
96$scripts/build-exes.sh $debug $no_run $prefix $targets $relocation 2>&1 | tee -a $log
97if [ ${PIPESTATUS[0]} -ne 0 ]; then
98 terminate "Making the executable files."
99fi
100
101exit 0
Note: See TracBrowser for help on using the repository browser.