-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
34 lines (24 loc) · 712 Bytes
/
Makefile
File metadata and controls
34 lines (24 loc) · 712 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
CFLAGS += -std=gnu99 -Wall -pedantic -Wextra
# Which type of HIDAPI lib to use - libusb or hidraw. libusb is recommended.
HIDAPI_TYPE ?= libusb
# Which directory to find HIDAPI in.
HIDAPI_DIR = ../hidapi.git/
CFLAGS += -I${HIDAPI_DIR}hidapi
ifeq (${HIDAPI_TYPE},libusb)
HIDAPI_LIB_DIR = ${HIDAPI_DIR}libusb/.libs
else
ifeq (${HIDAPI_TYPE},hidraw)
HIDAPI_LIB_DIR = ${HIDAPI_DIR}linux/.libs
else
$(error Unknown HIDAPI type: ${HIDAPI_TYPE})
endif
endif
HIDAPI_LIB = hidapi-${HIDAPI_TYPE}
HIDAPI_LDFLAGS = -L${HIDAPI_LIB_DIR} -Wl,-rpath=${HIDAPI_LIB_DIR} -l${HIDAPI_LIB}
.PHONY: all
all: keytemper
keytemper: LDFLAGS += ${HIDAPI_LDFLAGS}
keytemper: keymap.o
.PHONY: clean
clean:
${RM} keytemper keymap.o