-
Notifications
You must be signed in to change notification settings - Fork 60
/
Copy pathMakefile
39 lines (33 loc) · 879 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
35
36
37
38
PREFIX = /usr/local
INSTALL = /usr/bin/install -c
INSTALLDATA = /usr/bin/install -c -m 644
CFLAGS = -Wall
UNAME := $(shell uname)
ifeq ($(UNAME), Darwin)
CFLAGS += -DOSX $(shell pkg-config --cflags hidapi)
LDLIBS = $(shell pkg-config --libs hidapi)
else
ifeq ($(UNAME), Linux)
CFLAGS += $(shell pkg-config --cflags hidapi-libusb)
LDLIBS = $(shell pkg-config --libs hidapi-libusb)
else
LDLIBS = -lhidapi
endif
endif
all: footswitch scythe
footswitch: footswitch.c common.c debug.c
scythe: scythe.c common.c debug.c
install: all
$(INSTALL) footswitch $(PREFIX)/bin
$(INSTALL) scythe $(PREFIX)/bin
ifeq ($(UNAME), Linux)
$(INSTALLDATA) 19-footswitch.rules /etc/udev/rules.d
endif
uninstall:
rm -f $(PREFIX)/bin/footswitch
rm -f $(PREFIX)/bin/scythe
ifeq ($(UNAME), Linux)
rm -f /etc/udev/rules.d/19-footswitch.rules
endif
clean:
rm -f scythe footswitch *.o