diff options
author | Ondrej Čerman | 2018-11-10 23:17:51 +0100 |
---|---|---|
committer | Ondrej Čerman | 2018-11-10 23:17:51 +0100 |
commit | ba72ab76e44fe0582c63469e23ac0c5788a22398 (patch) | |
tree | e2ae928776133fe7677471d49b8536032f39a05a /Makefile |
Initial commit
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..e78339a --- /dev/null +++ b/Makefile @@ -0,0 +1,29 @@ +TARGET := $(shell uname -r) +KERNEL_BUILD := /usr/src/linux-headers-$(TARGET) +DKMS_ROOT_PATH := /usr/src/zenpower-0.1.0 + +obj-m := $(patsubst %,%.o,zenpower) +obj-ko := $(patsubst %,%.ko,zenpower) + +.PHONY: all modules clean dkms-install dkms-uninstall + +all: modules + +modules: + @$(MAKE) -C $(KERNEL_BUILD) M=$(CURDIR) modules + +clean: + @$(MAKE) -C $(KERNEL_BUILD) M=$(CURDIR) clean + +dkms-install: + mkdir $(DKMS_ROOT_PATH) + cp $(CURDIR)/dkms.conf $(DKMS_ROOT_PATH) + cp $(CURDIR)/Makefile $(DKMS_ROOT_PATH) + cp $(CURDIR)/zenpower.c $(DKMS_ROOT_PATH) + dkms add zenpower/0.1.0 + dkms build zenpower/0.1.0 + dkms install zenpower/0.1.0 + +dkms-uninstall: + dkms remove zenpower/0.1.0 --all + rm -rf $(DKMS_ROOT_PATH) |