-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
42 lines (30 loc) · 729 Bytes
/
Makefile
File metadata and controls
42 lines (30 loc) · 729 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
35
36
37
38
39
40
41
42
CONFIG_MODULE_SIG=n
CONFIG_STACK_VALIDATION=n
MODULE_NAME = amdgpu-i2c
SRCS = \
amd-gpu-dce.c \
amd-gpu-dcn.c \
amd-gpu-reg.c \
amd-gpu-i2c.c \
amd-gpu-pci.c \
main.c
KERNELDIR = /lib/modules/$(shell uname -r)/build
PWD = $(shell pwd)
# KBUILD_EXTRA_SYMBOLS := $(ADAPTERDIR)/Module.symvers
OBJS = $(SRCS:.c=.o)
ccflags-y := -g -Wimplicit-fallthrough=3 -DDEBUG -I$(PWD)/../
ifeq ($(KERNELRELEASE),)
all:
$(MAKE) -C $(KERNELDIR) M=$(PWD) modules
clean:
$(MAKE) -C $(KERNELDIR) M=$(PWD) clean
uninstall:
sudo rmmod $(MODULE_NAME) || true
install: uninstall all
sudo insmod $(MODULE_NAME).ko
build: clean all
.PHONY: all clean uninstall install
else
obj-m += $(MODULE_NAME).o
$(MODULE_NAME)-y = $(OBJS)
endif