source: rtems/c/src/lib/libbsp/bare/build-tools @ 5a23ca84

4.104.114.84.95
Last change on this file since 5a23ca84 was cf65c408, checked in by Joel Sherrill <joel.sherrill@…>, on 06/27/98 at 20:01:28

Bare BSP patch from Chris Johns <cjohns@…>. He also
sent an example bare bsp but we have not decided how to integrate it yet.

  • Property mode set to 100644
File size: 881 bytes
Line 
1#
2# $Id$
3#
4# Tools to help doing build scripts. Adapted from Joel's bit
5# script.
6#
7
8#
9# USERCHANGE - uncomment this if you want to watch the commands.
10#
11# set -x
12
13start=`date`
14
15#
16# Common exit routine for this script so we can print the starting
17# and ending times.
18#
19
20my_exit()
21{
22  stop=`date`
23
24  echo
25  echo "Started:  " $start
26  echo "Finished: " $stop
27  exit $1
28}
29
30#
31# Handle a fatal error.
32#
33
34fatal_error()
35{
36  echo "ERROR: $*" >&2
37  my_exit 1
38}
39
40#
41# Checks the status returned by executables and exits if it is non-zero.
42#
43
44check_fatal()
45{
46  if [ $1 -ne 0 ] ; then
47    shift
48    fatal_error $*
49  fi
50}
51
52#
53# Test for a valid path, exit if not found
54#
55
56test_path()
57{
58  test -d $* || fatal_error "cannot find $*"
59  return 0
60}
61
62#
63# Create a directory and check it was made correctly.
64#
65
66checked_mkdir()
67{
68  mkdir -p $1
69  check_fatal $? "unable to make directory $1"
70  return 0
71}
Note: See TracBrowser for help on using the repository browser.