summaryrefslogtreecommitdiff
path: root/schulung_tools/rootfs_basic/scripts/build_hello.sh
blob: c9a06ff3c545d44022f4885fd36dccdeac89e452 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
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