Author: Arno Töll <debian@toell.net>
Subject: Clean the Makefile from utils, not needed for the DKMS module
Last-Update: 08/17/2011
Forwarded: not-needed

The upstream Makefiles ship a combined Makefile to build both, the DKMS kernel
module, as well as the user space utilities. For Debian, those things a being
split into independent packages, where the DKMS module binary is built on the
installation site.
Hence its helpful, to remove references to the utils, which are not available or
required on the installation site.

* src/Makefile - Remove utils targets
* flashcache-wt/Makefile - ditto

--- a/flashcache-wt/src/Makefile
+++ b/flashcache-wt/src/Makefile
@@ -9,14 +9,11 @@
 
 all:
 	make -C $(KERNEL_TREE) M=$(PWD) modules
-	$(CC) $(UTILS_CFLAGS) -o utils/flashcache_wt_create utils/flashcache_wt_create.c
 
 install: all
 	install -o root -g root -m 0755 -d /lib/modules/$(KERNEL_SOURCE_VERSION)/extra/flashcache/
 	install -o root -g root -m 0755 flashcache-wt.ko /lib/modules/$(KERNEL_SOURCE_VERSION)/extra/flashcache/
 	depmod -a
-	install -o root -g root -m 0755 utils/flashcache_wt_create /sbin/
 
 clean:
 	make -C $(KERNEL_TREE) M=$(PWD) clean
-	rm -f utils/flashcache_wt_create
--- a/src/Makefile
+++ b/src/Makefile
@@ -1,4 +1,4 @@
-COMMIT_REV ?= $(shell git describe  --always --abbrev=12)
+COMMIT_REV ?= $(shell dpkg-query -W -f='$${Version}' flashcache-dkms | awk -F "-" '{print $$1}' | cut -d\: -f2)
 KERNEL_SOURCE_VERSION ?= $(shell uname -r)
 KERNEL_TREE ?= /lib/modules/$(KERNEL_SOURCE_VERSION)/build
 
@@ -28,7 +28,7 @@
 flashcache-objs := flashcache_conf.o flashcache_main.o flashcache_subr.o flashcache_ioctl.o flashcache_procfs.o flashcache_reclaim.o flashcache_kcopy.o
 
 .PHONY: all
-all: modules utils
+all: modules
 
 .PHONY:    modules
 modules: $(RHEL5_SETUP)
@@ -53,7 +53,7 @@
 	make -C ocf install
 
 .PHONY: install
-install: modules_install utils_install ocf_install
+install: modules_install ocf_install
 
 .PHONY: clean
 clean:
