#Cannot build from source on MacOS, makefile cannot find SYSTEM_HSE_MHZ

3 messages · Page 1 of 1 (latest)

restive hound
#

Cannot build from source on MacOS, makefile cannot find SYSTEM_HSE_MHZ

#

mk/config.mk:37 is the following

HSE_VALUE_MHZ := $(shell sed -E -n "/^\s*#\sdefine\s+SYSTEM_HSE_MHZ\s+([0-9]+)./s//\1/p" $(CONFIG_HEADER_FILE))

Testing this sed command returns nothing

sed -E -n "/^\s*#\sdefine\s+SYSTEM_HSE_MHZ\s+([0-9]+)./s//\1/p" src/config/configs/AIKONF4/config.h

Claude thinks this is because the sed syntax used is for GNU sed and isn't compatible with the BSD sed used on MacOS and suggested trying

sed -n 's/^[[:space:]]#[[:space:]]define[[:space:]]SYSTEM_HSE_MHZ[[:space:]]([0-9][0-9])./\1/p' src/config/configs/AIKONF4/config.h

Which returns 8 as defined in the config file. But when I update line 37 in config.mk with this, I still get the same error

HSE_VALUE_MHZ := $(shell sed -n 's/^[[:space:]]#[[:space:]]define[[:space:]]SYSTEM_HSE_MHZ[[:space:]]([0-9][0-9])./\1/p' $(CONFIG_HEADER_FILE))

#

Whoops I thought I was on 4.5.1 but I think I was actually on git head, checking out 4.5.1 seems to have fixed it, doing a git blame it seems like it might be this commit
https://github.com/betaflight/betaflight/commit/059ada4e4b9a27182d287df02fdc57327288f9aa

GitHub
  • Filter comment line while try to get SYSTEM_HSE_MHZ value.

  • use sed to find correct SYSTEM_HSE_MHZ

  • get TARGET EXST_ADJUST_VMA value through sed and remove GYRO_DEFINE

  • improve get FC_VMA_A...