From 8293dc9f82fc461953e5bc8d9cb5f528aeb16058 Mon Sep 17 00:00:00 2001 From: Guenter Roeck Date: Sat, 30 Dec 2017 18:25:16 -0800 Subject: [PATCH] Revert "Add optional DKMS target to Makefile" This reverts commit 6c1e48b4f16b65b6e2ff95d950b250581b0cbe91. See comments: "This is indeed not working, at least on Fedora. I tried specifying MAKE and CLEAN but the outcome is the same (which makes sense, since the defaults should already cover this)." Signed-off-by: Guenter Roeck --- Makefile | 42 ++++++------------------------------------ dkms.conf | 5 ----- 2 files changed, 6 insertions(+), 41 deletions(-) delete mode 100644 dkms.conf diff --git a/Makefile b/Makefile index 09ccc89..1b88e2a 100644 --- a/Makefile +++ b/Makefile @@ -20,19 +20,6 @@ endif SYSTEM_MAP := /boot/System.map-$(TARGET) DRIVER := it87 -ifneq ("","$(wildcard .git/*)") -DRIVER_VERSION := $(shell git describe --long) -else -ifneq ("", "$(wildcard VERSION)") -DRIVER_VERSION := $(shell cat VERSION) -else -DRIVER_VERSION := unknown -endif -endif - -# DKMS -DKMS_ROOT_PATH=/usr/src/$(DRIVER)-$(DRIVER_VERSION) -MODPROBE_OUTPUT=$(shell lsmod | grep it87) # Directory below /lib/modules/$(TARGET)/kernel into which to install # the module: @@ -51,13 +38,17 @@ ifneq ("","$(wildcard $(MODDESTDIR)/*.ko.xz)") COMPRESS_XZ := y endif -.PHONY: all install modules modules_install clean dkms dkms_clean +.PHONY: all install modules modules_install clean all: modules # Targets for running make directly in the external module directory: -IT87_CFLAGS=-DIT87_DRIVER_VERSION='\"$(DRIVER_VERSION)\"' +ifneq ("","$(wildcard .git/*)") +IT87_CFLAGS=-DIT87_DRIVER_VERSION='\"$(shell git describe --long)\"' +else +IT87_CFLAGS=-DIT87_DRIVER_VERSION='\"\"' +endif modules: @$(MAKE) EXTRA_CFLAGS="$(IT87_CFLAGS)" -C $(KERNEL_BUILD) M=$(CURDIR) $@ @@ -77,24 +68,3 @@ ifeq ($(COMPRESS_XZ), y) @xz -f $(MODDESTDIR)/$(DRIVER).ko endif depmod -a -F $(SYSTEM_MAP) $(TARGET) - -dkms: - @sed -i -e '/^PACKAGE_VERSION=/ s/=.*/=\"$(DRIVER_VERSION)\"/' dkms.conf - @echo "$(DRIVER_VERSION)" >VERSION - @mkdir $(DKMS_ROOT_PATH) - @cp `pwd`/dkms.conf $(DKMS_ROOT_PATH) - @cp `pwd`/VERSION $(DKMS_ROOT_PATH) - @cp `pwd`/Makefile $(DKMS_ROOT_PATH) - @cp `pwd`/compat.h $(DKMS_ROOT_PATH) - @cp `pwd`/it87.c $(DKMS_ROOT_PATH) - @dkms add -m $(DRIVER) -v $(DRIVER_VERSION) - @dkms build -m $(DRIVER) -v $(DRIVER_VERSION) - @dkms install --force -m $(DRIVER) -v $(DRIVER_VERSION) - @modprobe $(DRIVER) - -dkms_clean: - @if [ ! -z "$(MODPROBE_OUTPUT)" ]; then \ - rmmod $(DRIVER);\ - fi - @dkms remove -m $(DRIVER) -v $(DRIVER_VERSION) --all - @rm -rf $(DKMS_ROOT_PATH) diff --git a/dkms.conf b/dkms.conf deleted file mode 100644 index 03fba8f..0000000 --- a/dkms.conf +++ /dev/null @@ -1,5 +0,0 @@ -PACKAGE_NAME="it87" -PACKAGE_VERSION="to be filled by make dkms" -BUILT_MODULE_NAME[0]="it87" -DEST_MODULE_LOCATION[0]="/kernel/drivers/hwmon/it87" -AUTOINSTALL="yes" -- 2.39.5