-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
55 lines (47 loc) · 1.57 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
CC := gcc
SRCDIR := src
BUILDDIR := build
BINDIR := bin
TARGET := bin/limboradio
SRCEXT := c
SOURCES := $(shell find $(SRCDIR) -type f -name *.$(SRCEXT))
OBJECTS := $(patsubst $(SRCDIR)/%,$(BUILDDIR)/%,$(SOURCES:.$(SRCEXT)=.o))
CFLAGS := -g # -Wall
LIB := -pthread -lmpdclient -lwiringPi -lwebsockets -ljansson -L lib -lm
INC := -I include
$(TARGET): $(OBJECTS)
@echo " Linking..."
@mkdir -p $(BINDIR)
@echo " $(CC) $^ -o $(TARGET) $(LIB)"; $(CC) $^ -o $(TARGET) $(LIB)
$(BUILDDIR)/%.o: $(SRCDIR)/%.$(SRCEXT)
@echo " Building..."
@mkdir -p $(BUILDDIR)
@echo " $(CC) $(CFLAGS) $(INC) -c -o $@ $<"; $(CC) $(CFLAGS) $(INC) -c -o $@ $<
setup:
install -m 0644 etc/asound.conf /etc
install -m 0755 etc/config.txt /boot
install -m 0644 etc/modload-limboradio.conf /etc/modules-load.d
install -m 0644 etc/modprobe-limboradio.conf /etc/modprobe.d
install -m 0644 etc/fallback /etc/netctl
systemctl enable mpd
systemctl enable netctl-auto@wlan0
install:
install -m 0755 $(TARGET) /usr/bin
install -m 0755 etc/limboradio.service /usr/lib/systemd/system
install -m 0755 etc/limbonoise.service /usr/lib/systemd/system
systemctl enable limboradio
systemctl enable limbonoise
rm -rf /var/limboradio
cp -rf web/dist /var/limboradio
uninstall:
systemctl disable limbonoise
systemctl disable limboradio
rm -f /usr/lib/systemd/system/limbonoise.service
rm -f /usr/lib/systemd/system/limboradio.service
rm -f /usr/bin/limboradio
rm -f /etc/limboradio.json
rm -rf /var/limboradio
clean:
@echo " Cleaning...";
@echo " $(RM) -r $(BUILDDIR) $(TARGET)"; $(RM) -r $(BUILDDIR) $(TARGET)
all: $(TARGET)