-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
47 lines (31 loc) · 1.06 KB
/
Makefile
File metadata and controls
47 lines (31 loc) · 1.06 KB
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
40
41
42
43
44
45
46
47
NAME = neopixel
CFLAGS = -I$(CS107E)/include -g -Wall -Og -std=c99 -ffreestanding -mapcs-frame -fno-omit-frame-pointer
LDFLAGS = -nostdlib -T memmap -L$(CS107E)/lib
LDLIBS = -lpi -lpiextra -lgcc
all : $(NAME).bin
%.bin: %.elf
arm-none-eabi-objcopy $< -O binary $@
%.elf: %.o start.o cstart.o neopixel_timing.o
arm-none-eabi-gcc $(LDFLAGS) $^ $(LDLIBS) -o $@
%.o: %.c
arm-none-eabi-gcc $(CFLAGS) -c $< -o $@
%.o: %.s
arm-none-eabi-as $(ASFLAGS) $< -o $@
%.list: %.o
arm-none-eabi-objdump --no-show-raw-insn -d $< > $@
install: $(NAME).bin
rpi-install.py -p $<
clean:
rm -f *.o *.bin *.elf *.list *~
.PHONY: all clean install
.PRECIOUS: %.elf %.o
define CS107E_ERROR_MESSAGE
ERROR - CS107E environment variable is not set.
Please set it to point to the `cs107e.github.io/cs107e` directory using the
command `export CS107E=<replace with path to your cs107e.github.io directory>/cs107e`.
To have this done automatically, add the above command to your shell
environment configuration file (e.g. ~/.bashrc)
endef
ifndef CS107E
$(error $(CS107E_ERROR_MESSAGE))
endif