annotate Makefile @ 5:fa5d2b9d8831

Add make dist to create tarball without .svn contest
author AngelCarpintero
date Sun, 18 May 2008 19:24:57 +0000
parents 390a65d28b53
children d3fdefea8bce
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
fa5d2b9d8831 Add make dist to create tarball without .svn contest
AngelCarpintero
parents: 2
diff changeset
2
0
5f21a4dddc0c Initial checkin
KennethLavrsen
parents:
diff changeset
3 ifneq ($(KERNELRELEASE),)
5f21a4dddc0c Initial checkin
KennethLavrsen
parents:
diff changeset
4
5f21a4dddc0c Initial checkin
KennethLavrsen
parents:
diff changeset
5 obj-m := vloopback.o
5f21a4dddc0c Initial checkin
KennethLavrsen
parents:
diff changeset
6
5f21a4dddc0c Initial checkin
KennethLavrsen
parents:
diff changeset
7 else
5f21a4dddc0c Initial checkin
KennethLavrsen
parents:
diff changeset
8
5f21a4dddc0c Initial checkin
KennethLavrsen
parents:
diff changeset
9 KVER := $(shell uname -r)
5f21a4dddc0c Initial checkin
KennethLavrsen
parents:
diff changeset
10 KLINK := $(shell test -e /lib/modules/${KVER}/source/ && echo source || echo "build")
5f21a4dddc0c Initial checkin
KennethLavrsen
parents:
diff changeset
11 KSRC := /lib/modules/$(KVER)/$(KLINK)
5f21a4dddc0c Initial checkin
KennethLavrsen
parents:
diff changeset
12 PWD := $(shell pwd)
5f21a4dddc0c Initial checkin
KennethLavrsen
parents:
diff changeset
13 DEST := /lib/modules/$(KVER)/kernel/drivers/misc
5f21a4dddc0c Initial checkin
KennethLavrsen
parents:
diff changeset
14
5f21a4dddc0c Initial checkin
KennethLavrsen
parents:
diff changeset
15 # Fix some problem with suse < 9.2 and suse >= 9.2
5f21a4dddc0c Initial checkin
KennethLavrsen
parents:
diff changeset
16 is_suse := $(shell test -e /etc/SuSE-release && echo 1 || echo 0)
5f21a4dddc0c Initial checkin
KennethLavrsen
parents:
diff changeset
17 ifeq ($(is_suse),1)
5f21a4dddc0c Initial checkin
KennethLavrsen
parents:
diff changeset
18 suse_version := $(shell grep VERSION /etc/SuSE-release | cut -f 3 -d " "| tr -d .)
5f21a4dddc0c Initial checkin
KennethLavrsen
parents:
diff changeset
19 is_suse_92_or_greater := $(shell test $(suse_version) -ge 92 && echo 1)
5f21a4dddc0c Initial checkin
KennethLavrsen
parents:
diff changeset
20 ifeq ($(is_suse_92_or_greater),1)
5f21a4dddc0c Initial checkin
KennethLavrsen
parents:
diff changeset
21 KSRC := /lib/modules/$(KVER)/build
5f21a4dddc0c Initial checkin
KennethLavrsen
parents:
diff changeset
22 endif
5f21a4dddc0c Initial checkin
KennethLavrsen
parents:
diff changeset
23 endif
5f21a4dddc0c Initial checkin
KennethLavrsen
parents:
diff changeset
24
5f21a4dddc0c Initial checkin
KennethLavrsen
parents:
diff changeset
25
5f21a4dddc0c Initial checkin
KennethLavrsen
parents:
diff changeset
26
5f21a4dddc0c Initial checkin
KennethLavrsen
parents:
diff changeset
27 all default:
5f21a4dddc0c Initial checkin
KennethLavrsen
parents:
diff changeset
28 $(MAKE) -C $(KSRC) SUBDIRS=$(PWD) modules
5f21a4dddc0c Initial checkin
KennethLavrsen
parents:
diff changeset
29
5f21a4dddc0c Initial checkin
KennethLavrsen
parents:
diff changeset
30 install:
5f21a4dddc0c Initial checkin
KennethLavrsen
parents:
diff changeset
31 install -d $(DEST)
5f21a4dddc0c Initial checkin
KennethLavrsen
parents:
diff changeset
32 install -m 644 -c vloopback.ko $(DEST)
5f21a4dddc0c Initial checkin
KennethLavrsen
parents:
diff changeset
33 -/sbin/depmod -a
5f21a4dddc0c Initial checkin
KennethLavrsen
parents:
diff changeset
34
5f21a4dddc0c Initial checkin
KennethLavrsen
parents:
diff changeset
35
5f21a4dddc0c Initial checkin
KennethLavrsen
parents:
diff changeset
36 uninstall:
5f21a4dddc0c Initial checkin
KennethLavrsen
parents:
diff changeset
37 rm -f $(DEST)/vloopback.ko
5f21a4dddc0c Initial checkin
KennethLavrsen
parents:
diff changeset
38 -/sbin/depmod -a
5f21a4dddc0c Initial checkin
KennethLavrsen
parents:
diff changeset
39 clean:
2
390a65d28b53 Add a better clean option in Makefile
AngelCarpintero
parents: 0
diff changeset
40 rm -f .*.cmd *.o *.mod.c *.ko .v* *~ core Modules.symvers
0
5f21a4dddc0c Initial checkin
KennethLavrsen
parents:
diff changeset
41 rm -rf .tmp_versions/
2
390a65d28b53 Add a better clean option in Makefile
AngelCarpintero
parents: 0
diff changeset
42 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
43
fa5d2b9d8831 Add make dist to create tarball without .svn contest
AngelCarpintero
parents: 2
diff changeset
44 dist: clean
fa5d2b9d8831 Add make dist to create tarball without .svn contest
AngelCarpintero
parents: 2
diff changeset
45 cd .. ; tar cfvz vloopback-$(VERSION).tar.gz --exclude='.svn' $(VERSION)/
0
5f21a4dddc0c Initial checkin
KennethLavrsen
parents:
diff changeset
46 endif