annotate Makefile @ 11:b904131a3807

Allow to build with kernel 2.6.27.git and 2.6.28-rc9
author AngelCarpintero
date Mon, 22 Dec 2008 04:32:52 +0000
parents bce647a9dd4b
children 647e63ddab46
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
5
fa5d2b9d8831 Add make dist to create tarball without .svn contest
AngelCarpintero
parents: 2
diff changeset
1 VERSION=trunk
8
80590d10a596 Added num of buffers as a module param, indent code using spaces instead of tabs
AngelCarpintero
parents: 6
diff changeset
2 MODULENAME=vloopback
5
fa5d2b9d8831 Add make dist to create tarball without .svn contest
AngelCarpintero
parents: 2
diff changeset
3
0
5f21a4dddc0c Initial checkin
KennethLavrsen
parents:
diff changeset
4 ifneq ($(KERNELRELEASE),)
5f21a4dddc0c Initial checkin
KennethLavrsen
parents:
diff changeset
5
8
80590d10a596 Added num of buffers as a module param, indent code using spaces instead of tabs
AngelCarpintero
parents: 6
diff changeset
6 obj-m := $(MODULENAME).o
0
5f21a4dddc0c Initial checkin
KennethLavrsen
parents:
diff changeset
7
5f21a4dddc0c Initial checkin
KennethLavrsen
parents:
diff changeset
8 else
5f21a4dddc0c Initial checkin
KennethLavrsen
parents:
diff changeset
9
5f21a4dddc0c Initial checkin
KennethLavrsen
parents:
diff changeset
10 KVER := $(shell uname -r)
5f21a4dddc0c Initial checkin
KennethLavrsen
parents:
diff changeset
11 KLINK := $(shell test -e /lib/modules/${KVER}/source/ && echo source || echo "build")
5f21a4dddc0c Initial checkin
KennethLavrsen
parents:
diff changeset
12 KSRC := /lib/modules/$(KVER)/$(KLINK)
5f21a4dddc0c Initial checkin
KennethLavrsen
parents:
diff changeset
13 PWD := $(shell pwd)
5f21a4dddc0c Initial checkin
KennethLavrsen
parents:
diff changeset
14 DEST := /lib/modules/$(KVER)/kernel/drivers/misc
5f21a4dddc0c Initial checkin
KennethLavrsen
parents:
diff changeset
15
5f21a4dddc0c Initial checkin
KennethLavrsen
parents:
diff changeset
16 # Fix some problem with suse < 9.2 and suse >= 9.2
5f21a4dddc0c Initial checkin
KennethLavrsen
parents:
diff changeset
17 is_suse := $(shell test -e /etc/SuSE-release && echo 1 || echo 0)
5f21a4dddc0c Initial checkin
KennethLavrsen
parents:
diff changeset
18 ifeq ($(is_suse),1)
5f21a4dddc0c Initial checkin
KennethLavrsen
parents:
diff changeset
19 suse_version := $(shell grep VERSION /etc/SuSE-release | cut -f 3 -d " "| tr -d .)
5f21a4dddc0c Initial checkin
KennethLavrsen
parents:
diff changeset
20 is_suse_92_or_greater := $(shell test $(suse_version) -ge 92 && echo 1)
5f21a4dddc0c Initial checkin
KennethLavrsen
parents:
diff changeset
21 ifeq ($(is_suse_92_or_greater),1)
5f21a4dddc0c Initial checkin
KennethLavrsen
parents:
diff changeset
22 KSRC := /lib/modules/$(KVER)/build
5f21a4dddc0c Initial checkin
KennethLavrsen
parents:
diff changeset
23 endif
5f21a4dddc0c Initial checkin
KennethLavrsen
parents:
diff changeset
24 endif
5f21a4dddc0c Initial checkin
KennethLavrsen
parents:
diff changeset
25
5f21a4dddc0c Initial checkin
KennethLavrsen
parents:
diff changeset
26
9
00bb25bff577 Improve Makefile
AngelCarpintero
parents: 8
diff changeset
27 default: all examples
0
5f21a4dddc0c Initial checkin
KennethLavrsen
parents:
diff changeset
28
9
00bb25bff577 Improve Makefile
AngelCarpintero
parents: 8
diff changeset
29 all:
0
5f21a4dddc0c Initial checkin
KennethLavrsen
parents:
diff changeset
30 $(MAKE) -C $(KSRC) SUBDIRS=$(PWD) modules
5f21a4dddc0c Initial checkin
KennethLavrsen
parents:
diff changeset
31
11
b904131a3807 Allow to build with kernel 2.6.27.git and 2.6.28-rc9
AngelCarpintero
parents: 10
diff changeset
32
b904131a3807 Allow to build with kernel 2.6.27.git and 2.6.28-rc9
AngelCarpintero
parents: 10
diff changeset
33 current: clean svn all
b904131a3807 Allow to build with kernel 2.6.27.git and 2.6.28-rc9
AngelCarpintero
parents: 10
diff changeset
34
b904131a3807 Allow to build with kernel 2.6.27.git and 2.6.28-rc9
AngelCarpintero
parents: 10
diff changeset
35 svn:
b904131a3807 Allow to build with kernel 2.6.27.git and 2.6.28-rc9
AngelCarpintero
parents: 10
diff changeset
36 svn update
b904131a3807 Allow to build with kernel 2.6.27.git and 2.6.28-rc9
AngelCarpintero
parents: 10
diff changeset
37
0
5f21a4dddc0c Initial checkin
KennethLavrsen
parents:
diff changeset
38 install:
5f21a4dddc0c Initial checkin
KennethLavrsen
parents:
diff changeset
39 install -d $(DEST)
8
80590d10a596 Added num of buffers as a module param, indent code using spaces instead of tabs
AngelCarpintero
parents: 6
diff changeset
40 install -m 644 -c $(MODULENAME).ko $(DEST)
0
5f21a4dddc0c Initial checkin
KennethLavrsen
parents:
diff changeset
41 -/sbin/depmod -a
5f21a4dddc0c Initial checkin
KennethLavrsen
parents:
diff changeset
42
9
00bb25bff577 Improve Makefile
AngelCarpintero
parents: 8
diff changeset
43 examples:
00bb25bff577 Improve Makefile
AngelCarpintero
parents: 8
diff changeset
44 $(MAKE) -C example
00bb25bff577 Improve Makefile
AngelCarpintero
parents: 8
diff changeset
45
0
5f21a4dddc0c Initial checkin
KennethLavrsen
parents:
diff changeset
46 uninstall:
8
80590d10a596 Added num of buffers as a module param, indent code using spaces instead of tabs
AngelCarpintero
parents: 6
diff changeset
47 rm -f $(DEST)/$(MODULENAME).ko
0
5f21a4dddc0c Initial checkin
KennethLavrsen
parents:
diff changeset
48 -/sbin/depmod -a
5f21a4dddc0c Initial checkin
KennethLavrsen
parents:
diff changeset
49 clean:
10
bce647a9dd4b Some changes to allow working with stock kernel 2.6.27
AngelCarpintero
parents: 9
diff changeset
50 rm -f .*.cmd *.o *.mod.c *.ko .v* *~ core Modules.symvers Module.symvers modules.order
0
5f21a4dddc0c Initial checkin
KennethLavrsen
parents:
diff changeset
51 rm -rf .tmp_versions/
2
390a65d28b53 Add a better clean option in Makefile
AngelCarpintero
parents: 0
diff changeset
52 rm -f example/dummy example/feed example/resize example/invert
5
fa5d2b9d8831 Add make dist to create tarball without .svn contest
AngelCarpintero
parents: 2
diff changeset
53
fa5d2b9d8831 Add make dist to create tarball without .svn contest
AngelCarpintero
parents: 2
diff changeset
54 dist: clean
9
00bb25bff577 Improve Makefile
AngelCarpintero
parents: 8
diff changeset
55 cd .. ; tar cfvz $(MODULENAME)-$(VERSION).tar.gz --exclude='.svn' $(VERSION)/
0
5f21a4dddc0c Initial checkin
KennethLavrsen
parents:
diff changeset
56 endif