deduplicate $(BOARD_DIR) in makefiles (#5024)

* calculate BOARD_DIR exactly once

* deduplicate board scripts

* unit tests

* make passes variables to openblt build properly

* was this an intentional omission?

* s

* prometheus

* prometheus
This commit is contained in:
Matthew Kennedy 2023-02-01 11:41:27 -08:00 committed by GitHub
parent 0aba3d0ce6
commit cc6cadfdd6
43 changed files with 64 additions and 121 deletions

View File

@ -164,9 +164,8 @@ MAKEFLAGS += ${NUMJOBS}
# Project, sources and paths # Project, sources and paths
# #
BOARDS_DIR = $(PROJECT_DIR)/config/boards BOARDINC = $(BOARD_DIR)
include $(BOARD_DIR)/board.mk
include $(PROJECT_DIR)/config/boards/$(PROJECT_BOARD)/board.mk
# Include various ChibiOS mk files # Include various ChibiOS mk files
# Licensing files. # Licensing files.
@ -222,6 +221,7 @@ ifeq ($(USE_OPENBLT),yes)
endif endif
$(info PROJECT_BOARD: $(PROJECT_BOARD)) $(info PROJECT_BOARD: $(PROJECT_BOARD))
$(info BOARD_DIR: $(BOARD_DIR))
$(info PROJECT_CPU: $(PROJECT_CPU)) $(info PROJECT_CPU: $(PROJECT_CPU))
$(info CPU_HWLAYER: $(CPU_HWLAYER)) $(info CPU_HWLAYER: $(CPU_HWLAYER))
$(info CONFDIR: $(CONFDIR)) $(info CONFDIR: $(CONFDIR))
@ -378,10 +378,10 @@ ULIBS = -lm --specs=nano.specs -Wl,--sort-section=alignment
include $(RULESFILE) include $(RULESFILE)
openblt: openblt:
make -f $(PROJECT_DIR)/hw_layer/openblt/openblt.mk make -f $(PROJECT_DIR)/hw_layer/openblt/openblt.mk BOARD_DIR=$(BOARD_DIR) PROJECT_BOARD=$(PROJECT_BOARD) PROJECT_CPU=$(PROJECT_CPU)
openblt_clean: openblt_clean:
make -f $(PROJECT_DIR)/hw_layer/openblt/openblt.mk clean make -f $(PROJECT_DIR)/hw_layer/openblt/openblt.mk clean BOARD_DIR=$(BOARD_DIR) PROJECT_BOARD=$(PROJECT_BOARD) PROJECT_CPU=$(PROJECT_CPU)
# Enable precompiled header # Enable precompiled header
include rusefi_pch.mk include rusefi_pch.mk

View File

@ -160,7 +160,8 @@ include $(CHIBIOS)/os/various/cpp_wrappers/chcpp.mk
# EX files (optional). # EX files (optional).
include $(CHIBIOS)/os/hal/lib/streams/streams.mk include $(CHIBIOS)/os/hal/lib/streams/streams.mk
include $(CONFIG)/boards/$(PROJECT_BOARD)/board.mk BOARDINC = $(BOARD_DIR)
include $(BOARD_DIR)/board.mk
include $(PROJECT_DIR)/init/init.mk include $(PROJECT_DIR)/init/init.mk
include $(PROJECT_DIR)/util/util.mk include $(PROJECT_DIR)/util/util.mk

View File

@ -33,7 +33,7 @@ ALLINC += \
$(CONSOLE_INC) \ $(CONSOLE_INC) \
$(DEVELOPMENT_DIR) \ $(DEVELOPMENT_DIR) \
$(PROJECT_DIR)/config/engines \ $(PROJECT_DIR)/config/engines \
$(PROJECT_DIR)/config/boards/ \ $(BOARDS_DIR) \
$(PROJECT_DIR)/hw_layer/algo \ $(PROJECT_DIR)/hw_layer/algo \
$(PROJECT_DIR)/init \ $(PROJECT_DIR)/init \
$(PROJECT_DIR)/ext_algo \ $(PROJECT_DIR)/ext_algo \

View File

@ -1,7 +1,5 @@
# List of all the board related files. # List of all the board related files.
BOARDCPPSRC = $(PROJECT_DIR)/config/boards/48way/board_configuration.cpp BOARDCPPSRC = $(BOARD_DIR)/board_configuration.cpp
BOARDINC = $(PROJECT_DIR)/config/boards/48way
# Override DEFAULT_ENGINE_TYPE # Override DEFAULT_ENGINE_TYPE
DDEFS += -DSHORT_BOARD_NAME=48way DDEFS += -DSHORT_BOARD_NAME=48way

View File

@ -1,8 +1,6 @@
# List of all the board related files. # List of all the board related files.
BOARDCPPSRC = $(PROJECT_DIR)/config/boards/BB_V2/board_configuration.cpp \ BOARDCPPSRC = $(BOARD_DIR)/board_configuration.cpp \
$(PROJECT_DIR)/config/boards/proteus/adc_hack.cpp $(BOARDS_DIR)/proteus/adc_hack.cpp
BOARDINC = $(PROJECT_DIR)/config/boards/BB_V2
# Override DEFAULT_ENGINE_TYPE # Override DEFAULT_ENGINE_TYPE
DDEFS += -DSTM32F407xx DDEFS += -DSTM32F407xx

View File

@ -1,8 +1,6 @@
# List of all the board related files. # List of all the board related files.
BOARDCPPSRC = $(PROJECT_DIR)/config/boards/BB_V3/board_configuration.cpp \ BOARDCPPSRC = $(BOARD_DIR)/board_configuration.cpp \
$(PROJECT_DIR)/config/boards/proteus/adc_hack.cpp $(BOARDS_DIR)/proteus/adc_hack.cpp
BOARDINC = $(PROJECT_DIR)/config/boards/BB_V3
# Override DEFAULT_ENGINE_TYPE # Override DEFAULT_ENGINE_TYPE
DDEFS += -DSTM32F407xx DDEFS += -DSTM32F407xx

View File

@ -1,7 +1,5 @@
# List of all the board related files. # List of all the board related files.
BOARDCPPSRC = $(PROJECT_DIR)/config/boards/atlas/board_configuration.cpp BOARDCPPSRC = $(BOARD_DIR)/board_configuration.cpp
BOARDINC = $(PROJECT_DIR)/config/boards/atlas
#DDEFS += -DLED_CRITICAL_ERROR_BRAIN_PIN=Gpio::E3 #DDEFS += -DLED_CRITICAL_ERROR_BRAIN_PIN=Gpio::E3
DDEFS += -DFIRMWARE_ID=\"atlas\" DDEFS += -DFIRMWARE_ID=\"atlas\"

View File

@ -1,8 +1,7 @@
#!/bin/bash #!/bin/bash
#exporting for OpenBlt Makefile PROJECT_BOARD=$1
export PROJECT_BOARD=$1 PROJECT_CPU=$2
export PROJECT_CPU=$2
# fail on error # fail on error
set -e set -e
@ -17,7 +16,7 @@ mkdir -p .dep
make -j$(nproc) -r PROJECT_BOARD=$PROJECT_BOARD PROJECT_CPU=$PROJECT_CPU make -j$(nproc) -r PROJECT_BOARD=$PROJECT_BOARD PROJECT_CPU=$PROJECT_CPU
[ -e build/rusefi.hex ] || { echo "FAILED to compile by $SCRIPT_NAME with $PROJECT_BOARD $DEBUG_LEVEL_OPT and $EXTRA_PARAMS"; exit 1; } [ -e build/rusefi.hex ] || { echo "FAILED to compile by $SCRIPT_NAME with $PROJECT_BOARD $DEBUG_LEVEL_OPT and $EXTRA_PARAMS"; exit 1; }
if [ "$USE_OPENBLT" = "yes" ]; then if [ "$USE_OPENBLT" = "yes" ]; then
make openblt make openblt PROJECT_BOARD=$PROJECT_BOARD PROJECT_CPU=$PROJECT_CPU
[ -e build-openblt/openblt_$PROJECT_BOARD.hex ] || { echo "FAILED to compile OpenBLT by $SCRIPT_NAME with $PROJECT_BOARD"; exit 1; } [ -e build-openblt/openblt_$PROJECT_BOARD.hex ] || { echo "FAILED to compile OpenBLT by $SCRIPT_NAME with $PROJECT_BOARD"; exit 1; }
fi fi

View File

@ -1,7 +1,5 @@
# List of all the board related files. # List of all the board related files.
BOARDCPPSRC = $(PROJECT_DIR)/config/boards/core8/board_configuration.cpp BOARDCPPSRC = $(BOARD_DIR)/board_configuration.cpp
BOARDINC = $(PROJECT_DIR)/config/boards/core8
# Override DEFAULT_ENGINE_TYPE # Override DEFAULT_ENGINE_TYPE
DDEFS += -DSHORT_BOARD_NAME=core8 DDEFS += -DSHORT_BOARD_NAME=core8

View File

@ -1,8 +1,6 @@
# List of all the board related files. # List of all the board related files.
BOARDCPPSRC = $(PROJECT_DIR)/config/boards/coreECU/board_configuration.cpp \ BOARDCPPSRC = $(BOARD_DIR)/board_configuration.cpp \
$(PROJECT_DIR)/config/boards/proteus/adc_hack.cpp $(BOARDS_DIR)/proteus/adc_hack.cpp
BOARDINC = $(PROJECT_DIR)/config/boards/coreECU
# Override DEFAULT_ENGINE_TYPE # Override DEFAULT_ENGINE_TYPE
DDEFS += -DSTM32F407xx DDEFS += -DSTM32F407xx

View File

@ -1,5 +1,5 @@
# List of all the board related files. # List of all the board related files.
BOARDCPPSRC = $(PROJECT_DIR)/config/boards/f407-discovery/board_extra.cpp BOARDCPPSRC = $(BOARD_DIR)/board_extra.cpp
# MCU defines # MCU defines
DDEFS += -DSTM32F407xx DDEFS += -DSTM32F407xx

View File

@ -1,13 +1,9 @@
BOARD_DIR = $(PROJECT_DIR)/config/boards/$(PROJECT_BOARD)
HALCONFDIR = $(BOARD_DIR) HALCONFDIR = $(BOARD_DIR)
# List of all the board related files. # List of all the board related files.
BOARDCPPSRC = $(BOARD_DIR)/board_configuration.cpp BOARDCPPSRC = $(BOARD_DIR)/board_configuration.cpp
# Required include directories # Required include directories
BOARDINC = $(BOARD_DIR)
# STM32F429 has FSMC with SDRAM support # STM32F429 has FSMC with SDRAM support
DDEFS += -DFIRMWARE_ID=\"stm32f429\" DDEFS += -DFIRMWARE_ID=\"stm32f429\"
IS_STM32F429 = yes IS_STM32F429 = yes

View File

@ -1,13 +1,9 @@
BOARD_DIR = $(PROJECT_DIR)/config/boards/$(PROJECT_BOARD)
HALCONFDIR = $(BOARD_DIR) HALCONFDIR = $(BOARD_DIR)
# List of all the board related files. # List of all the board related files.
BOARDCPPSRC = $(BOARD_DIR)/board_configuration.cpp BOARDCPPSRC = $(BOARD_DIR)/board_configuration.cpp
# Required include directories # Required include directories
BOARDINC = $(BOARD_DIR)
# STM32F429 has FSMC with SDRAM support # STM32F429 has FSMC with SDRAM support
DDEFS += -DFIRMWARE_ID=\"stm32f429\" DDEFS += -DFIRMWARE_ID=\"stm32f429\"
IS_STM32F429 = yes IS_STM32F429 = yes

View File

@ -1,9 +1,7 @@
# Combine the related files for a specific platform and MCU. # Combine the related files for a specific platform and MCU.
# Target ECU board design # Target ECU board design
BOARDCPPSRC = $(BOARDS_DIR)/hellen/alphax-2chan/board_configuration.cpp BOARDCPPSRC = $(BOARD_DIR)/board_configuration.cpp
BOARDINC = $(BOARDS_DIR)/hellen/alphax-2chan
DDEFS += -DEFI_MAIN_RELAY_CONTROL=TRUE DDEFS += -DEFI_MAIN_RELAY_CONTROL=TRUE
# This board has trigger scope hardware! # This board has trigger scope hardware!

View File

@ -1,9 +1,7 @@
# Combine the related files for a specific platform and MCU. # Combine the related files for a specific platform and MCU.
# Target ECU board design # Target ECU board design
BOARDCPPSRC = $(BOARDS_DIR)/hellen/alphax-4chan/board_configuration.cpp BOARDCPPSRC = $(BOARD_DIR)/board_configuration.cpp
BOARDINC = $(BOARDS_DIR)/hellen/alphax-4chan
DDEFS += -DEFI_MAIN_RELAY_CONTROL=TRUE DDEFS += -DEFI_MAIN_RELAY_CONTROL=TRUE
# This board has trigger scope hardware! # This board has trigger scope hardware!

View File

@ -1,9 +1,7 @@
# Combine the related files for a specific platform and MCU. # Combine the related files for a specific platform and MCU.
# Target ECU board design # Target ECU board design
BOARDCPPSRC = $(BOARDS_DIR)/hellen/alphax-8chan/board_configuration.cpp BOARDCPPSRC = $(BOARD_DIR)/board_configuration.cpp
BOARDINC = $(BOARDS_DIR)/hellen/alphax-8chan
DDEFS += -DEFI_MAIN_RELAY_CONTROL=TRUE DDEFS += -DEFI_MAIN_RELAY_CONTROL=TRUE
# This board has trigger scope hardware! # This board has trigger scope hardware!

View File

@ -1,9 +1,7 @@
# Combine the related files for a specific platform and MCU. # Combine the related files for a specific platform and MCU.
# Target ECU board design # Target ECU board design
BOARDCPPSRC = $(BOARDS_DIR)/hellen/harley81/board_configuration.cpp BOARDCPPSRC = $(BOARD_DIR)/board_configuration.cpp
BOARDINC = $(BOARDS_DIR)/hellen/harley81
DDEFS += -DEFI_MAIN_RELAY_CONTROL=TRUE DDEFS += -DEFI_MAIN_RELAY_CONTROL=TRUE

View File

@ -1,9 +1,7 @@
# Combine the related files for a specific platform and MCU. # Combine the related files for a specific platform and MCU.
# Target ECU board design # Target ECU board design
BOARDCPPSRC = $(BOARDS_DIR)/hellen/hellen-gm-e67/board_configuration.cpp BOARDCPPSRC = $(BOARD_DIR)/board_configuration.cpp
BOARDINC = $(BOARDS_DIR)/hellen/hellen-gm-e67
DDEFS += -DEFI_MAIN_RELAY_CONTROL=TRUE DDEFS += -DEFI_MAIN_RELAY_CONTROL=TRUE

View File

@ -1,9 +1,7 @@
# Combine the related files for a specific platform and MCU. # Combine the related files for a specific platform and MCU.
# Target ECU board design # Target ECU board design
BOARDCPPSRC = $(BOARDS_DIR)/hellen/hellen-honda-k/board_configuration.cpp BOARDCPPSRC = $(BOARD_DIR)/board_configuration.cpp
BOARDINC = $(BOARDS_DIR)/hellen/hellen-honda-k
# Set this if you want a default engine type other than normal # Set this if you want a default engine type other than normal
ifeq ($(VAR_DEF_ENGINE_TYPE),) ifeq ($(VAR_DEF_ENGINE_TYPE),)
VAR_DEF_ENGINE_TYPE = -DDEFAULT_ENGINE_TYPE=HELLEN_154_HYUNDAI_COUPE_BK2 VAR_DEF_ENGINE_TYPE = -DDEFAULT_ENGINE_TYPE=HELLEN_154_HYUNDAI_COUPE_BK2

View File

@ -1,9 +1,7 @@
# Combine the related files for a specific platform and MCU. # Combine the related files for a specific platform and MCU.
# Target ECU board design # Target ECU board design
BOARDCPPSRC = $(BOARDS_DIR)/hellen/hellen-nb1/board_configuration.cpp BOARDCPPSRC = $(BOARD_DIR)/board_configuration.cpp
BOARDINC = $(BOARDS_DIR)/hellen/hellen-nb1
# Set this if you want a default engine type other than normal hellen-nb1 # Set this if you want a default engine type other than normal hellen-nb1
ifeq ($(VAR_DEF_ENGINE_TYPE),) ifeq ($(VAR_DEF_ENGINE_TYPE),)
VAR_DEF_ENGINE_TYPE = -DDEFAULT_ENGINE_TYPE=HELLEN_NB1 VAR_DEF_ENGINE_TYPE = -DDEFAULT_ENGINE_TYPE=HELLEN_NB1

View File

@ -1,9 +1,7 @@
# Combine the related files for a specific platform and MCU. # Combine the related files for a specific platform and MCU.
# Target ECU board design # Target ECU board design
BOARDCPPSRC = $(BOARDS_DIR)/hellen/hellen121nissan/board_configuration.cpp BOARDCPPSRC = $(BOARD_DIR)/board_configuration.cpp
BOARDINC = $(BOARDS_DIR)/hellen/hellen121nissan
# Set this if you want a default engine type other than normal hellen121nissan # Set this if you want a default engine type other than normal hellen121nissan
ifeq ($(VAR_DEF_ENGINE_TYPE),) ifeq ($(VAR_DEF_ENGINE_TYPE),)
VAR_DEF_ENGINE_TYPE = -DDEFAULT_ENGINE_TYPE=HELLEN_121_NISSAN_6_CYL VAR_DEF_ENGINE_TYPE = -DDEFAULT_ENGINE_TYPE=HELLEN_121_NISSAN_6_CYL

View File

@ -1,9 +1,7 @@
# Combine the related files for a specific platform and MCU. # Combine the related files for a specific platform and MCU.
# Target ECU board design # Target ECU board design
BOARDCPPSRC = $(BOARDS_DIR)/hellen/hellen121vag/board_configuration.cpp BOARDCPPSRC = $(BOARD_DIR)/board_configuration.cpp
BOARDINC = $(BOARDS_DIR)/hellen/hellen121vag
# Set this if you want a default engine type other than normal hellen121vag # Set this if you want a default engine type other than normal hellen121vag
ifeq ($(VAR_DEF_ENGINE_TYPE),) ifeq ($(VAR_DEF_ENGINE_TYPE),)
VAR_DEF_ENGINE_TYPE = -DDEFAULT_ENGINE_TYPE=HELLEN_121_VAG_4_CYL VAR_DEF_ENGINE_TYPE = -DDEFAULT_ENGINE_TYPE=HELLEN_121_VAG_4_CYL

View File

@ -1,9 +1,7 @@
# Combine the related files for a specific platform and MCU. # Combine the related files for a specific platform and MCU.
# Target ECU board design # Target ECU board design
BOARDCPPSRC = $(BOARDS_DIR)/hellen/hellen128/board_configuration.cpp BOARDCPPSRC = $(BOARD_DIR)/board_configuration.cpp
BOARDINC = $(BOARDS_DIR)/hellen/hellen128
# Set this if you want a default engine type other than normal hellen128 # Set this if you want a default engine type other than normal hellen128
ifeq ($(VAR_DEF_ENGINE_TYPE),) ifeq ($(VAR_DEF_ENGINE_TYPE),)

View File

@ -1,9 +1,7 @@
# Combine the related files for a specific platform and MCU. # Combine the related files for a specific platform and MCU.
# Target ECU board design # Target ECU board design
BOARDCPPSRC = $(BOARDS_DIR)/hellen/hellen154hyundai/board_configuration.cpp BOARDCPPSRC = $(BOARD_DIR)/board_configuration.cpp
BOARDINC = $(BOARDS_DIR)/hellen/hellen154hyundai
# Set this if you want a default engine type other than normal # Set this if you want a default engine type other than normal
ifeq ($(VAR_DEF_ENGINE_TYPE),) ifeq ($(VAR_DEF_ENGINE_TYPE),)
VAR_DEF_ENGINE_TYPE = -DDEFAULT_ENGINE_TYPE=HELLEN_154_HYUNDAI_COUPE_BK2 VAR_DEF_ENGINE_TYPE = -DDEFAULT_ENGINE_TYPE=HELLEN_154_HYUNDAI_COUPE_BK2

View File

@ -1,9 +1,7 @@
# Combine the related files for a specific platform and MCU. # Combine the related files for a specific platform and MCU.
# Target ECU board design # Target ECU board design
BOARDCPPSRC = $(BOARDS_DIR)/hellen/hellen64_miataNA6_94/board_configuration.cpp BOARDCPPSRC = $(BOARD_DIR)/board_configuration.cpp
BOARDINC = $(BOARDS_DIR)/hellen/hellen64_miataNA6_94
# Set this if you want a default engine type other than normal hellen64_miataNA6_94 # Set this if you want a default engine type other than normal hellen64_miataNA6_94
ifeq ($(VAR_DEF_ENGINE_TYPE),) ifeq ($(VAR_DEF_ENGINE_TYPE),)
VAR_DEF_ENGINE_TYPE = -DDEFAULT_ENGINE_TYPE=HELLEN_NA6 VAR_DEF_ENGINE_TYPE = -DDEFAULT_ENGINE_TYPE=HELLEN_NA6

View File

@ -1,9 +1,7 @@
# Combine the related files for a specific platform and MCU. # Combine the related files for a specific platform and MCU.
# Target ECU board design # Target ECU board design
BOARDCPPSRC = $(BOARDS_DIR)/hellen/hellen72/board_configuration.cpp BOARDCPPSRC = $(BOARD_DIR)/board_configuration.cpp
BOARDINC = $(BOARDS_DIR)/hellen/hellen72
# Set this if you want a default engine type other than normal Hellen72 # Set this if you want a default engine type other than normal Hellen72
ifeq ($(VAR_DEF_ENGINE_TYPE),) ifeq ($(VAR_DEF_ENGINE_TYPE),)

View File

@ -1,9 +1,7 @@
# Combine the related files for a specific platform and MCU. # Combine the related files for a specific platform and MCU.
# Target ECU board design # Target ECU board design
BOARDCPPSRC = $(BOARDS_DIR)/hellen/hellen81/board_configuration.cpp BOARDCPPSRC = $(BOARD_DIR)/board_configuration.cpp
BOARDINC = $(BOARDS_DIR)/hellen/hellen81
DDEFS += -DEFI_MAIN_RELAY_CONTROL=TRUE DDEFS += -DEFI_MAIN_RELAY_CONTROL=TRUE
# Add them all together # Add them all together

View File

@ -1,9 +1,7 @@
# Combine the related files for a specific platform and MCU. # Combine the related files for a specific platform and MCU.
# Target ECU board design # Target ECU board design
BOARDCPPSRC = $(BOARDS_DIR)/hellen/hellen88bmw/board_configuration.cpp BOARDCPPSRC = $(BOARD_DIR)/board_configuration.cpp
BOARDINC = $(BOARDS_DIR)/hellen/hellen88bmw
# Set this if you want a default engine type other than normal hellen88bmw # Set this if you want a default engine type other than normal hellen88bmw
ifeq ($(VAR_DEF_ENGINE_TYPE),) ifeq ($(VAR_DEF_ENGINE_TYPE),)
VAR_DEF_ENGINE_TYPE = -DDEFAULT_ENGINE_TYPE=HELLEN_88_BMW VAR_DEF_ENGINE_TYPE = -DDEFAULT_ENGINE_TYPE=HELLEN_88_BMW

View File

@ -1,9 +1,7 @@
# Combine the related files for a specific platform and MCU. # Combine the related files for a specific platform and MCU.
# Target ECU board design # Target ECU board design
BOARDCPPSRC = $(BOARDS_DIR)/hellen/hellenNA8_96/board_configuration.cpp BOARDCPPSRC = $(BOARD_DIR)/board_configuration.cpp
BOARDINC = $(BOARDS_DIR)/hellen/hellenNA8_96
# Set this if you want a default engine type other than normal hellen-nb1 # Set this if you want a default engine type other than normal hellen-nb1
ifeq ($(VAR_DEF_ENGINE_TYPE),) ifeq ($(VAR_DEF_ENGINE_TYPE),)
VAR_DEF_ENGINE_TYPE = -DDEFAULT_ENGINE_TYPE=HELLEN_NA8_96 VAR_DEF_ENGINE_TYPE = -DDEFAULT_ENGINE_TYPE=HELLEN_NA8_96

View File

@ -1,16 +1,9 @@
# Combine the related files for a specific platform and MCU. # Combine the related files for a specific platform and MCU.
# Target ECU board design # Target ECU board design
BOARDCPPSRC = $(BOARDS_DIR)/microrusefi/board_configuration.cpp BOARDCPPSRC = $(BOARD_DIR)/board_configuration.cpp
# Target processor details BOARDINC = $(BOARD_DIR)
ifeq ($(PROJECT_CPU),ARCH_STM32F4)
BOARDINC = $(BOARDS_DIR)/microrusefi
BOARDINC += $(PROJECT_DIR)/config/stm32f4ems # For board.h
BOARDINC += $(BOARDS_DIR)/microrusefi # For knock_config.h
else
BOARDINC += $(BOARDS_DIR)/microrusefi # For knock_config.h
endif
# see also openblt/board.mk STATUS_LED # see also openblt/board.mk STATUS_LED
DDEFS += -DLED_CRITICAL_ERROR_BRAIN_PIN=Gpio::E3 DDEFS += -DLED_CRITICAL_ERROR_BRAIN_PIN=Gpio::E3

View File

@ -1,7 +1,5 @@
# List of all the board related files. # List of all the board related files.
BOARDCPPSRC = $(PROJECT_DIR)/config/boards/nucleo_f429/board_configuration.cpp BOARDCPPSRC = $(BOARD_DIR)/board_configuration.cpp
BOARDINC = $(PROJECT_DIR)/config/boards/nucleo_f429
DDEFS += -DLED_CRITICAL_ERROR_BRAIN_PIN=Gpio::B14 DDEFS += -DLED_CRITICAL_ERROR_BRAIN_PIN=Gpio::B14
# Enable ethernet # Enable ethernet

View File

@ -1,7 +1,7 @@
# List of all the board related files. # List of all the board related files.
# F429 and F767 Nucleo are indeed the same board with a different chip fitted - so recycle the F429 config # F429 and F767 Nucleo are indeed the same board with a different chip fitted - so recycle the F429 config
BOARDCPPSRC = $(PROJECT_DIR)/config/boards/nucleo_f429/board_configuration.cpp BOARDCPPSRC = $(BOARD_DIR)/board_configuration.cpp
# reducing flash consumption for EFI_ETHERNET to fit # reducing flash consumption for EFI_ETHERNET to fit
DDEFS += -DEFI_FILE_LOGGING=FALSE -DEFI_ALTERNATOR_CONTROL=FALSE -DEFI_LOGIC_ANALYZER=FALSE -DEFI_ENABLE_ASSERTS=FALSE DDEFS += -DEFI_FILE_LOGGING=FALSE -DEFI_ALTERNATOR_CONTROL=FALSE -DEFI_LOGIC_ANALYZER=FALSE -DEFI_ENABLE_ASSERTS=FALSE

View File

@ -1,6 +1,6 @@
# List of all the board related files. # List of all the board related files.
BOARDCPPSRC = $(PROJECT_DIR)/config/boards/nucleo_h743/board_configuration.cpp BOARDCPPSRC = $(BOARD_DIR)/board_configuration.cpp
DDEFS += -DLED_CRITICAL_ERROR_BRAIN_PIN=Gpio::B14 DDEFS += -DLED_CRITICAL_ERROR_BRAIN_PIN=Gpio::B14

View File

@ -1,3 +1,3 @@
PROMETHEUS_BOARD = 405 PROMETHEUS_BOARD = 405
include $(PROJECT_DIR)/config/boards/prometheus/prometheus-common-board.mk include $(BOARD_DIR)/../prometheus-common-board.mk

View File

@ -1,3 +1,3 @@
PROMETHEUS_BOARD = 469 PROMETHEUS_BOARD = 469
include $(PROJECT_DIR)/config/boards/prometheus/prometheus-common-board.mk include $(BOARD_DIR)/../prometheus-common-board.mk

View File

@ -1,11 +1,11 @@
# List of all the board related files. # List of all the board related files.
BOARDSRC = $(PROJECT_DIR)/config/boards/prometheus/board_extra.c BOARDSRC = $(BOARD_DIR)/../board_extra.c
BOARDCPPSRC = $(PROJECT_DIR)/config/boards/Prometheus/board_configuration.cpp BOARDCPPSRC = $(BOARD_DIR)/../board_configuration.cpp
BOARDINC += $(BOARD_DIR)/..
# Required include directories # Required include directories
BOARDINC = $(PROJECT_DIR)/config/boards/prometheus
# Default to a release build - clear EXTRA_PARAMS from cmdline to build debug # Default to a release build - clear EXTRA_PARAMS from cmdline to build debug
ifeq ($(EXTRA_PARAMS),) ifeq ($(EXTRA_PARAMS),)
EXTRA_PARAMS = -DEFI_ENABLE_ASSERTS=FALSE -DCH_DBG_ENABLE_ASSERTS=FALSE -DCH_DBG_ENABLE_STACK_CHECK=FALSE -DCH_DBG_FILL_THREADS=FALSE -DCH_DBG_THREADS_PROFILING=FALSE EXTRA_PARAMS = -DEFI_ENABLE_ASSERTS=FALSE -DCH_DBG_ENABLE_ASSERTS=FALSE -DCH_DBG_ENABLE_STACK_CHECK=FALSE -DCH_DBG_FILL_THREADS=FALSE -DCH_DBG_THREADS_PROFILING=FALSE

View File

@ -1,8 +1,6 @@
# List of all the board related files. # List of all the board related files.
BOARDCPPSRC = $(PROJECT_DIR)/config/boards/proteus/board_configuration.cpp \ BOARDCPPSRC = $(BOARD_DIR)/board_configuration.cpp \
$(PROJECT_DIR)/config/boards/proteus/adc_hack.cpp $(BOARD_DIR)/adc_hack.cpp
BOARDINC = $(PROJECT_DIR)/config/boards/proteus
ifeq ($(PROJECT_CPU),ARCH_STM32F4) ifeq ($(PROJECT_CPU),ARCH_STM32F4)
IS_STM32F429 = yes IS_STM32F429 = yes

View File

@ -1,10 +1,7 @@
BOARD_DIR = $(PROJECT_DIR)/config/boards/$(PROJECT_BOARD)
# List of all the board related files. # List of all the board related files.
BOARDCPPSRC = $(BOARD_DIR)/board_configuration.cpp BOARDCPPSRC = $(BOARD_DIR)/board_configuration.cpp
# Required include directories # Required include directories
BOARDINC = $(BOARD_DIR)
BOARDINC += $(BOARD_DIR)/config/controllers/algo BOARDINC += $(BOARD_DIR)/config/controllers/algo
# Override LD script # Override LD script

View File

@ -1,2 +1,2 @@
#We have our own enums #We have our own enums
GENERATED_ENUMS_DIR = $(PROJECT_DIR)/config/boards/$(PROJECT_BOARD)/config/controllers/algo GENERATED_ENUMS_DIR = $(BOARD_DIR)/config/controllers/algo

View File

@ -1,5 +1,5 @@
BOARDCPPSRC = $(PROJECT_DIR)/config/boards/tdg-pdm8/board_configuration.cpp BOARDCPPSRC = $(BOARD_DIR)/board_configuration.cpp
PROJECT_CPU = ARCH_STM32F4 PROJECT_CPU = ARCH_STM32F4

View File

@ -46,7 +46,7 @@ TOOL_PATH=$(TRGT)
#|--------------------------------------------------------------------------------------| #|--------------------------------------------------------------------------------------|
PROJECT_DIR=. PROJECT_DIR=.
OPENBLT_TRGT_DIR=$(PROJECT_DIR)/ext/openblt/Target OPENBLT_TRGT_DIR=$(PROJECT_DIR)/ext/openblt/Target
OPENBLT_BOARD_DIR=$(PROJECT_DIR)/config/boards/$(PROJECT_BOARD)/openblt OPENBLT_BOARD_DIR=$(BOARD_DIR)/openblt
ifeq ($(PROJECT_CPU),ARCH_STM32F4) ifeq ($(PROJECT_CPU),ARCH_STM32F4)
OPENBLT_PORT_DIR=$(PROJECT_DIR)/hw_layer/ports/stm32/stm32f4/openblt OPENBLT_PORT_DIR=$(PROJECT_DIR)/hw_layer/ports/stm32/stm32f4/openblt
else ifeq ($(PROJECT_CPU),ARCH_STM32F7) else ifeq ($(PROJECT_CPU),ARCH_STM32F7)

View File

@ -20,14 +20,21 @@ ifeq ($(PROJECT_BOARD),)
PROJECT_BOARD = f407-discovery PROJECT_BOARD = f407-discovery
endif endif
BOARDS_DIR = $(PROJECT_DIR)/config/boards
# allow passing a custom board dir, otherwise generate it based on the board name
ifeq ($(BOARD_DIR),)
BOARD_DIR = $(BOARDS_DIR)/$(PROJECT_BOARD)
endif
ifeq ($(PROJECT_CPU),) ifeq ($(PROJECT_CPU),)
# many boards all the way to Proteus use this F4 default # many boards all the way to Proteus use this F4 default
PROJECT_CPU = ARCH_STM32F4 PROJECT_CPU = ARCH_STM32F4
endif endif
-include $(PROJECT_DIR)/config/boards/$(PROJECT_BOARD)/config.mk -include $(BOARD_DIR)/config.mk
PIN_NAMES_FILE=$(PROJECT_DIR)/config/boards/$(PROJECT_BOARD)/connectors/generated_ts_name_by_pin.cpp PIN_NAMES_FILE=$(BOARD_DIR)/connectors/generated_ts_name_by_pin.cpp
ifneq ("$(wildcard $(PIN_NAMES_FILE))","") ifneq ("$(wildcard $(PIN_NAMES_FILE))","")
$(info found $(PIN_NAMES_FILE) ) $(info found $(PIN_NAMES_FILE) )

View File

@ -14,6 +14,8 @@ PCHSUB = unit_tests
include $(PROJECT_DIR)/rusefi_rules.mk include $(PROJECT_DIR)/rusefi_rules.mk
BOARDS_DIR = $(PROJECT_DIR)/config/boards
# User may want to pass in a forced value for SANITIZE # User may want to pass in a forced value for SANITIZE
ifeq ($(SANITIZE),) ifeq ($(SANITIZE),)
ifneq ($(OS),Windows_NT) ifneq ($(OS),Windows_NT)