Skip to content

Commit

Permalink
refactor: Better handling of the mrf module variables.
Browse files Browse the repository at this point in the history
  • Loading branch information
jerzyjamroz committed Nov 1, 2024
1 parent 7ae6e3b commit 6acea8a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion mrmShared/linux/CONFIG_TARGET
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
OS_NAME := $(shell grep "^NAME=" /etc/os-release | cut -d'=' -f2)
# List backported OSes that use VM_FLAGS_WRAPPER for kernels <= 6.3
ifeq ($(OS_NAME), "CentOS Stream")
CFLAGS_MODULE += -DUSE_VM_FLAGS_WRAPPER
CFLAGS_TARGET += -DUSE_VM_FLAGS_WRAPPER
endif
3 changes: 2 additions & 1 deletion mrmShared/linux/Kbuild
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
KBUILD_CPPFLAGS += -DDRV_VERSION='"$(DRV_VERSION)"'
CFLAGS_MODULE += -DDRV_VERSION='"$(DRV_VERSION)"'
CFLAGS_MODULE += $(CFLAGS_TARGET)

obj-m := mrf.o

Expand Down
5 changes: 4 additions & 1 deletion mrmShared/linux/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@ KERNELDIR ?= /lib/modules/$(shell uname -r)/build
include CONFIG
include CONFIG_TARGET

MAKE += DRV_VERSION=$(DRV_VERSION)
MAKE += CFLAGS_TARGET=$(CFLAGS_TARGET)

all: modules

modules modules_install clean:
$(MAKE) -C $(KERNELDIR) DRV_VERSION='$(DRV_VERSION)' M=$(CURDIR) CFLAGS_MODULE=$(CFLAGS_MODULE) $@
$(MAKE) -C $(KERNELDIR) M=$(CURDIR) $@

.PHONY: all modules modules_install clean
2 changes: 1 addition & 1 deletion mrmShared/linux/dkms-rpm/Makefile.dkms.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
KERNEL_DIR ?= /lib/modules/$(kernelver)/build

mrf.ko:
make -C $(KERNEL_DIR) M=$(CURDIR) CFLAGS_MODULE=$(CFLAGS_MODULE) modules
make -C $(KERNEL_DIR) M=$(CURDIR) CFLAGS_TARGET=$(CFLAGS_TARGET) modules

0 comments on commit 6acea8a

Please sign in to comment.