-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathavr.make
More file actions
28 lines (27 loc) · 685 Bytes
/
avr.make
File metadata and controls
28 lines (27 loc) · 685 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
NAME := firm
ELF := $(NAME).elf
BIN := $(NAME).hex
LIB := libvterm-ctrl.a
CFLAGS := -g -Os -DLVTC_EMBEDDED
ANSI := -ansi -pedantic
MMCU := atmega328p
PROG := buspirate
PORT := /dev/tty.usbserial-AL03OOL4
MCU := m328p
FOPT := -V
all: library example
library:
avr-gcc $(CFLAGS) $(ANSI) -mmcu=$(MMCU) -c vterm.c
avr-ar rcs $(LIB) vterm.o
example:
avr-gcc $(CFLAGS) -mmcu=$(MMCU) -c avr_test.c
avr-gcc $(CFLAGS) -mmcu=$(MMCU) avr_test.o -o $(ELF) $(LIB)
avr-objcopy -j .text -j .data -O ihex $(ELF) $(BIN)
flash:
avrdude $(FOPT) -c $(PROG) -P $(PORT) -p $(MCU) -U flash:w:$(BIN)
clean:
-rm -rf *.o
-rm -rf *.elf
-rm -rf *.hex
-rm -rf *.a
-rm -rf *.dSYM