diff --git a/simulator/Makefile b/simulator/Makefile index 701c19cd69..fbc158f13c 100644 --- a/simulator/Makefile +++ b/simulator/Makefile @@ -3,12 +3,12 @@ # NOTE: Can be overridden externally. # -ifeq ("$(wildcard ../firmware/ChibiOS4/os/common/startup/ARMCMx/compilers/GCC/rules.mk)","") -# -# todo: someone please figure out the syntax to invoke 'git submodule update --init' from here -# -$(error Modules are missing? Did you execute 'git submodule update --init'?) -endif + +CHIBIOS = ../firmware/ChibiOS4 +RULESPATH = $(CHIBIOS)/os/common/startup/SIMIA32/compilers/GCC +RULESFILE = $(RULESPATH)/rules.mk + +include ../firmware/rusefi.mk # Compiler options here. @@ -84,7 +84,6 @@ PROJECT = rusefi_simulator PROJECT_DIR = ../firmware # Imported source files and paths -CHIBIOS = ../firmware/ChibiOS4 # Startup files. # HAL-OSAL files (optional). @@ -267,5 +266,4 @@ endif # End of user defines ############################################################################## -RULESPATH = $(CHIBIOS)/os/common/startup/SIMIA32/compilers/GCC include $(RULESPATH)/rules.mk diff --git a/unit_tests/Makefile b/unit_tests/Makefile index d9129df54c..5d5ab94de5 100644 --- a/unit_tests/Makefile +++ b/unit_tests/Makefile @@ -4,7 +4,16 @@ # PROJECT_DIR = ../firmware -#CHIBIOS = $(PROJECT_DIR)/chibios +CHIBIOS=$(PROJECT_DIR)/ChibiOS4 +STREAMSFILE = $(CHIBIOS)/os/hal/include/hal_streams.h + +ifeq ("$(wildcard $(STREAMSFILE))","") +$(info Invoking "git submodule update --init") +$(shell git submodule update --init) +$(info Invoked "git submodule update --init") +# make is not happy about newly checked out module for some reason but next invocation would work +$(error Please run 'make' again) +endif # Compiler options here. ifeq ($(USE_OPT),) @@ -138,7 +147,6 @@ TCPPSRC = # List ASM source files here ASMSRC = $(PORTASM) -CHIBIOS=$(PROJECT_DIR)/ChibiOS4 INCDIR = . \ $(PROJECT_DIR)/util \