1
0
mirror of https://github.com/aolofsson/oh.git synced 2025-02-07 06:44:09 +08:00
oh/elink/sw/burst-test/build.sh
aolofsson 289024fd89 Flattening directory tree (again)
- Creating an arbitrary 'src' directory really doesn't help much...
- Goal is to make each folder self contained
- Make meta repos and individual repos have the same directory structure
2022-06-21 14:48:48 -04:00

34 lines
662 B
Bash
Executable File

#!/bin/bash
set -e
ESDK=${EPIPHANY_HOME}
ELIBS="-L ${ESDK}/tools/host/lib"
EINCS="-I ${ESDK}/tools/host/include"
ELDF=${ESDK}/bsps/current/internal.ldf
# Create the binaries directory
mkdir -p bin/
if [ -z "${CROSS_COMPILE+xxx}" ]; then
case $(uname -p) in
arm*)
# Use native arm compiler (no cross prefix)
CROSS_COMPILE=
;;
*)
# Use cross compiler
CROSS_COMPILE="arm-linux-gnueabihf-"
;;
esac
fi
# Build HOST side application
${CROSS_COMPILE}gcc src/main.c -g -o bin/main.elf ${EINCS} ${ELIBS} -le-hal -le-loader -lpthread
# Build DEVICE side program
OPT=3
e-gcc -g -T ${ELDF} -O${OPT} src/emain.c src/etest.S -o bin/emain.elf -le-lib