2011-02-02 03:45:54 +02:00
|
|
|
CFLAGS = -g -Wall -Wshadow -Werror \
|
|
|
|
-Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations
|
|
|
|
|
2011-03-07 19:55:20 +02:00
|
|
|
NAME=nxuart
|
2011-02-02 03:45:54 +02:00
|
|
|
CHIP=atmega48
|
|
|
|
|
|
|
|
AVR_PREFIX = $(BIN_PATH) avr-
|
|
|
|
CC = $(AVR_PREFIX)gcc
|
|
|
|
OBJCOPY = $(AVR_PREFIX)objcopy
|
|
|
|
#OBJDUMP = $(AVR_PREFIX)objdump
|
|
|
|
|
|
|
|
.PHONY: all upload prog
|
|
|
|
|
2011-03-07 19:55:20 +02:00
|
|
|
all: $(NAME).bin
|
2011-02-02 03:45:54 +02:00
|
|
|
|
|
|
|
%.elf: %.c
|
|
|
|
$(CC) -mmcu=$(CHIP) -Os -o $@ $<
|
|
|
|
|
|
|
|
%.bin: %.elf
|
|
|
|
$(OBJCOPY) -j .text -j .data -O binary $< $@
|
|
|
|
|
2011-03-07 19:55:20 +02:00
|
|
|
upload: $(NAME).bin
|
|
|
|
scp $(NAME).bin jlime:
|
2011-02-02 03:45:54 +02:00
|
|
|
|
|
|
|
prog:
|
2011-03-07 19:55:20 +02:00
|
|
|
ssh jlime avrdude -p atmega48 -c nanonote_$(NAME) \
|
|
|
|
-e -U flash:w:$(NAME).bin:r
|