From b21ef96f2cc1009c667964aee902f531c133872a Mon Sep 17 00:00:00 2001 From: rusefi Date: Sat, 25 Apr 2020 12:33:16 -0400 Subject: [PATCH] helping USE_SMART_BUILD --- firmware/Makefile | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/firmware/Makefile b/firmware/Makefile index d787a51806..81163c494f 100644 --- a/firmware/Makefile +++ b/firmware/Makefile @@ -80,6 +80,18 @@ ifeq ($(USE_VERBOSE_COMPILE),) USE_VERBOSE_COMPILE = no endif +# If enabled, this option makes the build process faster by not compiling +# modules not used in the current configuration. +# without USE_SMART_BUILD all ChibiOS (including all drivers) are builded. And all drivers includes get included. +ifeq ($(USE_SMART_BUILD),) + USE_SMART_BUILD = yes +endif + +# for this to work it has to be defined before hal.mk +ifeq ($(CONFDIR),) + CONFDIR = config/stm32f4ems +endif + ifeq ($(USE_BOOTLOADER),) USE_BOOTLOADER = no endif @@ -123,6 +135,11 @@ MAKEFLAGS += ${NUMJOBS} # Architecture or project specific options ############################################################################## +BOARDS_DIR = $(PROJECT_DIR)/config/boards +# we want this above hal.mk since we often define CONFDIR inside board.mk +include $(PROJECT_DIR)/config/boards/$(PROJECT_BOARD)/board.mk + + ############################################################################## # Project, sources and paths # @@ -147,9 +164,6 @@ ifeq ($(USE_FATFS),yes) include $(PROJECT_DIR)/ext/fatfs.mk endif -BOARDS_DIR = $(PROJECT_DIR)/config/boards - -include $(PROJECT_DIR)/config/boards/$(PROJECT_BOARD)/board.mk include $(PROJECT_DIR)/config/engines/engines.mk include $(PROJECT_DIR)/console/console.mk include $(PROJECT_DIR)/controllers/controllers.mk @@ -166,15 +180,6 @@ ifeq ($(BOOTLOADERINC),) BOOTLOADERINC= $(PROJECT_DIR)/bootloader/ endif -# If enabled, this option makes the build process faster by not compiling -# modules not used in the current configuration. -# without USE_SMART_BUILD all ChibiOS (including all drivers) are builded. And all drivers includes get included. -ifeq ($(USE_SMART_BUILD),) - USE_SMART_BUILD = yes -endif -ifeq ($(CONFDIR),) - CONFDIR = config/stm32f4ems -endif ifeq ($(USE_BOOTLOADER),yes) include $(PROJECT_DIR)/bootloader/bootloader.mk