nps: Makefile - don't depend on running kernel but on used sources

baggins baggins at pld-linux.org
Tue Jul 26 01:14:39 CEST 2005


Author: baggins                      Date: Mon Jul 25 23:14:39 2005 GMT
Module: nps                           Tag: HEAD
---- Log message:
- don't depend on running kernel but on used sources

---- Files affected:
nps:
   Makefile (1.1.1.1 -> 1.2) 

---- Diffs:

================================================================
Index: nps/Makefile
diff -u nps/Makefile:1.1.1.1 nps/Makefile:1.2
--- nps/Makefile:1.1.1.1	Mon Jul 25 21:42:48 2005
+++ nps/Makefile	Tue Jul 26 01:14:33 2005
@@ -1,7 +1,18 @@
-export KERNEL_MAJOR_VERSION = $(shell uname -r | sed 's/\([0-9]*\)\.[0-9]*\..*/\1/')
-export KERNEL_MINOR_VERSION = $(shell uname -r | sed 's/[0-9]*\.\([0-9]*\)\..*/\1/')
+KERNEL_DIR=/usr/src/linux
+
+KERNEL_MAJOR_VERSION=$(shell head -n 1 $(KERNEL_DIR)/Makefile | sed 's/VERSION = \([0-9]*\)/\1/')
+KERNEL_MINOR_VERSION=$(shell head -n 2 $(KERNEL_DIR)/Makefile | tail -n 1 | sed 's/PATCHLEVEL = \([0-9]*\)/\1/')
+
+ifeq ($(KERNEL_MAJOR_VERSION),2)
+  ifeq ($(KERNEL_MINOR_VERSION),6)
+    KERNEL_VER_2_6=1
+  else
+    KERNEL_VER_2_6=0
+  endif
+else
+  KERNEL_VER_2_6=0
+endif
 
-export KERNEL_VER_2_6  := $(shell uname -r | awk '{ if ($$0 ~ /2\.6\./) print "1"; else print "0"}')
 export PLATFORM_X86_64 := $(shell uname -m | awk '{ if ($$0 ~ /x86[-_]64/) print "1"; else print "0"}')
 
 SED_PWD=$(shell echo `pwd` | sed -e 's/\//\\\//g')
@@ -9,9 +20,15 @@
 .PHONY: copy_files
 
 all: copy_files
-	make -C jnet
-	@if [ $(KERNEL_VER_2_6) -eq 1 ] && [ $(PLATFORM_X86_64) -eq 1 ] ; then \
-	  echo "skipping nws_mc" ;\
+	@if [ $(KERNEL_VER_2_6) -eq 1 ] ; then \
+	  make -C $(KERNEL_DIR) M=$(shell echo `pwd`)/jnet modules ;\
+	else \
+	  make -C jnet ;\
+	fi
+	@if [ $(KERNEL_VER_2_6) -eq 1 ] ; then \
+	  if [ $(PLATFORM_X86_64) -eq 0 ] ; then \
+	    make -C $(KERNEL_DIR) M=$(shell echo `pwd`)/nws_mc modules ;\
+	  fi \
 	else \
 	  make -C nws_mc ;\
 	fi
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/nps/Makefile?r1=1.1.1.1&r2=1.2&f=u




More information about the pld-cvs-commit mailing list