Skip to content

Commit 6814cfb

Browse files
ppannutoalistair23
authored andcommitted
lora: be more conservative in build script
avoid a wildcard with `rm -rf` in a script, and set the script to error out if it's somehow not in the directory we expect before `rm`'ing
1 parent a4f8402 commit 6814cfb

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

wip/lora/build-RadioLib.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
#!/usr/bin/env bash
22

3+
set -e
4+
35
pushd RadioLib/examples/NonArduino/Tock/
46

5-
rm -rf build-*
7+
rm -rf build-arm build-riscv
68

79
# Change the source to point to the current libtock-c directory
810
# Note, x-platform `sed -i` has odd, but particular syntax
@@ -21,7 +23,8 @@ cmake -G "CodeBlocks - Unix Makefiles" ..
2123
# This will fail to link, as it can't find the libtock-c libraries
2224
# That's fine for us though, as we just need to build the RadioLib
2325
# library, not the entire example application
24-
make -j4 2> /dev/null
26+
make -j4 2> /dev/null || true
27+
test -f RadioLib/libRadioLib.a || make
2528
cd ../
2629

2730
mkdir -p build-riscv
@@ -33,7 +36,8 @@ cmake -G "CodeBlocks - Unix Makefiles" -DRISCV_BUILD=1 ..
3336
# This will fail to link, as it can't find the libtock-c libraries
3437
# That's fine for us though, as we just need to build the RadioLib
3538
# library, not the entire example application
36-
make -j4 2> /dev/null
39+
make -j4 2> /dev/null || true
40+
test -f RadioLib/libRadioLib.a || make
3741
cd ../
3842

3943
popd

wip/lora/sensor-receive/Makefile

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,5 @@ LIBS_rv32imac += ../RadioLib/examples/NonArduino/Tock/build-riscv/RadioLib/libRa
2929
# building the application.
3030
include $(TOCK_USERLAND_BASE_DIR)/AppMakefile.mk
3131

32-
../RadioLib/examples/NonArduino/Tock/build-arm/RadioLib/libRadioLib.a:
33-
cd ../ && ./build-RadioLib.sh
34-
35-
../RadioLib/examples/NonArduino/Tock/build-riscv/RadioLib/libRadioLib.a:
32+
../RadioLib/examples/NonArduino/Tock/build-arm/RadioLib/libRadioLib.a ../RadioLib/examples/NonArduino/Tock/build-riscv/RadioLib/libRadioLib.a:
3633
cd ../ && ./build-RadioLib.sh

0 commit comments

Comments
 (0)