-
Notifications
You must be signed in to change notification settings - Fork 143
/
build.sh
executable file
·81 lines (65 loc) · 1.33 KB
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#!/bin/bash
set -e
BUILD_DEVICE="yes"
MK_CLEAN="no"
MK_ALL="yes"
Config="Release"
if [[ "${BUILD_DEVICE}" == "yes" ]]; then
pushd device/${Config} >& /dev/null
if [[ "${MK_CLEAN}" == "yes" ]]; then
echo "*** Cleaning device library"
make clean
fi
if [[ "${MK_ALL}" == "yes" ]]; then
make --warn-undefined-variables BuildConfig=${Config} all
fi
popd >& /dev/null
pushd device/${Config} >& /dev/null
popd >& /dev/null
fi
mkdir -p ./host/${Config}
rm -f ./host/${Config}/fft2d_host.elf
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}g++ \
-Ofast -Wall -g0 \
-D__HOST__ \
-Dasm=__asm__ \
-Drestrict= \
-I/usr/include \
-I./device/src \
-I ${EPIPHANY_HOME}/tools/host/include \
-L ${EPIPHANY_HOME}/tools/host/lib \
-falign-loops=8 \
-funroll-loops \
-ffast-math \
-o "./host/${Config}/fft2d_host.elf" \
"./host/src/fft2d_host.c" \
-le-hal \
-le-loader \
-lIL \
-lILU \
-lILUT \
-ljpeg \
-lpthread \
-lrt
#echo "=== Building FFTW bemchmark program ==="
#
#gcc \
# -O0 \
# host/src/fftw.c \
# -o host/Release/fftw.elf \
# -L /usr/local/lib \
# -lfftw3f \
# -lm