This repository was archived by the owner on Sep 28, 2024. It is now read-only.
Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
92 lines (76 loc) · 3.08 KB
/
Copy pathMakefile
File metadata and controls
92 lines (76 loc) · 3.08 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
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
obj-m += hv_vmbus.o
obj-m += hv_storvsc.o
obj-m += hv_netvsc.o
obj-m += hv_utils.o
obj-m += hid-hyperv.o
obj-m += hyperv_fb.o
obj-m += hv_balloon.o
obj-m += hyperv-keyboard.o
# Get machine bit length
arch=$(shell getconf LONG_BIT)
# Get RHEL/CentOS version information
rhel_major=$(shell grep -Eoh [0-9]+\.[0-9]+ /etc/{issue,*release} | head -1 | awk -F'.' '{ print $$1 }')
rhel_minor=$(shell grep -Eoh [0-9]+\.[0-9]+ /etc/{issue,*release} | head -1 | awk -F'.' '{ print $$2 }')
rhel_release_code=$(shell echo $$(($(rhel_major) << 8 | $(rhel_minor))))
# RDMA should only build on 64 bits arch
ifeq ($(arch), 64)
# Network direct driver in LIS is supported for RHEL/CentOS <= 7.6
build_hv_network_direct=$(shell test $(rhel_release_code) -lt 1799; echo $$?)
ifeq ($(build_hv_network_direct),0)
obj-m += hv_network_direct.o
endif
endif
# Kernel support for Hyper-V Sockets driver was introduced in RHEL/CentOS 7.4
# Only build the hv_sock driver on RHEL 7.4 and newer.
# The RHEL_RELEASE_CODE for RHEL/CentOS 7.3 = 1795.
build_hvsock=$(shell test $(rhel_release_code) -gt 1795; echo $$?)
ifeq ($(build_hvsock),0)
obj-m += hv_sock.o
endif
# Kernel support for the Hyper-V PCI driver was introduced in RHEL/CentOS 7.3
# Only build the pci-hyperv driver on RHEL 7.3 and newer.
# The RHEL_RELEASE_CODE for RHEL/CentOS 7.2 = 1794.
build_pci=$(shell test $(rhel_release_code) -gt 1794; echo $$?)
ifeq ($(build_pci),0)
obj-m += pci-hyperv.o
endif
# UIO underlying function are not yet in rhel6.x so make it conditional for future release
buildrdma=$(shell test $(rhel_release_code) -gt 1795; echo $$?)
ifeq ($(buildrdma),0)
ifeq ($(arch), 64)
obj-m += uio_hv_generic.o
endif
endif
# Get extra kernel version information beyond LINUX_VERSION_CODE or RHEL_RELEASE_CODE.
# This is used to identify RHEL/CentOS kernel update versions.
extraversioninfo = $(shell uname -r | awk -F'-' '{print $$2}')
ifdef KERNEL_VERSION
extraversioninfo = $(shell echo $(KERNEL_VERSION) | awk -F'-' '{print $$2}' )
endif
extraversion1 = $(shell echo $(extraversioninfo) | awk -F'.' '{print $$1}' | grep -E '^[0-9]+$$')
ifneq ($(extraversion1),)
ccflags-y += -DEXTRAVERSION1=$(extraversion1)
else
ccflags-y += -DEXTRAVERSION1=0
endif
extraversion2 = $(shell echo $(extraversioninfo) | awk -F'.' '{print $$2}' | grep -E '^[0-9]+$$')
ifneq ($(extraversion2),)
ccflags-y += -DEXTRAVERSION2=$(extraversion2)
else
ccflags-y += -DEXTRAVERSION2=0
endif
ccflags-y += -I$(M)/include/ -I$(M)/arch/$(ARCH)/include -I$(M)/arch/$(ARCH)/include/uapi
CFLAGS_hv_trace.o = -I$(src)
CFLAGS_hv_balloon.o = -I$(src)
hv_vmbus-y := vmbus_drv.o \
hv.o connection.o channel.o hv_trace.o \
channel_mgmt.o ring_buffer.o \
arch/$(ARCH)/hyperv/hv_init.o \
arch/$(ARCH)/hyperv/ms_hyperv_ext.o
hv_utils-y := hv_util.o hv_kvp.o hv_snapshot.o hv_fcopy.o hv_utils_transport.o
hv_storvsc-y := storvsc_drv.o
hv_netvsc-y := netvsc_drv.o netvsc.o rndis_filter.o
hyperv_keyboard-y := hyperv-keyboard.o
hv_network_direct-y := provider.o vmbus_rdma.o hvnd_addr.o
hv_sock-y := hyperv_transport.o
hv_uio_generic-y := uio_hv_generic.o