-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
53 lines (41 loc) · 1.09 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
# SPDX-License-Identifier: GPL-2.0
#
# Copyright (C) 2021-2022 Xilinx, Inc.
# Copyright (C) 2022-2023 Advanced Micro Devices, Inc.
# Authors:
# Sonal Santan <[email protected]>
#
obj-m += sched_test.o
ccflags-y := -Iinclude/drm
sched_test-y := \
sched_test_drv.o \
sched_test_core.o
COMPILE_DB = compile_commands.json
CONFIG_MODULE_SIG=n
KERNEL_VERSION ?= $(shell uname -r)
KERNEL_SRC := /lib/modules/$(KERNEL_VERSION)/build
PWD := $(shell pwd)
ROOT := $(dir $(M))
SECURE := $(test -f /var/lib/dkms/mok.pub)
ifeq ($(DEBUG),1)
ccflags-y += -DDEBUG
endif
ifeq ($(SYMBOL),1)
ccflags-y += -g
endif
all:
@echo $(PWD)
$(MAKE) -C $(KERNEL_SRC) M=$(PWD) modules
sign: all
sudo $(KERNEL_SRC)/scripts/sign-file sha256 /var/lib/dkms/mok.key /var/lib/dkms/mok.pub sched_test.ko
install: all
sudo $(MAKE) -C $(KERNEL_SRC) M=$(PWD) modules_install
sudo depmod -a
-sudo rmmod sched_test
-sudo modprobe sched_test
clean:
rm -rf *.o *.o.d *~ core .depend .*.cmd *.ko *.ko.unsigned *.mod.c \
.tmp_versions *.symvers modules.order
$(COMPILE_DB): main.cpp kernel.cpp
bear -- make all
compdb: $(COMPILE_DB)