File: Makefile

package info (click to toggle)
bbswitch 0.8-17
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 264 kB
  • sloc: ansic: 376; makefile: 84
file content (39 lines) | stat: -rw-r--r-- 701 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
modname := bbswitch

ifneq ($(KERNELRELEASE),)
# Kbuild mode

obj-m := $(modname).o

ifdef DEBUG
CFLAGS_$(obj-m) := -DDEBUG
endif

else
# Makefile mode

KVERSION	?= $(shell uname -r)
KDIR		?= /lib/modules/$(KVERSION)/build

default:
	$(MAKE) -C $(KDIR) M=$(CURDIR) modules

clean:
	$(MAKE) -C $(KDIR) M=$(CURDIR) 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

endif