Tweak firmware Makefile, scripting (#4796)

* firmware: Makefile uses spaces ...

* firmware: use CC and CPPC for LD

* firmware: clean_compile_two_versions.sh passes arguments to make
This commit is contained in:
Nathan Schulte 2022-11-18 20:53:02 -06:00 committed by GitHub
parent 1caeeb631b
commit fcca331773
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 58 additions and 56 deletions

View File

@ -47,10 +47,10 @@ endif
ifeq ($(CCACHE_DIR),) ifeq ($(CCACHE_DIR),)
$(info No CCACHE_DIR) $(info No CCACHE_DIR)
else else
$(info CCACHE_DIR is ${CCACHE_DIR}) $(info CCACHE_DIR is ${CCACHE_DIR})
CCPREFIX=ccache CCPREFIX=ccache
endif endif
@ -182,25 +182,25 @@ include $(CHIBIOS)/os/rt/rt.mk
include $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/port_v7m.mk include $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/port_v7m.mk
# EX files (optional). # EX files (optional).
ifneq ($(USE_LIS302),no) ifneq ($(USE_LIS302),no)
include $(CHIBIOS)/os/ex/devices/ST/lis302dl.mk include $(CHIBIOS)/os/ex/devices/ST/lis302dl.mk
endif endif
include $(CHIBIOS)/os/hal/lib/streams/streams.mk include $(CHIBIOS)/os/hal/lib/streams/streams.mk
include $(CHIBIOS)/os/various/cpp_wrappers/chcpp.mk include $(CHIBIOS)/os/various/cpp_wrappers/chcpp.mk
ifeq ($(LWIP),yes) ifeq ($(LWIP),yes)
include $(CHIBIOS)/os/various/lwip_bindings/lwip.mk include $(CHIBIOS)/os/various/lwip_bindings/lwip.mk
endif endif
include $(CHIBIOS)/os/hal/lib/complex/mfs/hal_mfs.mk include $(CHIBIOS)/os/hal/lib/complex/mfs/hal_mfs.mk
ifeq ($(USE_FATFS),yes) ifeq ($(USE_FATFS),yes)
include $(CHIBIOS)/os/various/fatfs_bindings/fatfs.mk include $(CHIBIOS)/os/various/fatfs_bindings/fatfs.mk
endif endif
#Now include RusEFI mk files #Now include RusEFI mk files
include console/binary/tunerstudio.mk include console/binary/tunerstudio.mk
ifeq ($(USE_FATFS),yes) ifeq ($(USE_FATFS),yes)
include $(PROJECT_DIR)/ext/FatFS/fatfs.mk include $(PROJECT_DIR)/ext/FatFS/fatfs.mk
endif endif
include $(PROJECT_DIR)/hw_layer/mass_storage/mass_storage.mk include $(PROJECT_DIR)/hw_layer/mass_storage/mass_storage.mk
@ -212,7 +212,7 @@ ifeq ($(BOOTLOADERINC),)
endif endif
ifeq ($(USE_BOOTLOADER),yes) ifeq ($(USE_BOOTLOADER),yes)
include $(PROJECT_DIR)/bootloader/bootloader.mk include $(PROJECT_DIR)/bootloader/bootloader.mk
endif endif
ifeq ($(USE_OPENBLT),yes) ifeq ($(USE_OPENBLT),yes)
@ -230,31 +230,31 @@ $(info LDSCRIPT: $(LDSCRIPT))
# setting. # setting.
# check.c goes first to throw error as soon as possible # check.c goes first to throw error as soon as possible
CSRC = check.c \ CSRC = check.c \
$(ALLCSRC) \ $(ALLCSRC) \
$(BOARDSRC) \ $(BOARDSRC) \
$(CHIBIOS_CONTRIB)/os/various/ramdisk.c \ $(CHIBIOS_CONTRIB)/os/various/ramdisk.c \
$(CHIBIOS)/os/various/evtimer.c \ $(CHIBIOS)/os/various/evtimer.c \
$(DEV_SRC) \ $(DEV_SRC) \
$(BOOTLOADERSRC) \ $(BOOTLOADERSRC) \
${HW_MASS_STORAGE_SRC_C} \ ${HW_MASS_STORAGE_SRC_C} \
$(HW_LAYER_EMS) \ $(HW_LAYER_EMS) \
$(HW_LAYER_DRIVERS_CORE) \ $(HW_LAYER_DRIVERS_CORE) \
$(HW_LAYER_DRIVERS) \ $(HW_LAYER_DRIVERS) \
$(RUSEFI_LIB_C) \ $(RUSEFI_LIB_C) \
main_hardfault.c main_hardfault.c
# C++ sources that can be compiled in ARM or THUMB mode depending on the global # C++ sources that can be compiled in ARM or THUMB mode depending on the global
# setting. # setting.
CPPSRC = \ CPPSRC = \
$(ALLCPPSRC) \ $(ALLCPPSRC) \
$(BOARDCPPSRC) \ $(BOARDCPPSRC) \
$(DEV_SRC_CPP) \ $(DEV_SRC_CPP) \
$(HW_LAYER_DRIVERS_CORE_CPP) \ $(HW_LAYER_DRIVERS_CORE_CPP) \
$(HW_LAYER_DRIVERS_CPP) \ $(HW_LAYER_DRIVERS_CPP) \
$(CONSOLE_SRC_CPP) \ $(CONSOLE_SRC_CPP) \
$(RUSEFI_LIB_CPP) \ $(RUSEFI_LIB_CPP) \
rusefi.cpp \ rusefi.cpp \
main.cpp main.cpp
# C sources to be compiled in ARM mode regardless of the global setting. # C sources to be compiled in ARM mode regardless of the global setting.
# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler # NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler
@ -278,32 +278,32 @@ TCPPSRC =
# List ASM source files here # List ASM source files here
ASMXSRC = $(ALLXASMSRC) \ ASMXSRC = $(ALLXASMSRC) \
$(RUSEFIASM) \ $(RUSEFIASM) \
main_hardfault_asm.S main_hardfault_asm.S
# #
# WARNING! order of variables is important here - for instance cypress own folders should go before default folders # WARNING! order of variables is important here - for instance cypress own folders should go before default folders
# #
INCDIR = \ INCDIR = \
$(PCH_DIR) \ $(PCH_DIR) \
$(BOARDINC) \ $(BOARDINC) \
$(ALLINC) \ $(ALLINC) \
$(TESTINC) \ $(TESTINC) \
$(BOOTLOADERINC) \ $(BOOTLOADERINC) \
$(CHIBIOS)/os/various \ $(CHIBIOS)/os/various \
$(CHIBIOS)/os/hal/lib/peripherals/sensors \ $(CHIBIOS)/os/hal/lib/peripherals/sensors \
$(RUSEFI_LIB_INC) \ $(RUSEFI_LIB_INC) \
$(CONFDIR) \ $(CONFDIR) \
ext/FatFS \ ext/FatFS \
$(PROJECT_DIR)/hw_layer/mass_storage \ $(PROJECT_DIR)/hw_layer/mass_storage \
$(PROJECT_DIR)/hw_layer/serial_over_usb \ $(PROJECT_DIR)/hw_layer/serial_over_usb \
$(PROJECT_DIR)/hw_layer/lcd \ $(PROJECT_DIR)/hw_layer/lcd \
$(PROJECT_DIR)/hw_layer/mass_storage \ $(PROJECT_DIR)/hw_layer/mass_storage \
$(HW_INC) \ $(HW_INC) \
development/hw_layer \ development/hw_layer \
development/test \ development/test \
$(CHIBIOS_CONTRIB)/os/various $(CHIBIOS_CONTRIB)/os/various
# contrib/os/various must go at the end because it also contains pid.h which conflicts with our pid.h # contrib/os/various must go at the end because it also contains pid.h which conflicts with our pid.h
# #
# Project, sources and paths # Project, sources and paths
@ -323,10 +323,10 @@ CPPC = $(CCPREFIX) $(TRGT)g++
# Enable loading with g++ only if you need C++ runtime support. # Enable loading with g++ only if you need C++ runtime support.
# NOTE: You can use C++ even without C++ support if you are careful. C++ # NOTE: You can use C++ even without C++ support if you are careful. C++
# runtime support makes code size explode. # runtime support makes code size explode.
LD = $(TRGT)gcc LD = $(CC)
#LD = $(TRGT)g++ #LD = $(CPPC)
CP = $(TRGT)objcopy CP = $(TRGT)objcopy
AS = $(TRGT)gcc -x assembler-with-cpp AS = $(CC) -x assembler-with-cpp
AR = $(TRGT)ar AR = $(TRGT)ar
OD = $(TRGT)objdump OD = $(TRGT)objdump
SZ = $(TRGT)size SZ = $(TRGT)size

View File

@ -1,4 +1,6 @@
#!/bin/bash #!/usr/bin/env bash
set -e
echo "Compiler gcc version" echo "Compiler gcc version"
arm-none-eabi-gcc -v arm-none-eabi-gcc -v
@ -10,7 +12,7 @@ mkdir deliver
#echo "TIMESTAMP $(date "+%D %T.%2N")" #echo "TIMESTAMP $(date "+%D %T.%2N")"
#EXTRA_PARAMS="-DDUMMY -DFIRMWARE_ID=\\\"default_no_assert\\\" -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="-DDUMMY -DFIRMWARE_ID=\\\"default_no_assert\\\" -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"
#make -j$(nproc) DEBUG_LEVEL_OPT='-O2' #make -j$(nproc) DEBUG_LEVEL_OPT='-O2' $@
#EXTRA_PARAMS="" #EXTRA_PARAMS=""
# mv build/rusefi.elf deliver/rusefi_no_asserts.elf # mv build/rusefi.elf deliver/rusefi_no_asserts.elf
@ -25,7 +27,7 @@ mkdir deliver
bash clean.sh bash clean.sh
echo "TIMESTAMP $(date "+%D %T.%2N")" echo "TIMESTAMP $(date "+%D %T.%2N")"
EXTRA_PARAMS="-DDUMMY -DFIRMWARE_ID=\\\"default\\\"" EXTRA_PARAMS="-DDUMMY -DFIRMWARE_ID=\\\"default\\\""
make -j$(nproc) make -j$(nproc) $@
EXTRA_PARAMS="" EXTRA_PARAMS=""
mv build/rusefi.elf deliver/rusefi.elf mv build/rusefi.elf deliver/rusefi.elf