diff options
author | Dimitri Staessens <dimitri.staessens@ugent.be> | 2017-12-15 18:13:30 +0100 |
---|---|---|
committer | Dimitri Staessens <dimitri.staessens@ugent.be> | 2017-12-15 18:25:26 +0100 |
commit | 9e419e39cf84f6bc8f0590f319cb6059a73dc660 (patch) | |
tree | b4741c252bdd2b0d8fcc7df3e2867d76127eb74d /linux | |
parent | d1a1059d748955ed93a8e87c437c7eae1258293c (diff) | |
download | raptor-9e419e39cf84f6bc8f0590f319cb6059a73dc660.tar.gz raptor-9e419e39cf84f6bc8f0590f319cb6059a73dc660.zip |
linux: Add install/uninstall targets for make
This adds targets for the Makefile so that the module can be installed
with "make install" and uninstalled using "make uninstall" (with root
privileges).
Diffstat (limited to 'linux')
-rw-r--r-- | linux/Makefile | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/linux/Makefile b/linux/Makefile index 9c7b2b9..86a92fc 100644 --- a/linux/Makefile +++ b/linux/Makefile @@ -1,7 +1,20 @@ obj-m += raptor.o +KERNELVER ?= $(shell uname -r) +KERNELDIR ?= /lib/modules/$(KERNELVER) +PWD := $(shell pwd) +INSTALL_MOD_DIR ?= extra + all: - make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules + make -C $(KERNELDIR)/build M=$(PWD) modules clean: - make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean + make -C $(KERNELDIR)/build M=$(PWD) clean + +install: + make -C $(KERNELDIR)/build M=$(PWD) modules_install + /sbin/depmod -a $(KERNELVER) + +uninstall: + rm $(KERNELDIR)/$(INSTALL_MOD_DIR)/raptor.ko.gz + /sbin/depmod -a $(KERNELVER) |