You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
603 B
Makefile
28 lines
603 B
Makefile
modname := bbswitch
|
|
obj-m := $(modname).o
|
|
|
|
KVERSION := $(shell uname -r)
|
|
KDIR := /lib/modules/$(KVERSION)/build
|
|
PWD := "$$(pwd)"
|
|
|
|
default:
|
|
$(MAKE) -C $(KDIR) M=$(PWD) modules
|
|
|
|
clean:
|
|
$(MAKE) O=$(PWD) -C $(KDIR) M=$(PWD) clean
|
|
|
|
load:
|
|
-rmmod $(modname)
|
|
insmod $(modname).ko
|
|
|
|
install:
|
|
mkdir -p /lib/modules/$(KVERSION)/misc/$(modname)
|
|
install -m 0755 -o root -g root $(modname).ko /lib/modules/$(KVERSION)/misc/$(modname)
|
|
depmod -a
|
|
|
|
uninstall:
|
|
rm /lib/modules/$(KVERSION)/misc/$(modname)/$(modname).ko
|
|
rmdir /lib/modules/$(KVERSION)/misc/$(modname)
|
|
rmdir /lib/modules/$(KVERSION)/misc
|
|
depmod -a
|