Better flags
This commit is contained in:
parent
bcb7407ca9
commit
86973763d6
1 changed files with 6 additions and 1 deletions
7
Makefile
7
Makefile
|
@ -9,7 +9,11 @@ MCU = atmega1284p
|
||||||
QEMU_MACHINE_NAME = mega
|
QEMU_MACHINE_NAME = mega
|
||||||
|
|
||||||
# Compiler flags
|
# 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
|
# Source files
|
||||||
SRCS = $(wildcard *.c)
|
SRCS = $(wildcard *.c)
|
||||||
|
@ -34,6 +38,7 @@ $(TARGET).elf: $(OBJS)
|
||||||
# Convert ELF to HEX
|
# Convert ELF to HEX
|
||||||
$(TARGET).hex: $(TARGET).elf
|
$(TARGET).hex: $(TARGET).elf
|
||||||
avr-objcopy -O ihex -R .eeprom $(TARGET).elf $(TARGET).hex
|
avr-objcopy -O ihex -R .eeprom $(TARGET).elf $(TARGET).hex
|
||||||
|
avr-size $<
|
||||||
|
|
||||||
# Flash the program
|
# Flash the program
|
||||||
flash: $(TARGET).hex
|
flash: $(TARGET).hex
|
||||||
|
|
Loading…
Add table
Reference in a new issue