-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
39 lines (27 loc) · 862 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
38
39
OBJCOPY = arm-none-eabi-objcopy
CC = arm-none-eabi-gcc
INCLUDES = -I./include
CFLAGS = -Wall -Wextra -Wdeclaration-after-statement -Wstrict-prototypes \
-g -Os -fno-strict-aliasing -nostdlib -mcpu=cortex-m0 -mthumb \
-march=armv6-m -mlittle-endian -DSTM32F030 -DNR_ROWS=6 -DNR_COLS=64 \
-DSYSTEM_CLOCK_FREQUENCY=24000000 -DSCREEN_REFRESH_HZ=1250
LDFLAGS = -Tlink.ld
binary = ledboard.bin
elfout = ledboard.elf
obj = firmware.o start.o
asm = $(obj:.o=.s)
all: $(binary)
disasm: $(asm)
disasm: CFLAGS += -fverbose-asm
$(binary): $(elfout)
$(OBJCOPY) -O binary $< $@
$(elfout): $(obj)
$(CC) $(CFLAGS) $(LDFLAGS) $(obj) -o $@
%.o: %.c
$(CC) $< $(CFLAGS) $(INCLUDES) -c -o $@
%.o: %.s
$(CC) $< $(CFLAGS) $(INCLUDES) -c -o $@
%.s: %.c
$(CC) $< $(CFLAGS) $(INCLUDES) -c -S -o $@
clean:
rm -f firmware.s firmware.o start.o ledboard.bin ledboard.elf