binary module build: use kernel headers from highest version
[deb_dpdk.git] / debian / rules
index 5899dd0..2d69b82 100755 (executable)
@@ -59,7 +59,7 @@ else
 ifneq (,$(filter ksrc=%,$(DEB_BUILD_OPTIONS)))
     KSRC := $(patsubst ksrc=%,%,$(filter ksrc=%,$(DEB_BUILD_OPTIONS)))
 else
-    KSRC := /lib/modules/$(shell uname -r)/build
+    KSRC := /lib/modules/$(shell LIST=$$(ls /lib/modules/); for dir in $$LIST; do test -d /lib/modules/$$dir/build && echo $$dir; done | sort -V | tail -n1)/build
 endif
 
 KVERS := $(shell perl debian/kernel-version $(KSRC))