Serial makefile target

This commit is contained in:
Imbus 2024-03-23 04:28:03 +01:00
parent eb77cd1577
commit f5101cff32
2 changed files with 31 additions and 21 deletions

View file

@ -9,7 +9,7 @@ MCU = atmega328p
QEMU_MACHINE_NAME = uno
# Compiler flags
CFLAGS = -std=c99 -Wall -Wno-array-bounds -mmcu=$(MCU) -DF_CPU=16000000UL -O3
CFLAGS = -std=c2x -Wall -Wno-array-bounds -mmcu=$(MCU) -DF_CPU=16000000UL -O3
# Source files
SRCS = main.c
@ -30,6 +30,7 @@ all: $(TARGET).hex
# Link object files
$(TARGET).elf: $(OBJS)
$(CC) $(CFLAGS) $(OBJS) -o $(TARGET).elf
avr-strip $(TARGET).elf
# Convert ELF to HEX
$(TARGET).hex: $(TARGET).elf
@ -47,6 +48,9 @@ qemu: $(TARGET).elf
asm: $(TARGET).hex
avr-objdump -S $(TARGET).elf
serial:
picocom -b 9600 /dev/ttyUSB0
# Clean
clean:
rm -f $(OBJS) $(TARGET).elf $(TARGET).hex