Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
PWD := $(shell pwd)
BUILDSYSTEM_DIR := /lib/modules/$(shell uname -r)/build
KERNEL_VERSION := $(shell uname -r | cut -d '.' -f 1,2)

BUILDSYSTEM_DIR ?= /lib/modules/$(shell uname -r)/build
CXL_DIR ?= cxl_6.10

INSTALL_MOD_PATH ?=
INSTALL_MOD_PATH_ARG := $(if $(strip $(INSTALL_MOD_PATH)),INSTALL_MOD_PATH="$(INSTALL_MOD_PATH)",)

ifneq ($(KERNELRELEASE),)
ifneq ($(DEBUG),)
EXTRA_CFLAGS += -DCONFIG_DEBUG_DMA
endif
obj-m += mx_dma.o
mx_dma-objs := init.o fops.o helper.o transfer.o queue_handler.o
obj-m += cxl_$(KERNEL_VERSION)/
obj-m += $(CXL_DIR)/
else
all:
@echo INSTALL_MOD_PATH=$(INSTALL_MOD_PATH)
$(MAKE) -C $(BUILDSYSTEM_DIR) M=$(PWD) modules
install: all
$(MAKE) -C $(BUILDSYSTEM_DIR) M=$(PWD) modules_install
depmod -a
$(MAKE) -C $(BUILDSYSTEM_DIR) M=$(PWD) modules_install $(INSTALL_MOD_PATH_ARG) DEPMOD=/bin/true

Copilot AI May 19, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a comment explaining the override of DEPMOD to '/bin/true' to clarify its purpose in the cross compile context.

Copilot uses AI. Check for mistakes.
clean:
$(MAKE) -C $(BUILDSYSTEM_DIR) M=$(PWD) clean
@/bin/rm -f *.ko modules.order *.mod.c *.o *.o.ur-safe .*.o.cmd
Expand Down
8 changes: 4 additions & 4 deletions install.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#!/bin/bash
#

make clean
make install -j`nproc`
make install -j$(nproc)
depmod -a

kernel_version=$(uname -r)
mx_dma_path=$(find /lib/modules/${kernel_version}/ -type f -name "mx_dma.ko" 2>/dev/null)
Expand All @@ -16,5 +17,4 @@ fi

sed -i '/cxl_/d' /etc/modules
sed -i '/mx_dma/d' /etc/modules
find "$mx_dma_dir" -type f -name "*.ko" >> /etc/modules

find "$mx_dma_dir" -type f -name "*.ko" >>/etc/modules