From 86973763d692d0fa9de1f0bc25bbb6d12d164e74 Mon Sep 17 00:00:00 2001 From: Imbus <> Date: Wed, 5 Feb 2025 14:47:46 +0100 Subject: [PATCH] Better flags --- Makefile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 0503c93..e45edf9 100644 --- a/Makefile +++ b/Makefile @@ -9,7 +9,11 @@ MCU = atmega1284p QEMU_MACHINE_NAME = mega # Compiler flags -CFLAGS = -std=c2x -Wall -Wno-array-bounds -mmcu=$(MCU) -DF_CPU=16000000UL -O3 +CFLAGS = -std=c99 -Wall -Wextra -Wpedantic -Wno-array-bounds -mmcu=$(MCU) \ + -DF_CPU=16000000UL -O2 -fno-common -ffunction-sections -fdata-sections + +# For debug +CFLAGS += -g3 -DDEBUG # Source files SRCS = $(wildcard *.c) @@ -34,6 +38,7 @@ $(TARGET).elf: $(OBJS) # Convert ELF to HEX $(TARGET).hex: $(TARGET).elf avr-objcopy -O ihex -R .eeprom $(TARGET).elf $(TARGET).hex + avr-size $< # Flash the program flash: $(TARGET).hex