-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmake.sh
executable file
·48 lines (41 loc) · 1.49 KB
/
make.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
#!/bin/sh
set -e
. ./make.config
if [ ! -d "${BSEC_DIR}" ]; then
echo 'BSEC directory missing.'
exit 1
fi
STATEFILE="./bsec_iaq.state"
if [ ! -f "${STATEFILE}" ]; then
touch "${STATEFILE}"
fi
echo 'Patching...'
patch=patches/${DIFF_FILE}
if patch -N --dry-run --silent ${BSEC_DIR}/examples/BSEC_Integration_Examples/examples/bsec_iot_example/bsec_integration.h \
< "${patch}" >/dev/null
then
echo 'Applying patch...'
patch ${BSEC_DIR}/examples/BSEC_Integration_Examples/examples/bsec_iot_example/bsec_integration.h < ${patch}
else
echo 'Already applied.'
fi
echo 'Compiling...'
gcc -Wall -Wno-unused-but-set-variable -Wno-unused-variable -static \
-std=gnu99 \
-pedantic \
-fcommon \
-g \
-I${BSEC_DIR}/examples/BSEC_Integration_Examples/src/bme68x \
-I${BSEC_DIR}/examples/BSEC_Integration_Examples/src/inc \
-I${BSEC_DIR}/examples/BSEC_Integration_Examples/examples/bsec_iot_example \
-I./src/bsec2-6-1-0_generic_release_22102024/algo/${BSEC_SOLUTION}/inc \
${BSEC_DIR}/examples/BSEC_Integration_Examples/src/bme68x/bme68x.c \
${BSEC_DIR}/examples/BSEC_Integration_Examples/src/bme68x/bme68x_defs.h \
${BSEC_DIR}/examples/BSEC_Integration_Examples/examples/bsec_iot_example/bsec_integration.c \
./bsec_bme68x.c \
-L"${BSEC_DIR}/algo/${BSEC_SOLUTION}/bin/${BSEC_PLATFORM}/${BSEC_ARCH}" -lalgobsec \
-lm -lrt \
-o bsec_bme68x
echo 'Compiled.'
cp ${BSEC_DIR}/algo/${BSEC_SOLUTION}/config/${BSEC_SENSOR}/${BSEC_SENSOR_CONFIG}/bsec_iaq.config .
echo 'Copied config.'