0
|
1 ifneq ($(KERNELRELEASE),)
|
|
2
|
|
3 obj-m := vloopback.o
|
|
4
|
|
5 else
|
|
6
|
|
7 KVER := $(shell uname -r)
|
|
8 KLINK := $(shell test -e /lib/modules/${KVER}/source/ && echo source || echo "build")
|
|
9 KSRC := /lib/modules/$(KVER)/$(KLINK)
|
|
10 PWD := $(shell pwd)
|
|
11 DEST := /lib/modules/$(KVER)/kernel/drivers/misc
|
|
12
|
|
13 # Fix some problem with suse < 9.2 and suse >= 9.2
|
|
14 is_suse := $(shell test -e /etc/SuSE-release && echo 1 || echo 0)
|
|
15 ifeq ($(is_suse),1)
|
|
16 suse_version := $(shell grep VERSION /etc/SuSE-release | cut -f 3 -d " "| tr -d .)
|
|
17 is_suse_92_or_greater := $(shell test $(suse_version) -ge 92 && echo 1)
|
|
18 ifeq ($(is_suse_92_or_greater),1)
|
|
19 KSRC := /lib/modules/$(KVER)/build
|
|
20 endif
|
|
21 endif
|
|
22
|
|
23
|
|
24
|
|
25 all default:
|
|
26 $(MAKE) -C $(KSRC) SUBDIRS=$(PWD) modules
|
|
27
|
|
28 install:
|
|
29 install -d $(DEST)
|
|
30 install -m 644 -c vloopback.ko $(DEST)
|
|
31 -/sbin/depmod -a
|
|
32
|
|
33
|
|
34 uninstall:
|
|
35 rm -f $(DEST)/vloopback.ko
|
|
36 -/sbin/depmod -a
|
|
37 clean:
|
|
38 rm -f .*.cmd *.o *.mod.c *.ko .v* *~ core
|
|
39 rm -rf .tmp_versions/
|
|
40 endif
|