auto-sync
This commit is contained in:
parent
cd5af013ca
commit
94e91a821b
|
@ -4,17 +4,18 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
PROJECT_DIR = .
|
PROJECT_DIR = .
|
||||||
CHIBIOS = chibios
|
|
||||||
|
|
||||||
# Compiler options here.
|
# Compiler options here.
|
||||||
ifeq ($(USE_OPT),)
|
ifeq ($(USE_OPT),)
|
||||||
|
# USE_OPT = -O2 -ggdb -std=gnu99 -fomit-frame-pointer -falign-functions=16
|
||||||
# USE_OPT = $(RFLAGS) -O1 -fgnu89-inline -ggdb -fomit-frame-pointer -falign-functions=16 -std=gnu99 -Werror-implicit-function-declaration -Werror -Wno-error=pointer-sign -Wno-error=unused-function -Wno-error=unused-variable -Wno-error=sign-compare -Wno-error=unused-parameter -Wno-error=missing-field-initializers
|
# USE_OPT = $(RFLAGS) -O1 -fgnu89-inline -ggdb -fomit-frame-pointer -falign-functions=16 -std=gnu99 -Werror-implicit-function-declaration -Werror -Wno-error=pointer-sign -Wno-error=unused-function -Wno-error=unused-variable -Wno-error=sign-compare -Wno-error=unused-parameter -Wno-error=missing-field-initializers
|
||||||
USE_OPT = $(RFLAGS) -O1 -fgnu89-inline -fomit-frame-pointer -falign-functions=16 -std=gnu99 -Werror-implicit-function-declaration -Werror -Wno-error=pointer-sign -Wno-error=unused-function -Wno-error=unused-variable -Wno-error=sign-compare -Wno-error=unused-parameter -Wno-error=missing-field-initializers -Werror=type-limits
|
USE_OPT = $(RFLAGS) -O2 -fomit-frame-pointer -falign-functions=16 -Werror-implicit-function-declaration -Werror -Wno-error=pointer-sign -Wno-error=unused-function -Wno-error=unused-variable -Wno-error=sign-compare -Wno-error=unused-parameter -Wno-error=missing-field-initializers -Werror=type-limits -Wno-error=strict-aliasing -Wno-error=attributes
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# C specific options here (added to USE_OPT).
|
# C specific options here (added to USE_OPT).
|
||||||
ifeq ($(USE_COPT),)
|
ifeq ($(USE_COPT),)
|
||||||
USE_COPT =
|
USE_COPT = -fgnu89-inline -std=gnu99
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# C++ specific options here (added to USE_OPT).
|
# C++ specific options here (added to USE_OPT).
|
||||||
|
@ -27,6 +28,16 @@ ifeq ($(USE_LINK_GC),)
|
||||||
USE_LINK_GC = yes
|
USE_LINK_GC = yes
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
# Linker extra options here.
|
||||||
|
ifeq ($(USE_LDOPT),)
|
||||||
|
USE_LDOPT =
|
||||||
|
endif
|
||||||
|
|
||||||
|
# Enable this if you want link time optimizations (LTO)
|
||||||
|
ifeq ($(USE_LTO),)
|
||||||
|
USE_LTO = no
|
||||||
|
endif
|
||||||
|
|
||||||
# If enabled, this option allows to compile the application in THUMB mode.
|
# If enabled, this option allows to compile the application in THUMB mode.
|
||||||
ifeq ($(USE_THUMB),)
|
ifeq ($(USE_THUMB),)
|
||||||
USE_THUMB = yes
|
USE_THUMB = yes
|
||||||
|
@ -45,22 +56,13 @@ endif
|
||||||
# Architecture or project specific options
|
# Architecture or project specific options
|
||||||
#
|
#
|
||||||
|
|
||||||
USE_FPU = yes
|
USE_FPU = softfp
|
||||||
|
|
||||||
# Enables the use of FPU on Cortex-M4.
|
# Enables the use of FPU on Cortex-M4 (no, softfp, hard).
|
||||||
# Enable this if you really want to use the STM FWLib.
|
|
||||||
ifeq ($(USE_FPU),)
|
ifeq ($(USE_FPU),)
|
||||||
USE_FPU = no
|
USE_FPU = no
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Enable this if you really want to use the STM FWLib.
|
|
||||||
ifeq ($(USE_FWLIB),)
|
|
||||||
USE_FWLIB = no
|
|
||||||
endif
|
|
||||||
|
|
||||||
# List all default C defines here, like -D_DEBUG=1
|
|
||||||
DDEFS =
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Architecture or project specific options
|
# Architecture or project specific options
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
@ -72,19 +74,24 @@ DDEFS =
|
||||||
# Define project name here
|
# Define project name here
|
||||||
PROJECT = rusefi
|
PROJECT = rusefi
|
||||||
|
|
||||||
|
# Imported source files and paths
|
||||||
|
CHIBIOS = chibios
|
||||||
|
#include $(CHIBIOS)/test/test.mk
|
||||||
|
|
||||||
#PROJECT_BOARD = OLIMEX_STM32_E407
|
#PROJECT_BOARD = OLIMEX_STM32_E407
|
||||||
ifneq ($(PROJECT_BOARD),OLIMEX_STM32_E407)
|
ifneq ($(PROJECT_BOARD),OLIMEX_STM32_E407)
|
||||||
PROJECT_BOARD = ST_STM32F4_DISCOVERY
|
PROJECT_BOARD = ST_STM32F4_DISCOVERY
|
||||||
endif
|
endif
|
||||||
DDEFS += -D$(PROJECT_BOARD)
|
DDEFS += -D$(PROJECT_BOARD)
|
||||||
|
|
||||||
|
|
||||||
# Imported source files and paths
|
# Imported source files and paths
|
||||||
include $(CHIBIOS)/boards/$(PROJECT_BOARD)/board.mk
|
include $(CHIBIOS)/boards/$(PROJECT_BOARD)/board.mk
|
||||||
include $(CHIBIOS)/os/hal/platforms/STM32F4xx/platform.mk
|
include $(CHIBIOS)/os/hal/platforms/STM32F4xx/platform.mk
|
||||||
include $(CHIBIOS)/os/hal/hal.mk
|
include $(CHIBIOS)/os/hal/hal.mk
|
||||||
include $(CHIBIOS)/os/ports/GCC/ARMCMx/STM32F4xx/port.mk
|
include $(CHIBIOS)/os/ports/GCC/ARMCMx/STM32F4xx/port.mk
|
||||||
include $(CHIBIOS)/os/kernel/kernel.mk
|
include $(CHIBIOS)/os/kernel/kernel.mk
|
||||||
include $(CHIBIOS)/os/various/cpp_wrappers/kernel.mk
|
#include $(CHIBIOS)/os/various/cpp_wrappers/kernel.mk
|
||||||
|
|
||||||
include $(CHIBIOS)/os/various/fatfs_bindings/fatfs.mk
|
include $(CHIBIOS)/os/various/fatfs_bindings/fatfs.mk
|
||||||
include console/tunerstudio/tunerstudio.mk
|
include console/tunerstudio/tunerstudio.mk
|
||||||
|
@ -207,7 +214,6 @@ INCDIR = $(PORTINC) $(KERNINC) $(TESTINC) \
|
||||||
controllers/math \
|
controllers/math \
|
||||||
controllers/trigger
|
controllers/trigger
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Project, sources and paths
|
# Project, sources and paths
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
@ -225,11 +231,12 @@ CPPC = $(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 = $(TRGT)gcc
|
||||||
LD = $(TRGT)g++
|
#LD = $(TRGT)g++
|
||||||
CP = $(TRGT)objcopy
|
CP = $(TRGT)objcopy
|
||||||
AS = $(TRGT)gcc -x assembler-with-cpp
|
AS = $(TRGT)gcc -x assembler-with-cpp
|
||||||
OD = $(TRGT)objdump
|
OD = $(TRGT)objdump
|
||||||
|
SZ = $(TRGT)size
|
||||||
HEX = $(CP) -O ihex
|
HEX = $(CP) -O ihex
|
||||||
BIN = $(CP) -O binary
|
BIN = $(CP) -O binary
|
||||||
|
|
||||||
|
@ -253,6 +260,9 @@ CPPWARN = -Wall -Wextra
|
||||||
# Start of default section
|
# Start of default section
|
||||||
#
|
#
|
||||||
|
|
||||||
|
# List all default C defines here, like -D_DEBUG=1
|
||||||
|
DDEFS =
|
||||||
|
|
||||||
# List all default ASM defines here, like -D_DEBUG=1
|
# List all default ASM defines here, like -D_DEBUG=1
|
||||||
DADEFS =
|
DADEFS =
|
||||||
|
|
||||||
|
@ -292,19 +302,5 @@ ULIBS = -lm
|
||||||
# End of user defines
|
# End of user defines
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
ifeq ($(USE_FPU),yes)
|
RULESPATH = $(CHIBIOS)/os/ports/GCC/ARMCMx
|
||||||
USE_OPT += -mfloat-abi=softfp -mfpu=fpv4-sp-d16
|
include $(RULESPATH)/rules.mk
|
||||||
USE_CPPOPT += -mfloat-abi=softfp -mfpu=fpv4-sp-d16
|
|
||||||
DDEFS += -DCORTEX_USE_FPU=TRUE
|
|
||||||
else
|
|
||||||
DDEFS += -DCORTEX_USE_FPU=FALSE
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifeq ($(USE_FWLIB),yes)
|
|
||||||
include $(CHIBIOS)/ext/stm32lib/stm32lib.mk
|
|
||||||
CSRC += $(STM32SRC)
|
|
||||||
INCDIR += $(STM32INC)
|
|
||||||
USE_OPT += -DUSE_STDPERIPH_DRIVER
|
|
||||||
endif
|
|
||||||
|
|
||||||
include $(CHIBIOS)/os/ports/GCC/ARMCMx/rules.mk
|
|
||||||
|
|
|
@ -1,5 +1,45 @@
|
||||||
# ARM Cortex-Mx common makefile scripts and rules.
|
# ARM Cortex-Mx common makefile scripts and rules.
|
||||||
|
|
||||||
|
##############################################################################
|
||||||
|
# Processing options coming from the upper Makefile.
|
||||||
|
#
|
||||||
|
|
||||||
|
# Compiler options
|
||||||
|
OPT = $(USE_OPT)
|
||||||
|
COPT = $(USE_COPT)
|
||||||
|
CPPOPT = $(USE_CPPOPT)
|
||||||
|
|
||||||
|
# Garbage collection
|
||||||
|
ifeq ($(USE_LINK_GC),yes)
|
||||||
|
OPT += -ffunction-sections -fdata-sections -fno-common
|
||||||
|
LDOPT := ,--gc-sections
|
||||||
|
else
|
||||||
|
LDOPT :=
|
||||||
|
endif
|
||||||
|
|
||||||
|
# Linker extra options
|
||||||
|
ifneq ($(USE_LDOPT),)
|
||||||
|
LDOPT := $(LDOPT),$(USE_LDOPT)
|
||||||
|
endif
|
||||||
|
|
||||||
|
# Link time optimizations
|
||||||
|
ifeq ($(USE_LTO),yes)
|
||||||
|
OPT += -flto
|
||||||
|
endif
|
||||||
|
|
||||||
|
# FPU-related options
|
||||||
|
ifeq ($(USE_FPU),)
|
||||||
|
USE_FPU = no
|
||||||
|
endif
|
||||||
|
ifneq ($(USE_FPU),no)
|
||||||
|
OPT += -mfloat-abi=$(USE_FPU) -mfpu=fpv4-sp-d16 -fsingle-precision-constant
|
||||||
|
DDEFS += -DCORTEX_USE_FPU=TRUE
|
||||||
|
DADEFS += -DCORTEX_USE_FPU=TRUE
|
||||||
|
else
|
||||||
|
DDEFS += -DCORTEX_USE_FPU=FALSE
|
||||||
|
DADEFS += -DCORTEX_USE_FPU=FALSE
|
||||||
|
endif
|
||||||
|
|
||||||
# Output directory and files
|
# Output directory and files
|
||||||
ifeq ($(BUILDDIR),)
|
ifeq ($(BUILDDIR),)
|
||||||
BUILDDIR = build
|
BUILDDIR = build
|
||||||
|
@ -10,14 +50,6 @@ endif
|
||||||
OUTFILES = $(BUILDDIR)/$(PROJECT).elf $(BUILDDIR)/$(PROJECT).hex \
|
OUTFILES = $(BUILDDIR)/$(PROJECT).elf $(BUILDDIR)/$(PROJECT).hex \
|
||||||
$(BUILDDIR)/$(PROJECT).bin $(BUILDDIR)/$(PROJECT).dmp
|
$(BUILDDIR)/$(PROJECT).bin $(BUILDDIR)/$(PROJECT).dmp
|
||||||
|
|
||||||
# Automatic compiler options
|
|
||||||
OPT = $(USE_OPT)
|
|
||||||
COPT = $(USE_COPT)
|
|
||||||
CPPOPT = $(USE_CPPOPT)
|
|
||||||
ifeq ($(USE_LINK_GC),yes)
|
|
||||||
OPT += -ffunction-sections -fdata-sections -fno-common
|
|
||||||
endif
|
|
||||||
|
|
||||||
# Source files groups and paths
|
# Source files groups and paths
|
||||||
ifeq ($(USE_THUMB),yes)
|
ifeq ($(USE_THUMB),yes)
|
||||||
TCSRC += $(CSRC)
|
TCSRC += $(CSRC)
|
||||||
|
@ -60,12 +92,8 @@ ODFLAGS = -x --syms
|
||||||
ASFLAGS = $(MCFLAGS) -Wa,-amhls=$(LSTDIR)/$(notdir $(<:.s=.lst)) $(ADEFS)
|
ASFLAGS = $(MCFLAGS) -Wa,-amhls=$(LSTDIR)/$(notdir $(<:.s=.lst)) $(ADEFS)
|
||||||
ASXFLAGS = $(MCFLAGS) -Wa,-amhls=$(LSTDIR)/$(notdir $(<:.S=.lst)) $(ADEFS)
|
ASXFLAGS = $(MCFLAGS) -Wa,-amhls=$(LSTDIR)/$(notdir $(<:.S=.lst)) $(ADEFS)
|
||||||
CFLAGS = $(MCFLAGS) $(OPT) $(COPT) $(CWARN) -Wa,-alms=$(LSTDIR)/$(notdir $(<:.c=.lst)) $(DEFS)
|
CFLAGS = $(MCFLAGS) $(OPT) $(COPT) $(CWARN) -Wa,-alms=$(LSTDIR)/$(notdir $(<:.c=.lst)) $(DEFS)
|
||||||
CPPFLAGS = $(MCFLAGS) $(CPPOPT) $(CPPWARN) -Wa,-alms=$(LSTDIR)/$(notdir $(<:.cpp=.lst)) $(DEFS)
|
CPPFLAGS = $(MCFLAGS) $(OPT) $(CPPOPT) $(CPPWARN) -Wa,-alms=$(LSTDIR)/$(notdir $(<:.cpp=.lst)) $(DEFS)
|
||||||
ifeq ($(USE_LINK_GC),yes)
|
LDFLAGS = $(MCFLAGS) $(OPT) -nostartfiles $(LLIBDIR) -Wl,-Map=$(BUILDDIR)/$(PROJECT).map,--cref,--no-warn-mismatch,--library-path=$(RULESPATH),--script=$(LDSCRIPT)$(LDOPT)
|
||||||
LDFLAGS = $(MCFLAGS) -nostartfiles -T$(LDSCRIPT) -Wl,-Map=$(BUILDDIR)/$(PROJECT).map,--cref,--no-warn-mismatch,--gc-sections $(LLIBDIR)
|
|
||||||
else
|
|
||||||
LDFLAGS = $(MCFLAGS) -nostartfiles -T$(LDSCRIPT) -Wl,-Map=$(BUILDDIR)/$(PROJECT).map,--cref,--no-warn-mismatch $(LLIBDIR)
|
|
||||||
endif
|
|
||||||
|
|
||||||
# Thumb interwork enabled only if needed because it kills performance.
|
# Thumb interwork enabled only if needed because it kills performance.
|
||||||
ifneq ($(TSRC),)
|
ifneq ($(TSRC),)
|
||||||
|
@ -94,6 +122,7 @@ else
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Generate dependency information
|
# Generate dependency information
|
||||||
|
ASFLAGS += -MD -MP -MF .dep/$(@F).d
|
||||||
CFLAGS += -MD -MP -MF .dep/$(@F).d
|
CFLAGS += -MD -MP -MF .dep/$(@F).d
|
||||||
CPPFLAGS += -MD -MP -MF .dep/$(@F).d
|
CPPFLAGS += -MD -MP -MF .dep/$(@F).d
|
||||||
|
|
||||||
|
@ -113,7 +142,7 @@ $(OBJS): | $(BUILDDIR)
|
||||||
$(BUILDDIR) $(OBJDIR) $(LSTDIR):
|
$(BUILDDIR) $(OBJDIR) $(LSTDIR):
|
||||||
ifneq ($(USE_VERBOSE_COMPILE),yes)
|
ifneq ($(USE_VERBOSE_COMPILE),yes)
|
||||||
@echo Compiler Options
|
@echo Compiler Options
|
||||||
@echo $(CPPC) -c $(CPPFLAGS) -I. $(IINCDIR) main.cpp -o main.o -llibstd++
|
@echo $(CC) -c $(CFLAGS) -I. $(IINCDIR) main.c -o main.o
|
||||||
@echo
|
@echo
|
||||||
endif
|
endif
|
||||||
mkdir -p $(OBJDIR)
|
mkdir -p $(OBJDIR)
|
||||||
|
@ -204,12 +233,16 @@ ifeq ($(USE_VERBOSE_COMPILE),yes)
|
||||||
else
|
else
|
||||||
@echo Creating $@
|
@echo Creating $@
|
||||||
@$(OD) $(ODFLAGS) $< > $@
|
@$(OD) $(ODFLAGS) $< > $@
|
||||||
|
@echo
|
||||||
|
@$(SZ) $<
|
||||||
|
@echo
|
||||||
@echo Done
|
@echo Done
|
||||||
endif
|
endif
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
@echo Cleaning
|
@echo Cleaning
|
||||||
-rm -fR .dep $(BUILDDIR)
|
-rm -fR .dep $(BUILDDIR)
|
||||||
|
@echo
|
||||||
@echo Done
|
@echo Done
|
||||||
|
|
||||||
#
|
#
|
||||||
|
|
Loading…
Reference in New Issue