source: rtems-tools/linkers/mkapp.sh

Last change on this file was 8f0740b, checked in by Chris Johns <chrisj@…>, on Oct 22, 2012 at 2:12:29 PM

Script to test the linker. Run after building the linker.

  • Property mode set to 100755
File size: 950 bytes
Line 
1#! /bin/sh
2#
3# Make an application using the object files in the RTL application.
4# Please build the RTL application first.
5#
6
7if [ $# -ne 2 ]; then
8  echo "error: bad arguments: ./mkapp <path to RTL app> <path to C compiler>"
9  exit 2
10fi
11
12if [ ! -d $1 ]; then
13  echo "error: not a directory: $1"
14  exit 3
15fi
16
17if [ ! -f $2 ]; then
18  echo "error: not a file: $2"
19  exit 3
20fi
21
22o1="$1/xa.c.1.o"
23o2="$1/x-long-name-to-create-gnu-extension-in-archive.c.1.o"
24
25if [ ! -e ${o1} ]; then
26  echo "error: cannot find: ${o1}"
27  exit 4
28fi
29
30if [ ! -e ${o2} ]; then
31  echo "error: cannot find: ${o2}"
32  exit 4
33fi
34
35case $(uname -s) in
36  Darwin) platform="darwin" ;;
37  Linux)  platform="linux2" ;;
38  WIN32)  platform="win32" ;;
39  *)
40    echo "error: unsupported platform"
41    exit 5
42esac
43
44echo "./build-${platform}/rtems-ld -S --base $1/rtld --cc $2 -o rtl-app.rap ${o1} ${o2}"
45./build-${platform}/rtems-ld -S --base $1/rtld --cc $2 -o rtl-app.rap ${o1} ${o2}
46
47exit 0
Note: See TracBrowser for help on using the repository browser.