mirror of
git://projects.qi-hardware.com/ben-blinkenlights.git
synced 2024-11-27 22:28:24 +02:00
32 lines
588 B
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
|