-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
37 lines (26 loc) · 797 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
30
31
32
33
34
35
36
37
.PHONY: all clean program reset halgen
DEVICE := attiny26
DUDE_DEV := t26
CLOCK := 16000000
OBJS := main.o
#noisegen.o
CC := avr-gcc
CFLAGS := -std=c11 -g3 -Os -DF_CPU=$(CLOCK) -mmcu=$(DEVICE)
CFLAGS += -Wall -Wmissing-prototypes -Wstrict-prototypes -Werror=implicit-function-declaration -Werror=format -Wshadow
all: main main.bin
.c.o:
$(CC) -c $(CFLAGS) -o $@ $<
reset:
avrdude -c avrispmkII -p $(DUDE_DEV) -B 10
program: main.hex
avrdude -c avrispmkII -p $(DUDE_DEV) -B 4 -U flash:w:main.hex:i
clean:
rm -f main.hex main.bin main $(OBJS)
main: $(OBJS)
$(CC) $(CFLAGS) -o $@ $(OBJS) $(LDFLAGS)
main.hex: main
avr-objcopy -j .text -j .data -O ihex main $@
main.bin: main
avr-objcopy -j .text -j .data -O binary main $@
halgen: hal.xml
../HALGen/halgen -a avr -o hal.h hal.xml