1
0
mirror of git://projects.qi-hardware.com/ben-blinkenlights.git synced 2024-11-30 19:12:48 +02:00
ben-blinkenlights/nxuart/fw/Makefile

32 lines
588 B
Makefile

CFLAGS = -g -Wall -Wshadow -Werror \
-Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations
NAME=nxuart
CHIP=atmega48
CLK_MHZ=8
AVR_PREFIX = $(BIN_PATH) avr-
CC = $(AVR_PREFIX)gcc
OBJCOPY = $(AVR_PREFIX)objcopy
#OBJDUMP = $(AVR_PREFIX)objdump
.PHONY: all upload prog
all: $(NAME).bin
%.elf: %.c
$(CC) -mmcu=$(CHIP) -Os -o $@ $<
%.bin: %.elf
$(OBJCOPY) -j .text -j .data -O binary $< $@
upload: $(NAME).bin
scp $(NAME).bin jlime:
prog:
ssh jlime avrdude -p atmega48 -c nanonote_$(NAME) -e \
-x clk=$(CLK_MHZ) \
-U flash:w:$(NAME).bin:r \
-U lfuse:w:0x60:m