Makefile adjustments

This commit is contained in:
Jan Käberich 2022-06-26 19:09:18 +02:00
parent 947a6b9d83
commit a42a0fe638
2 changed files with 8 additions and 4 deletions

View File

@ -38,6 +38,10 @@
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level.49048306" name="Optimization level" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level" useByScannerDiscovery="false" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.optimization.level.value.o2" valueType="enumerated"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.definedsymbols.806735368" name="Define symbols (-D)" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.compiler.option.definedsymbols" useByScannerDiscovery="false" valueType="definedSymbols">
<listOptionValue builtIn="false" value="DEBUG"/>
<listOptionValue builtIn="false" value="USBPD_PORT_COUNT=1"/>
<listOptionValue builtIn="false" value="USBPDCORE_LIB_PD3_FULL"/>
<listOptionValue builtIn="false" value="_RTOS"/>
<listOptionValue builtIn="false" value="_SNK"/>
<listOptionValue builtIn="false" value="FW_MAJOR=1"/>
<listOptionValue builtIn="false" value="FW_MINOR=3"/>
<listOptionValue builtIn="false" value="FW_PATCH=0"/>

View File

@ -141,8 +141,8 @@ endif
# compile gcc flags
ASFLAGS = $(MCU) -g
CFLAGS = $(MCU) $(C_DEFS) $(C_INCLUDES) $(OPT) -Wall -fmessage-length=0 -ffunction-sections -fdata-sections -c
CXXFLAGS = $(MCU) $(C_DEFS) $(C_INCLUDES) $(OPT) -Wall -fmessage-length=0 -ffunction-sections -fdata-sections -c -fno-exceptions -fno-rtti
CFLAGS = $(MCU) $(C_DEFS) $(C_INCLUDES) $(OPT) -Wall -fmessage-length=0 -ffunction-sections -fdata-sections -c --specs=nano.specs
CXXFLAGS = $(MCU) $(C_DEFS) $(C_INCLUDES) $(OPT) -Wall -fmessage-length=0 -ffunction-sections -fdata-sections -c -fno-exceptions -fno-rtti --specs=nano.specs -fno-use-cxa-atexit
@ -159,9 +159,9 @@ CXXFLAGS += -MMD -MP
LDSCRIPT = STM32G431CBUX_FLASH.ld
# libraries
LIBS = -lm #-l:USBPDCORE_PD3_FULL_CM4_wc32.a
LIBS = -lc -lm -lstdc++ -lsupc++
#LIBDIR = -LMiddlewares/ST/STM32_USBPD_Library/Core/lib
LDFLAGS = $(MCU) -specs=nosys.specs -specs=nano.specs $(LIBDIR) -T$(LDSCRIPT) $(LIBS) -Wl,-Map=$(BUILD_DIR)/$(TARGET).map -Wl,--gc-sections -fno-exceptions -fno-rtti
LDFLAGS = $(MCU) -static -specs=nano.specs $(LIBDIR) -T$(LDSCRIPT) $(LIBS) -Wl,-Map=$(BUILD_DIR)/$(TARGET).map -Wl,--gc-sections -fno-exceptions -fno-rtti -Wl,--start-group -Wl,--end-group
# default action: build all
all: $(BUILD_DIR)/$(TARGET).elf $(BUILD_DIR)/$(TARGET).hex $(BUILD_DIR)/$(TARGET).bin