forked from cnlohr/pi_tpi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
31 lines (20 loc) · 800 Bytes
/
Makefile
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
29
all : osccal.bin burn
AVRPART=attiny10
AVRCFLAGS=-g -Wall -Os -mmcu=$(AVRPART) -DF_CPU=8000000UL
AVRASFLAGS:=$(AVRCFLAGS)
tpiflash : gpio_tpi.c gen_ios.c tpiflash.c
gcc -I/opt/vc/include -L/opt/vc/lib -lbcm_host -o $@ $^ -Os
firmware.bin : firmware.c firmware.S
avr-gcc -I -g $(AVRCFLAGS) -mmcu=$(AVRPART) -Wl,-Map,firmware.map -o firmware.elf $^
avr-objdump firmware.elf -S > firmware.lst
avr-objcopy -j .text -j .data -O binary firmware.elf firmware.bin
osccal.bin : osccal.c
avr-gcc -I -g $(AVRCFLAGS) -mmcu=$(AVRPART) -o osccal.elf $^
avr-objcopy -j .text -j .data -O binary osccal.elf osccal.bin
rm osccal.elf
calibrate : osccal.bin tpiflash
./tpiflash o 1e9003
burn : tpiflash firmware.bin
./tpiflash w 1e9003 firmware.bin
clean :
rm -rf *.o *~ tpiflash *.elf *.bin