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