-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
63 lines (49 loc) · 1.91 KB
/
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# PREFIX is used to prefix where the files will be installed under DESTDIR
PREFIX?=/usr
# UDEV_PREFIX is specifically a prefix for udev files
UDEV_PREFIX?=$(PREFIX)
# DESTDIR is used to install into a different root directory
DESTDIR?=/
# Specify the kernel directory to use
KERNELDIR?=/lib/modules/$(shell uname -r)/build
# Need the absolute directory do the driver directory to build kernel modules
DRIVERDIR?=$(shell pwd)/driver
# Where kernel drivers are going to be installed
MODULEDIR?=/lib/modules/$(shell uname -r)/kernel/drivers/hid
DKMS_NAME?=openvpc-driver
DKMS_VER?=0.1.0
# Build all target
all: tools
# Driver compilation
driver:
@echo -e "\n::\033[32m Compiling OpenVPC kernel modules\033[0m"
@echo "========================================"
$(MAKE) -C $(KERNELDIR) M=$(DRIVERDIR) modules
driver_clean:
@echo -e "\n::\033[32m Cleaning OpenVPC kernel modules\033[0m"
@echo "========================================"
$(MAKE) -C "$(KERNELDIR)" M="$(DRIVERDIR)" clean
tools:
@echo -e "\n::\033[32m Compiling OpenVPC tools\033[0m"
@echo "========================================"
$(MAKE) -C "$(shell pwd)/tools"
tools_clean:
@echo -e "\n::\033[32m Cleaning OpenVPC tools\033[0m"
@echo "========================================"
$(MAKE) -C "$(shell pwd)/tools" clean
shift_tool:
@echo -e "\n::\033[32m Compiling OpenVPC shift tool\033[0m"
@echo "========================================"
$(MAKE) -C "$(shell pwd)/tools/shift_tool"
shift_tool_clean:
@echo -e "\n::\033[32m Cleaning OpenVPC shift tool\033[0m"
@echo "========================================"
$(MAKE) -C "$(shell pwd)/tools/shift_tool" clean
shift_tool_install:
@echo -e "\n::\033[32m Installing OpenVPC shift tool\033[0m"
@echo "========================================"
$(MAKE) -C "$(shell pwd)/tools/shift_tool" install
install: shift_tool_install
# Clean target
clean: driver_clean tools_clean
.PHONY: driver tools shift_tool shift_tool_install