Project

General

Profile

Statistics
| Branch: | Revision:

scoutos / scout_avr / bom / Makefile @ 3bd564a7

History | View | Annotate | Download (559 Bytes)

1
#PART=m328p
2
#MCU=atmega328
3

    
4
PART=t85
5
MCU=attiny85
6

    
7
PROG=avrispMKII
8
TARGET ?= bom.hex
9

    
10
F_CPU=1000000
11

    
12
SRC=bom.c tiny-twi.c
13
HDR=
14
FLAGS=-mmcu=$(MCU) -DF_CPU=$(F_CPU)UL -funsigned-char -Os -fpack-struct -Wall
15

    
16
default: bom.hex
17

    
18
%.hex: %.elf
19
	avr-objcopy -j .text -j .data -O ihex $< $@
20

    
21
bom.elf: $(SRC) $(HDR)
22
	avr-g++ $(FLAGS) $(SRC) -o $@
23

    
24
%.s: %.c
25
	avr-gcc $(FLAGS) -S $< -o $@
26

    
27
program: $(TARGET)
28
	avrdude -p $(PART) -c $(PROG) -P usb -B 5 -U flash:w:$(TARGET)
29

    
30
test.elf: test.c tiny-twi-sync.c tiny-twi-sync.h
31
	avr-g++ $(FLAGS) test.c tiny-twi-sync.c -o $@
32