scoutos / scout_avr / bom / Makefile @ e4d78d85
History | View | Annotate | Download (439 Bytes)
1 |
#PART=m328p |
---|---|
2 |
#MCU=atmega328 |
3 |
|
4 |
PART=t85 |
5 |
MCU=attiny85 |
6 |
|
7 |
PROG=avrispMKII |
8 |
|
9 |
F_CPU=1000000 |
10 |
|
11 |
SRC=bom.c tiny-twi.c |
12 |
HDR= |
13 |
FLAGS=-mmcu=$(MCU) -DF_CPU=$(F_CPU)UL -funsigned-char -Os -fpack-struct -Wall |
14 |
|
15 |
default: bom.hex |
16 |
|
17 |
%.hex: %.elf |
18 |
avr-objcopy -j .text -j .data -O ihex $< $@ |
19 |
|
20 |
bom.elf: $(SRC) $(HDR) |
21 |
avr-g++ $(FLAGS) $(SRC) -o $@ |
22 |
|
23 |
%.s: %.c |
24 |
avr-gcc $(FLAGS) -S $< -o $@ |
25 |
|
26 |
program: bom.hex |
27 |
avrdude -p $(PART) -c $(PROG) -P usb -B 5 -U flash:w:bom.hex |