summaryrefslogtreecommitdiff
path: root/linkers/mkapp.sh
diff options
context:
space:
mode:
authorChris Johns <chrisj@rtems.org>2012-10-22 07:12:29 -0700
committerChris Johns <chrisj@rtems.org>2012-10-22 07:12:29 -0700
commit8f0740b7c734fe2f6e300894ad9aa685792358c1 (patch)
treea5473989a992c4741d939078a4357c70c39cea68 /linkers/mkapp.sh
parent898fa1327f332920b974e9a96023ce1817caa184 (diff)
Script to test the linker. Run after building the linker.
Diffstat (limited to 'linkers/mkapp.sh')
-rwxr-xr-xlinkers/mkapp.sh47
1 files changed, 47 insertions, 0 deletions
diff --git a/linkers/mkapp.sh b/linkers/mkapp.sh
new file mode 100755
index 0000000..4954ab2
--- /dev/null
+++ b/linkers/mkapp.sh
@@ -0,0 +1,47 @@
+#! /bin/sh
+#
+# Make an application using the object files in the RTL application.
+# Please build the RTL application first.
+#
+
+if [ $# -ne 2 ]; then
+ echo "error: bad arguments: ./mkapp <path to RTL app> <path to C compiler>"
+ exit 2
+fi
+
+if [ ! -d $1 ]; then
+ echo "error: not a directory: $1"
+ exit 3
+fi
+
+if [ ! -f $2 ]; then
+ echo "error: not a file: $2"
+ exit 3
+fi
+
+o1="$1/xa.c.1.o"
+o2="$1/x-long-name-to-create-gnu-extension-in-archive.c.1.o"
+
+if [ ! -e ${o1} ]; then
+ echo "error: cannot find: ${o1}"
+ exit 4
+fi
+
+if [ ! -e ${o2} ]; then
+ echo "error: cannot find: ${o2}"
+ exit 4
+fi
+
+case $(uname -s) in
+ Darwin) platform="darwin" ;;
+ Linux) platform="linux2" ;;
+ WIN32) platform="win32" ;;
+ *)
+ echo "error: unsupported platform"
+ exit 5
+esac
+
+echo "./build-${platform}/rtems-ld -S --base $1/rtld --cc $2 -o rtl-app.rap ${o1} ${o2}"
+./build-${platform}/rtems-ld -S --base $1/rtld --cc $2 -o rtl-app.rap ${o1} ${o2}
+
+exit 0