usart/makefile

29 lines
600 B
Makefile
Raw Permalink Normal View History

2020-12-10 01:58:46 +00:00
MCU=atmega32
F_CPU=8000000
PROG=dragon_jtag
PORT?=/dev/ttyUSB0
CC=avr-g++
OBJCOPY=avr-objcopy
CFLAGS=-Wall -g -mmcu=${MCU} -DF_CPU=${F_CPU} -I.
TARGET=main
2020-12-10 04:16:38 +00:00
SRCS= src/*.cpp test/main.cpp
2020-12-10 01:58:46 +00:00
all: build flash
build:
${CC} ${CFLAGS} -o bin/${TARGET}.bin ${SRCS}
${CC} ${CFLAGS} -o bin/${TARGET}.elf ${SRCS}
${OBJCOPY} -j .text -j .data -O ihex bin/${TARGET}.bin bin/${TARGET}.hex
flash:
avrdude -p ${MCU} -c ${PROG} -U flash:w:bin/main.hex
clean:
rm -f bin/*
term:
python3 term.py
avarice:
avarice --program --file bin/main.elf --part atmega32 --dragon :4242