forked from tom-2015/rpi-ws2812-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
executable file
·62 lines (47 loc) · 1.2 KB
/
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
all: ws2812svr
INCL=-I/usr/include
LINK=-L/usr/lib -L/usr/local/lib -I/usr/lib/arm-linux-gnueabihf -lpthread
CC=gcc -g $(INCL)
ifneq (1,$(NO_PNG))
CC += -DUSE_PNG
LINK += -lpng
endif
ifneq (1,$(NO_JPEG))
CC += -DUSE_JPEG
LINK += -ljpeg
endif
dma.o: dma.c dma.h
$(CC) -c $< -o $@
mailbox.o: mailbox.c mailbox.h
$(CC) -c $< -o $@
pwm.o: pwm.c pwm.h ws2811.h
$(CC) -c $< -o $@
pcm.o: pcm.c pcm.h
$(CC) -c $< -o $@
rpihw.o: rpihw.c rpihw.h
$(CC) -c $< -o $@
ifneq (1,$(NO_PNG))
readpng.o: readpng.c readpng.h
$(CC) -c $< -o $@
endif
ws2811.o: ws2811.c ws2811.h rpihw.h pwm.h pcm.h mailbox.h clk.h gpio.h dma.h rpihw.h readpng.h
$(CC) -c $< -o $@
main.o: main.c ws2811.h
$(CC) -c $< -o $@
ifneq (1,$(NO_PNG))
ws2812svr: main.o dma.o mailbox.o pwm.o pcm.o ws2811.o rpihw.o readpng.o
$(CC) $(LINK) $^ -o $@
else
ws2812svr: main.o dma.o mailbox.o pwm.o pcm.o ws2811.o rpihw.o
$(CC) $(LINK) $^ -o $@
endif
clean:
rm *.o
install: ws2812svr
cp ws2812svr.service /etc/systemd/system/ws2812svr.service
cp -n ws2812svr.conf /etc/ws2812svr.conf
cp ws2812svr /usr/local/bin
systemctl daemon-reload
-systemctl stop ws2812svr.service
systemctl enable ws2812svr.service
systemctl start ws2812svr.service