-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
47 lines (36 loc) · 928 Bytes
/
Copy pathMakefile
File metadata and controls
47 lines (36 loc) · 928 Bytes
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
# Config
CC = /usr/bin/gcc
CFLAGS = -Wall
INSTALL = /usr/bin/install
PREFIX = /usr
XBMC = /var/lib/xbmc/.xbmc/userdata/keymaps
# Install stuff
keymap = xbmc/keyboard.xml
service = systemd/ps3remote.service
systemd = /usr/lib/systemd/system
bin = $(PREFIX)/bin
LDLIBS = -ludev
srcs = hid.c hidraw.c main.c uinput.c
srcs := $(addprefix src/,$(srcs))
objs = $(srcs:.c=.o)
target = ps3remote
# Rules
all: CFLAGS += -DDEBUG=0 -O3
all: $(target)
debug: CFLAGS += -g -DDEBUG -Og
debug: $(target)
install: $(target)
$(INSTALL) -o root -m 755 $(target) $(bin)
$(INSTALL) -o root -m 644 $(service) $(systemd)
installxbmc: install
$(INSTALL) -o xbmc -m 644 $(keymap) $(XBMC)
uninstall:
rm -f $(bin)/$(target)
rm -f $(systemd)/$(service)
clean:
$(RM) $(target) $(objs)
$(target): $(objs)
$(CC) $(CFLAGS) $^ -o $(target) $(LDLIBS)
%.o: %.c
$(CC) $(CFLAGS) -c $< -o $@
.PHONY: all clean debug install installxbmc uninstall