summaryrefslogtreecommitdiff
path: root/Makefile
blob: aa38b0216d855fededa30458ff405f1a0f7c76cc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
.PHONY: love flash
love: sublab77.ihex

CFLAGS=-Wall -Wextra -pedantic -std=c99 -DF_CPU=1000000UL -Os -fshort-enums -fno-move-loop-invariants -fno-tree-loop-optimize -mmcu=attiny26

%.o: %.c
	avr-gcc $(CFLAGS) -c -o $@ $<
ifdef WHOPR
sublab77.elf: main.c
	avr-gcc $(CFLAGS) -DWHOPR -o $@ $^
	avr-size $@
else
sublab77.elf: clock.o dcf77.o lcd.o main.o timebase.o
	avr-gcc -Os -mmcu=attiny26 -o $@ $^
	avr-size $@
endif

sublab77.ihex: sublab77.elf
	avr-objcopy -Oihex $^ $@

clean:
	rm *.o *.elf *.ihex