-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
36 lines (29 loc) · 1.24 KB
/
Makefile
File metadata and controls
36 lines (29 loc) · 1.24 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
LIB_CFLAGS := $(shell pkg-config --cflags libevdev libudev)
LIB_LDFLAGS := $(shell pkg-config --libs libevdev libudev)
CFLAGS += -Wall -Wextra $(LIB_CFLAGS)
ifneq ($(ASAN),)
CFLAGS += -g -fsanitize=address
LDFLAGS += -g -fsanitize=address
else ifneq ($(DEBUG),)
CFLAGS += -g
LDFLAGS += -g
else
CFLAGS += -O2
LDFLAGS += -O2
endif
all: steamos-powerbuttond
.PHONY: clean install
steamos-powerbuttond: powerbuttond.o
$(CC) $(LIB_LDFLAGS) $(LDFLAGS) $< -o $@
%.o: %.c
$(CC) $(CFLAGS) $^ -c -o $@
clean:
rm -f steamos-powerbuttond powerbuttond.o
install: all LICENSE
install -Ds -m 755 steamos-powerbuttond $(DESTDIR)/usr/lib/hwsupport/steamos-powerbuttond
install -D -m 644 LICENSE $(DESTDIR)/usr/share/licenses/steamos-powerbuttond/LICENSE
install -D -m 644 steamos-powerbuttond.service $(DESTDIR)/usr/lib/systemd/user/steamos-powerbuttond.service
install -D -m 644 steamos-power-button.rules $(DESTDIR)/usr/lib/udev/rules.d/70-steamos-power-button.rules
install -D -m 644 steamos-power-button.hwdb $(DESTDIR)/usr/lib/udev/hwdb.d/70-steamos-power-button.hwdb
install -d -m 755 $(DESTDIR)/usr/lib/systemd/user/gamescope-session.service.wants
ln -s ../steamos-powerbuttond.service $(DESTDIR)/usr/lib/systemd/user/gamescope-session.service.wants/