annotate Makefile @ 0:5f21a4dddc0c

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