summaryrefslogtreecommitdiff
path: root/schulung_tools/rootfs_basic/scripts/build_hello.sh
diff options
context:
space:
mode:
Diffstat (limited to 'schulung_tools/rootfs_basic/scripts/build_hello.sh')
-rwxr-xr-xschulung_tools/rootfs_basic/scripts/build_hello.sh14
1 files changed, 14 insertions, 0 deletions
diff --git a/schulung_tools/rootfs_basic/scripts/build_hello.sh b/schulung_tools/rootfs_basic/scripts/build_hello.sh
new file mode 100755
index 0000000..c9a06ff
--- /dev/null
+++ b/schulung_tools/rootfs_basic/scripts/build_hello.sh
@@ -0,0 +1,14 @@
+#!/bin/sh
+set -e
+
+export CROSS_COMPILE=/opt/gcc-linaro-6.3.1-2017.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-
+
+cd ../src/hello
+
+${CROSS_COMPILE}gcc -c -fPIC file1.c file2.c
+${CROSS_COMPILE}gcc -shared -Wl,-soname,libhello.so.0 -olibhello.so.0.0.1 file1.o file2.o
+ln -sf libhello.so.0.0.1 libhello.so
+${CROSS_COMPILE}gcc -ohello hello.c -L. -lhello
+
+# check dependencies
+${CROSS_COMPILE}objdump -x hello | grep NEEDED