pull any variable from meta-info

This commit is contained in:
David Holdeman 2024-02-15 15:01:03 -06:00 committed by rusefillc
parent a725ef2cdd
commit 9eea807d55
64 changed files with 77 additions and 68 deletions

View File

@ -1,2 +1,2 @@
SHORT_BOARD_NAME=at_start_f435
BOARD_CPU=ARCH_AT32F4
PROJECT_CPU=ARCH_AT32F4

View File

@ -1,2 +1,2 @@
SHORT_BOARD_NAME=atlas
BOARD_CPU=ARCH_STM32H7
PROJECT_CPU=ARCH_STM32H7

View File

@ -8,7 +8,8 @@ if [ -z "$1" ]; then
fi
BOARD_META_PATH=./$1
export BOARD_DIR=${BOARD_META_PATH%/*}
BOARD_META_DIR=${BOARD_META_PATH%/*}
export BOARD_DIR=${BOARD_DIR:-$BOARD_META_DIR}
if [ ! -f ${BOARD_META_PATH} ]; then
echo "Read meta.env: The file was not found!"
@ -21,12 +22,16 @@ fi
echo "[META] Reading meta env from ${BOARD_META_PATH}"
export SHORT_BOARD_NAME="$(grep "SHORT_BOARD_NAME=" ${BOARD_META_PATH} | cut -d'=' -f2)"
export PROJECT_CPU="$(grep "BOARD_CPU=" ${BOARD_META_PATH} | cut -d'=' -f2)"
export POST_BUILD_SCRIPT="$(grep "POST_BUILD_SCRIPT=" ${BOARD_META_PATH} | cut -d'=' -f2)"
VARS=$(grep "=" "$BOARD_META_PATH")
# todo: is PROJECT_BOARD always the same as SHORT_BOARD_NAME?
export PROJECT_BOARD=${SHORT_BOARD_NAME}
while IFS= read -r L; do
# get the key and delete all spaces
K=$(echo "$L" | cut -d '=' -f "-1" | tr -d ' ')
# get the value and delete any leading space
V=$(echo "$L" | cut -d '=' -f "2-" | awk '{$1=$1};1')
# put them together, closing the value in quotes
export $K="$V"
done <<< "$VARS"
echo "[META] PROJECT_BOARD=${PROJECT_BOARD}"
echo "[META] PROJECT_CPU=${PROJECT_CPU}"

View File

@ -1,2 +1,2 @@
SHORT_BOARD_NAME=cypress
BOARD_CPU=custom_platform
PROJECT_CPU=custom_platform

View File

@ -1,2 +1,2 @@
SHORT_BOARD_NAME=f407-discovery
BOARD_CPU=ARCH_STM32F4
PROJECT_CPU=ARCH_STM32F4

View File

@ -1,2 +1,2 @@
SHORT_BOARD_NAME=f407-discovery
BOARD_CPU=ARCH_STM32F4
PROJECT_CPU=ARCH_STM32F4

View File

@ -1,2 +1,2 @@
SHORT_BOARD_NAME=haba208
BOARD_CPU=ARCH_STM32F4
PROJECT_CPU=ARCH_STM32F4

View File

@ -1,2 +1,2 @@
SHORT_BOARD_NAME=f429-discovery
BOARD_CPU=ARCH_STM32F4
PROJECT_CPU=ARCH_STM32F4

View File

@ -1,2 +1,2 @@
SHORT_BOARD_NAME=f469-discovery
BOARD_CPU=ARCH_STM32F4
PROJECT_CPU=ARCH_STM32F4

View File

@ -1,2 +1,2 @@
SHORT_BOARD_NAME=frankenso_na6
BOARD_CPU=ARCH_STM32F4
PROJECT_CPU=ARCH_STM32F4

View File

@ -1,2 +1,2 @@
SHORT_BOARD_NAME=alphax-2chan
BOARD_CPU=ARCH_STM32F4
PROJECT_CPU=ARCH_STM32F4

View File

@ -1,2 +1,2 @@
SHORT_BOARD_NAME=alphax-4chan
BOARD_CPU=ARCH_STM32F4
PROJECT_CPU=ARCH_STM32F4

View File

@ -1,2 +1,2 @@
SHORT_BOARD_NAME=alphax-4chan_f7
BOARD_CPU=ARCH_STM32F7
PROJECT_CPU=ARCH_STM32F7

View File

@ -1,2 +1,2 @@
SHORT_BOARD_NAME=alphax-8chan-revA
BOARD_CPU=ARCH_STM32F4
PROJECT_CPU=ARCH_STM32F4

View File

@ -1,2 +1,2 @@
SHORT_BOARD_NAME=alphax-8chan
BOARD_CPU=ARCH_STM32F4
PROJECT_CPU=ARCH_STM32F4

View File

@ -1,2 +1,2 @@
SHORT_BOARD_NAME=alphax-8chan
BOARD_CPU=ARCH_STM32F4
PROJECT_CPU=ARCH_STM32F4

View File

@ -1,2 +1,2 @@
SHORT_BOARD_NAME=alphax-8chan_f7
BOARD_CPU=ARCH_STM32F7
PROJECT_CPU=ARCH_STM32F7

View File

@ -1,2 +1,2 @@
SHORT_BOARD_NAME=hellen-112-17
BOARD_CPU=ARCH_STM32F4
PROJECT_CPU=ARCH_STM32F4

View File

@ -1,2 +1,2 @@
SHORT_BOARD_NAME=hellen-112-17
BOARD_CPU=ARCH_STM32F4
PROJECT_CPU=ARCH_STM32F4

View File

@ -1,2 +1,2 @@
SHORT_BOARD_NAME=hellen-gm-e67
BOARD_CPU=ARCH_STM32F4
PROJECT_CPU=ARCH_STM32F4

View File

@ -1,2 +1,2 @@
SHORT_BOARD_NAME=hellen-honda-k
BOARD_CPU=ARCH_STM32F4
PROJECT_CPU=ARCH_STM32F4

View File

@ -1,2 +1,2 @@
SHORT_BOARD_NAME=hellen-honda-k
BOARD_CPU=ARCH_STM32F4
PROJECT_CPU=ARCH_STM32F4

View File

@ -1,2 +1,2 @@
SHORT_BOARD_NAME=hellen-nb1
BOARD_CPU=ARCH_STM32F4
PROJECT_CPU=ARCH_STM32F4

View File

@ -1,2 +1,2 @@
SHORT_BOARD_NAME=hellen121nissan
BOARD_CPU=ARCH_STM32F4
PROJECT_CPU=ARCH_STM32F4

View File

@ -1,2 +1,2 @@
SHORT_BOARD_NAME=hellen121vag
BOARD_CPU=ARCH_STM32F4
PROJECT_CPU=ARCH_STM32F4

View File

@ -1,2 +1,2 @@
SHORT_BOARD_NAME=hellen128
BOARD_CPU=ARCH_STM32F4
PROJECT_CPU=ARCH_STM32F4

View File

@ -1,2 +1,2 @@
SHORT_BOARD_NAME=hellen154hyundai
BOARD_CPU=ARCH_STM32F4
PROJECT_CPU=ARCH_STM32F4

View File

@ -1,2 +1,2 @@
SHORT_BOARD_NAME=hellen154hyundai_f7
BOARD_CPU=ARCH_STM32F7
PROJECT_CPU=ARCH_STM32F7

View File

@ -1,2 +1,2 @@
SHORT_BOARD_NAME=hellenNA6
BOARD_CPU=ARCH_STM32F4
PROJECT_CPU=ARCH_STM32F4

View File

@ -1,2 +1,2 @@
SHORT_BOARD_NAME=hellen72
BOARD_CPU=ARCH_STM32F4
PROJECT_CPU=ARCH_STM32F4

View File

@ -1,2 +1,2 @@
SHORT_BOARD_NAME=hellen81
BOARD_CPU=ARCH_STM32H7
PROJECT_CPU=ARCH_STM32H7

View File

@ -1,2 +1,2 @@
SHORT_BOARD_NAME=hellen88bmw
BOARD_CPU=ARCH_STM32F4
PROJECT_CPU=ARCH_STM32F4

View File

@ -1,2 +1,2 @@
SHORT_BOARD_NAME=hellen88bmw
BOARD_CPU=ARCH_STM32F4
PROJECT_CPU=ARCH_STM32F4

View File

@ -1,2 +1,2 @@
SHORT_BOARD_NAME=hellenNA8_96
BOARD_CPU=ARCH_STM32F4
PROJECT_CPU=ARCH_STM32F4

View File

@ -1,2 +1,2 @@
SHORT_BOARD_NAME=small-can-board
BOARD_CPU=ARCH_STM32F4
PROJECT_CPU=ARCH_STM32F4

View File

@ -1,2 +1,2 @@
SHORT_BOARD_NAME=small-can-board
BOARD_CPU=ARCH_STM32F4
PROJECT_CPU=ARCH_STM32F4

View File

@ -1,2 +1,2 @@
SHORT_BOARD_NAME=uaefi
BOARD_CPU=ARCH_STM32F4
PROJECT_CPU=ARCH_STM32F4

View File

@ -1,2 +1,2 @@
SHORT_BOARD_NAME=kin
BOARD_CPU=custom_platform
PROJECT_CPU=custom_platform

View File

@ -1,2 +1,2 @@
SHORT_BOARD_NAME=m74_9
BOARD_CPU=ARCH_AT32F4
PROJECT_CPU=ARCH_AT32F4

View File

@ -1,2 +1,2 @@
SHORT_BOARD_NAME=mre_f4
BOARD_CPU=ARCH_STM32F4
PROJECT_CPU=ARCH_STM32F4

View File

@ -1,2 +1,2 @@
SHORT_BOARD_NAME=mre_f4
BOARD_CPU=ARCH_STM32F7
PROJECT_CPU=ARCH_STM32F7

View File

@ -1,2 +1,2 @@
SHORT_BOARD_NAME=nucleo_f413
BOARD_CPU=ARCH_STM32F4
PROJECT_CPU=ARCH_STM32F4

View File

@ -1,2 +1,2 @@
SHORT_BOARD_NAME=stm32f429_nucleo
BOARD_CPU=ARCH_STM32F4
PROJECT_CPU=ARCH_STM32F4

View File

@ -1,2 +1,2 @@
SHORT_BOARD_NAME=stm32f767_nucleo
BOARD_CPU=ARCH_STM32F7
PROJECT_CPU=ARCH_STM32F7

View File

@ -1,2 +1,2 @@
SHORT_BOARD_NAME=stm32f767_nucleo
BOARD_CPU=ARCH_STM32F7
PROJECT_CPU=ARCH_STM32F7

View File

@ -1,2 +1,2 @@
SHORT_BOARD_NAME=stm32f767_nucleo
BOARD_CPU=ARCH_STM32F7
PROJECT_CPU=ARCH_STM32F7

View File

@ -1,2 +1,2 @@
SHORT_BOARD_NAME=stm32h743_nucleo
BOARD_CPU=ARCH_STM32H7
PROJECT_CPU=ARCH_STM32H7

View File

@ -1,2 +1,2 @@
SHORT_BOARD_NAME=prometheus_405
BOARD_CPU=ARCH_STM32F4
PROJECT_CPU=ARCH_STM32F4

View File

@ -1,2 +1,2 @@
SHORT_BOARD_NAME=prometheus_469
BOARD_CPU=ARCH_STM32F4
PROJECT_CPU=ARCH_STM32F4

View File

@ -1,2 +1,2 @@
SHORT_BOARD_NAME=proteus_f4
BOARD_CPU=ARCH_STM32F4
PROJECT_CPU=ARCH_STM32F4

View File

@ -1,2 +1,2 @@
SHORT_BOARD_NAME=proteus_f4
BOARD_CPU=ARCH_STM32F4
PROJECT_CPU=ARCH_STM32F4

View File

@ -1,2 +1,2 @@
SHORT_BOARD_NAME=proteus_f4
BOARD_CPU=ARCH_STM32F4
PROJECT_CPU=ARCH_STM32F4

View File

@ -1,2 +1,2 @@
SHORT_BOARD_NAME=proteus_f7
BOARD_CPU=ARCH_STM32F7
PROJECT_CPU=ARCH_STM32F7

View File

@ -1,2 +1,2 @@
SHORT_BOARD_NAME=proteus_f7
BOARD_CPU=ARCH_STM32F7
PROJECT_CPU=ARCH_STM32F7

View File

@ -1,2 +1,2 @@
SHORT_BOARD_NAME=proteus_f7
BOARD_CPU=ARCH_STM32F7
PROJECT_CPU=ARCH_STM32F7

View File

@ -1,2 +1,2 @@
SHORT_BOARD_NAME=proteus_h7
BOARD_CPU=ARCH_STM32H7
PROJECT_CPU=ARCH_STM32H7

View File

@ -1,2 +1,2 @@
SHORT_BOARD_NAME=proteus_h7
BOARD_CPU=ARCH_STM32H7
PROJECT_CPU=ARCH_STM32H7

View File

@ -1,2 +1,2 @@
SHORT_BOARD_NAME=proteus_f7
BOARD_CPU=ARCH_STM32F7
PROJECT_CPU=ARCH_STM32F7

View File

@ -1,2 +1,2 @@
SHORT_BOARD_NAME=s105
BOARD_CPU=ARCH_STM32F4
PROJECT_CPU=ARCH_STM32F4

View File

@ -1,2 +1,2 @@
SHORT_BOARD_NAME=subaru_eg33_f7
BOARD_CPU=ARCH_STM32F7
PROJECT_CPU=ARCH_STM32F7

View File

@ -1,2 +1,2 @@
SHORT_BOARD_NAME=subaru_eg33_f7
BOARD_CPU=ARCH_STM32F7
PROJECT_CPU=ARCH_STM32F7

View File

@ -1,2 +1,2 @@
SHORT_BOARD_NAME=tdg-pdm8
BOARD_CPU=ARCH_STM32F4
PROJECT_CPU=ARCH_STM32F4

View File

@ -1,2 +1,2 @@
SHORT_BOARD_NAME=t-b-g
BOARD_CPU=ARCH_STM32F4
PROJECT_CPU=ARCH_STM32F4

View File

@ -18,8 +18,12 @@ $(error Please run 'make' again. Please make sure you have 'git' command in PATH
endif
ifeq ($(PROJECT_BOARD),)
ifneq ($(SHORT_BOARD_NAME),)
PROJECT_BOARD = $(SHORT_BOARD_NAME)
else
PROJECT_BOARD = f407-discovery
endif
endif
BOARDS_DIR = $(PROJECT_DIR)/config/boards