forked from nowrep/dualsensectl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
34 lines (27 loc) · 980 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
CC = gcc
CFLAGS += -Wall -Wextra -pedantic
CFLAGS += $(shell pkg-config --cflags dbus-1)
CFLAGS += $(shell pkg-config --cflags hidapi-hidraw)
LIBS += $(shell pkg-config --libs dbus-1)
LIBS += $(shell pkg-config --libs hidapi-hidraw)
LIBS += $(shell pkg-config --libs libudev)
TARGET = dualsensectl
VERSION = 0.5
ifeq ($(BUILD),debug)
CFLAGS += -O0 -g
else
CFLAGS += -O2 -s -DNDEBUG
endif
DEFINES += -DDUALSENSECTL_VERSION=\"$(VERSION)\"
all:
$(CC) main.c -o $(TARGET) $(DEFINES) $(CFLAGS) $(LIBS)
debug:
make "BUILD=debug"
install: all
install -D -m 755 -p $(TARGET) $(DESTDIR)/usr/bin/$(TARGET)
install -D -m 644 -p completion/$(TARGET) $(DESTDIR)/usr/share/bash-completion/completions/$(TARGET)
install -D -m 644 -p completion/_$(TARGET) $(DESTDIR)/usr/share/zsh/site-functions/_$(TARGET)
uninstall:
rm -f $(DESTDIR)/usr/bin/$(TARGET)
rm -f $(DESTDIR)/usr/share/bash-completion/completions/$(TARGET)
rm -f $(DESTDIR)/usr/share/zsh/site-functions/_$(TARGET)