-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
65 lines (49 loc) · 1.14 KB
/
Makefile
File metadata and controls
65 lines (49 loc) · 1.14 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
# SPDX-License-Identifier: GPL-2.0
# Copyright (c) 2026 Ant Group Corporation.
#!/usr/bin/make -f
ifeq (,$(BUILD_KERNEL))
BUILD_KERNEL=$(shell uname -r)
endif
KBUILD_MODPOST_WARN = 1
EXTRA_CFLAGS += -I$(src)
ifeq ($(DEBUG),y)
EXTRA_CFLAGS += -DDEBUG
endif
obj-m := slimvm.o
slimvm-objs := \
vmx.o \
core.o \
ept.o \
instance.o \
mm.o \
vcpu.o \
vmcs.o \
exception.o \
seccomp.o \
proc.o
list-m := slimvm
# KSRC should be set to the path to your sources
# modules are installed into KMISC
KVER := $(BUILD_KERNEL)
# Allow KSRC to be overridden from command line for cross-compilation
ifeq (,$(KSRC))
KSRC := /lib/modules/$(KVER)/build
endif
KMISC := /lib/modules/$(KVER)/kernel/drivers/misc
PWD=$(shell pwd)
all: modules
clean:
rm -f *.mod.c *.mod *.o *.ko .*.cmd .*.flags .lst *.lst *.order *.symvers
rm -rf .tmp_versions
distclean: clean
rm -f tags TAGS
modules:
$(MAKE) -C $(KSRC) M=$(PWD) modules
.PHONY: TAGS tags
install: modules
install -d $(KMISC)
install -m 644 -c $(addsuffix .ko,$(list-m)) $(KMISC)
/sbin/depmod -a ${KVER}
uninstall:
rm -rf $(addprefix $(KMISC)/,$(addsuffix .ko,$(list-m)))
/sbin/depmod -a ${KVER}