[systemd-devel] [PATCH] ease installation on non-running kernels
Dave Reisner
dreisner at archlinux.org
Tue Jun 17 11:52:43 PDT 2014
This lets KERNELDIR apply to the install target as well so that you can
do something such as the following will Just Work™:
make KERNELDIR=/lib/modules/3.15.0-foo install
---
Makefile | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/Makefile b/Makefile
index c593b51..fe4dd58 100644
--- a/Makefile
+++ b/Makefile
@@ -17,7 +17,7 @@ kdbus$(EXT)-y := \
obj-m += kdbus$(EXT).o
-KERNELDIR ?= /lib/modules/$(shell uname -r)/build
+KERNELDIR ?= /lib/modules/$(shell uname -r)
PWD := $(shell pwd)
all: module test
@@ -26,7 +26,7 @@ test::
$(MAKE) -C test KBUILD_MODNAME=kdbus$(EXT)
module:
- $(MAKE) -C $(KERNELDIR) M=$(PWD)
+ $(MAKE) -C $(KERNELDIR)/build M=$(PWD)
clean:
rm -f *.o *~ core .depend .*.cmd *.ko *.mod.c
@@ -38,15 +38,15 @@ check:
test/test-kdbus
install: module
- mkdir -p /lib/modules/$(shell uname -r)/kernel/drivers/kdbus$(EXT)/
- cp -f kdbus$(EXT).ko /lib/modules/$(shell uname -r)/kernel/drivers/kdbus$(EXT)/
- depmod $(shell uname -r)
+ mkdir -p $(KERNELDIR)/kernel/drivers/kdbus$(EXT)/
+ cp -f kdbus$(EXT).ko $(KERNELDIR)/kernel/drivers/kdbus$(EXT)/
+ depmod $(notdir $(patsubst %/, %, $(KERNELDIR)))
uninstall:
- rm -f /lib/modules/$(shell uname -r)/kernel/drivers/kdbus/kdbus$(EXT).ko
+ rm -f $(KERNELDIR)/kernel/drivers/kdbus/kdbus$(EXT).ko
coccicheck:
- $(MAKE) -C $(KERNELDIR) M=$(PWD) coccicheck
+ $(MAKE) -C $(KERNELDIR)/build M=$(PWD) coccicheck
tt: all
sudo sh -c 'dmesg -c > /dev/null'
--
2.0.0
More information about the systemd-devel
mailing list