Kaynağa Gözat

Added opt flags.

Vladimir N. Shilov 4 yıl önce
ebeveyn
işleme
f014623886
1 değiştirilmiş dosya ile 8 ekleme ve 3 silme
  1. 8 3
      Makefile

+ 8 - 3
Makefile

@@ -23,6 +23,9 @@ TARGET = MNC-IN12x5
 DEBUG = 0
 # optimization
 OPT = -O2
+OPT += -ffunction-sections -fdata-sections
+OPT += -fno-strict-aliasing
+OPT += -ffast-math -msoft-float -mfloat-abi=soft
 
 
 #######################################
@@ -123,9 +126,9 @@ C_INCLUDES =  \
 
 
 # compile gcc flags
-ASFLAGS = $(MCU) $(AS_DEFS) $(AS_INCLUDES) $(OPT) -Wall -fdata-sections -ffunction-sections
+ASFLAGS = $(MCU) $(AS_DEFS) $(AS_INCLUDES) $(OPT) -Wall
 
-CFLAGS = $(MCU) $(C_DEFS) $(C_INCLUDES) $(OPT) -Wall -fdata-sections -ffunction-sections
+CFLAGS = $(MCU) $(C_DEFS) $(C_INCLUDES) $(OPT) -Wall
 
 ifeq ($(DEBUG), 1)
 CFLAGS += -g -gdwarf-2
@@ -134,6 +137,7 @@ endif
 
 # Generate dependency information
 CFLAGS += -MMD -MP -MF"$(@:%.o=%.d)"
+CFLAGS += -std=gnu11 -pedantic
 
 
 #######################################
@@ -145,7 +149,8 @@ LDSCRIPT = Drivers/STM32G030K8Tx_FLASH.ld
 # libraries
 LIBS = -lc -lm -lnosys 
 LIBDIR = 
-LDFLAGS = $(MCU) -specs=nano.specs -T$(LDSCRIPT) $(LIBDIR) $(LIBS) -Wl,-Map=$(BUILD_DIR)/$(TARGET).map,--cref -Wl,--gc-sections
+LDFLAGS = $(MCU) -specs=nano.specs -T$(LDSCRIPT) $(LIBDIR) $(LIBS) -Wl,-Map=$(BUILD_DIR)/$(TARGET).map,--cref
+LDFLAGS += -Wl,--gc-sections
 
 # default action: build all
 all: $(BUILD_DIR)/$(TARGET).elf $(BUILD_DIR)/$(TARGET).hex $(BUILD_DIR)/$(TARGET).bin