diff --git a/.gitignore b/.gitignore index 3909b5d16..8e16c805d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,7 @@ .DS_STORE -.vscode \ No newline at end of file +.vscode + +**/env +**/venv +**/.env +**/.venv \ No newline at end of file diff --git a/firmware/cmake/generate_cubemx.mk b/firmware/cmake/generate_cubemx.mk index cd1eb8943..0402195bd 100644 --- a/firmware/cmake/generate_cubemx.mk +++ b/firmware/cmake/generate_cubemx.mk @@ -1,5 +1,6 @@ -ifeq ($(OS),Windows_NT) -# Convert windows backslash to regular slash +# Find the STM32CubeMX executable +ifeq ($(OS), Windows_NT) +# Convert Windows backslash to regular slash CUBEMX_PATH := $(subst \,/,$(shell where STM32CubeMX)) else # Linux / MacOS CUBEMX_PATH := $(shell which STM32CubeMX) @@ -7,7 +8,15 @@ endif # Find the JAVA which is installed with CubeMX. Spaces in path are escaped. space := $(subst ,, ) -CUBEMX_JAVA := $(dir $(subst $(space),\$(space),$(CUBEMX_PATH)))jre/bin/java + +ifeq ($(shell uname), Darwin) +# MacOS + CUBEMX_JAVA := $(dir $(subst $(space),\$(space),$(CUBEMX_PATH)))jre/Contents/Home/bin/java +else +# Windows / Linux + CUBEMX_JAVA := $(dir $(subst $(space),\$(space),$(CUBEMX_PATH)))jre/bin/java +endif + # Known bug: Expanding CUBEMX_JAVA twice does not work. IOC_FILE = board_config.ioc