Mercurial > vloopback
diff Makefile @ 0:5f21a4dddc0c
Initial checkin
author | KennethLavrsen |
---|---|
date | Sun, 01 Apr 2007 05:22:43 +0000 |
parents | |
children | 390a65d28b53 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Makefile Sun Apr 01 05:22:43 2007 +0000 @@ -0,0 +1,40 @@ +ifneq ($(KERNELRELEASE),) + +obj-m := vloopback.o + +else + +KVER := $(shell uname -r) +KLINK := $(shell test -e /lib/modules/${KVER}/source/ && echo source || echo "build") +KSRC := /lib/modules/$(KVER)/$(KLINK) +PWD := $(shell pwd) +DEST := /lib/modules/$(KVER)/kernel/drivers/misc + +# Fix some problem with suse < 9.2 and suse >= 9.2 +is_suse := $(shell test -e /etc/SuSE-release && echo 1 || echo 0) +ifeq ($(is_suse),1) + suse_version := $(shell grep VERSION /etc/SuSE-release | cut -f 3 -d " "| tr -d .) + is_suse_92_or_greater := $(shell test $(suse_version) -ge 92 && echo 1) + ifeq ($(is_suse_92_or_greater),1) + KSRC := /lib/modules/$(KVER)/build + endif +endif + + + +all default: + $(MAKE) -C $(KSRC) SUBDIRS=$(PWD) modules + +install: + install -d $(DEST) + install -m 644 -c vloopback.ko $(DEST) + -/sbin/depmod -a + + +uninstall: + rm -f $(DEST)/vloopback.ko + -/sbin/depmod -a +clean: + rm -f .*.cmd *.o *.mod.c *.ko .v* *~ core + rm -rf .tmp_versions/ +endif