Make kernel version default to the latest one we support in the Makefile
[transforward.git] / Makefile
index 2965572..78b34dd 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,15 @@
 obj-m += transforward.o
 
+KVER=$(shell uname -r)
+ARCH=$(shell uname -m)
+DIST=fc18 # Is there an easy way of fetching this automatically, short of mapping /etc/redhat-release
+
+ifeq ($(wildcard /lib/modules/$(KVER)/build),) 
+       KVER=3.10.6-100.$(DIST).$(KVER)
+endif
+
 all:
-       make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
+       make -C /lib/modules/$(KVER)/build M=$(PWD) modules
 
 clean:
-       make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
+       make -C /lib/modules/$(KVER)/build M=$(PWD) clean