-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
34 lines (24 loc) · 958 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
SRC = $(wildcard src/*.c)
SRC_OBJ = $(SRC:src/%.c=obj/%.o)
all: obj bin bin/gpio2pic
firmware: firmware/debug.hex firmware/debug_bootstrap.hex
bin/gpio2pic: $(SRC_OBJ)
gcc $(ADD_FLAGS) -lgpiod -lreadline -o $@ $(SRC_OBJ)
obj/%.o: src/%.c
gcc $(ADD_FLAGS) -Wall -O -c $< -o $@
obj:
mkdir obj
bin:
mkdir bin
firmware/debug.hex: firmware/debug.asm
gpasm ./firmware/debug.asm -o ./firmware/debug.hex
firmware/debug_bootstrap.hex: firmware/debug_bootstrap.asm
gpasm ./firmware/debug_bootstrap.asm -o ./firmware/debug_bootstrap.hex
clean:
rm -f obj/* bin/*
install: bin/gpio2pic
install -m 755 ./bin/gpio2pic /usr/local/bin/
(ls /etc/gpio2pic.conf 2> /dev/null) || install -m 644 ./etc/gpio2pic.conf /etc/
install -m 755 -d /usr/local/share/gpio2pic/firmware
install -m 644 ./firmware/debug.hex /usr/local/share/gpio2pic/firmware/debug.hex
install -m 644 ./firmware/debug_bootstrap.hex /usr/local/share/gpio2pic/firmware/debug_bootstrap.hex