mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-04-20 22:13:47 +00:00
Merge pull request #842 from liamcottle/feature/custom-build-flags
Build Script Improvements
This commit is contained in:
commit
0beaa323ed
1 changed files with 7 additions and 4 deletions
11
build.sh
11
build.sh
|
|
@ -47,8 +47,8 @@ build_firmware() {
|
|||
# e.g: RAK_4631_Repeater-v1.0.0-SHA
|
||||
FIRMWARE_FILENAME="$1-${FIRMWARE_VERSION_STRING}"
|
||||
|
||||
# export build flags for pio so we can inject firmware version info
|
||||
export PLATFORMIO_BUILD_FLAGS="-DFIRMWARE_BUILD_DATE='\"${FIRMWARE_BUILD_DATE}\"' -DFIRMWARE_VERSION='\"${FIRMWARE_VERSION_STRING}\"'"
|
||||
# add firmware version info to end of existing platformio build flags in environment vars
|
||||
export PLATFORMIO_BUILD_FLAGS="${PLATFORMIO_BUILD_FLAGS} -DFIRMWARE_BUILD_DATE='\"${FIRMWARE_BUILD_DATE}\"' -DFIRMWARE_VERSION='\"${FIRMWARE_VERSION_STRING}\"'"
|
||||
|
||||
# build firmware target
|
||||
pio run -e $1
|
||||
|
|
@ -143,8 +143,11 @@ mkdir -p out
|
|||
|
||||
# handle script args
|
||||
if [[ $1 == "build-firmware" ]]; then
|
||||
if [ "$2" ]; then
|
||||
build_firmware $2
|
||||
TARGETS=${@:2}
|
||||
if [ "$TARGETS" ]; then
|
||||
for env in $TARGETS; do
|
||||
build_firmware $env
|
||||
done
|
||||
else
|
||||
echo "usage: $0 build-firmware <target>"
|
||||
exit 1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue