Consistent Makefiles.
authorFlorian Pose <fp@igh-essen.com>
Fri, 02 Jun 2006 09:02:18 +0000
changeset 267 88177083f137
parent 266 0234b0c26c52
child 268 4f9c149fb71f
Consistent Makefiles.
devices/Makefile
examples/mini/Makefile
examples/msr/Makefile
examples/rtai/Makefile
master/Makefile
--- a/devices/Makefile	Fri Jun 02 08:38:04 2006 +0000
+++ b/devices/Makefile	Fri Jun 02 09:02:18 2006 +0000
@@ -44,7 +44,7 @@
 
 ec_8139too-objs := 8139too.o
 
-REV := $(shell svnversion $(src) 2>/dev/null)
+REV := $(shell svnversion $(src) 2>/dev/null || echo "unknown")
 
 EXTRA_CFLAGS = -DEC_REV=$(REV) -DEC_USER=$(USER)
 
@@ -61,13 +61,14 @@
 KERNEL := $(shell uname -r)
 endif
 
-KERNELDIR := /lib/modules/$(KERNEL)/build
+KERNEL_DIR := /lib/modules/$(KERNEL)/build
+CURRENT_DIR := $(shell pwd)
 
 modules:
-	$(MAKE) -C $(KERNELDIR) M=`pwd`
+	$(MAKE) -C $(KERNEL_DIR) M=$(CURRENT_DIR)
 
 clean:
-	$(MAKE) -C $(KERNELDIR) M=`pwd` clean
+	$(MAKE) -C $(KERNEL_DIR) M=$(CURRENT_DIR) clean
 
 #------------------------------------------------------------------------------
 
--- a/examples/mini/Makefile	Fri Jun 02 08:38:04 2006 +0000
+++ b/examples/mini/Makefile	Fri Jun 02 09:02:18 2006 +0000
@@ -56,14 +56,16 @@
 ifneq ($(wildcard kernel.conf),)
 include kernel.conf
 else
-KERNELDIR := /lib/modules/`uname -r`/build
+KERNEL_DIR := /lib/modules/`uname -r`/build
 endif
 
+CURRENT_DIR := $(shell pwd)
+
 modules:
-	$(MAKE) -C $(KERNELDIR) M=`pwd`
+	$(MAKE) -C $(KERNEL_DIR) M=$(CURRENT_DIR)
 
 clean:
-	$(MAKE) -C $(KERNELDIR) M=`pwd` clean
+	$(MAKE) -C $(KERNEL_DIR) M=$(CURRENT_DIR) clean
 
 #----------------------------------------------------------------
 
--- a/examples/msr/Makefile	Fri Jun 02 08:38:04 2006 +0000
+++ b/examples/msr/Makefile	Fri Jun 02 09:02:18 2006 +0000
@@ -75,13 +75,14 @@
 KERNEL := $(shell uname -r)
 endif
 
-KERNELDIR := /lib/modules/$(KERNEL)/build
+KERNEL_DIR := /lib/modules/$(KERNEL)/build
+CURRENT_DIR := $(shell pwd)
 
 modules:
-	$(MAKE) -C $(KERNELDIR) M=`pwd`
+	$(MAKE) -C $(KERNEL_DIR) M=$(CURRENT_DIR)
 
 clean:
-	$(MAKE) -C $(KERNELDIR) M=`pwd` clean
+	$(MAKE) -C $(KERNEL_DIR) M=$(CURRENT_DIR) clean
 
 install:
 	@./install.sh $(MODULE) $(KERNEL)
--- a/examples/rtai/Makefile	Fri Jun 02 08:38:04 2006 +0000
+++ b/examples/rtai/Makefile	Fri Jun 02 09:02:18 2006 +0000
@@ -58,14 +58,16 @@
 ifneq ($(wildcard kernel.conf),)
 include kernel.conf
 else
-KERNELDIR := /lib/modules/`uname -r`/build
+KERNEL_DIR := /lib/modules/`uname -r`/build
 endif
 
+CURRENT_DIR := $(shell pwd)
+
 modules:
-	$(MAKE) -C $(KERNELDIR) M=`pwd`
+	$(MAKE) -C $(KERNEL_DIR) M=$(CURRENT_DIR)
 
 clean:
-	$(MAKE) -C $(KERNELDIR) M=`pwd` clean
+	$(MAKE) -C $(KERNEL_DIR) M=$(CURRENT_DIR) clean
 
 #------------------------------------------------------------------------------
 
--- a/master/Makefile	Fri Jun 02 08:38:04 2006 +0000
+++ b/master/Makefile	Fri Jun 02 09:02:18 2006 +0000
@@ -45,7 +45,7 @@
 ec_master-objs := module.o master.o device.o slave.o command.o types.o \
 		domain.o mailbox.o canopen.o ethernet.o debug.o fsm.o
 
-REV := $(shell svnversion $(src) 2>/dev/null)
+REV := $(shell svnversion $(src) 2>/dev/null || echo "unknown")
 
 EXTRA_CFLAGS := -DSVNREV=$(REV) -DUSER=$(USER)
 
@@ -62,13 +62,14 @@
 KERNEL := $(shell uname -r)
 endif
 
-KERNELDIR := /lib/modules/$(KERNEL)/build
+KERNEL_DIR := /lib/modules/$(KERNEL)/build
+CURRENT_DIR := $(shell pwd)
 
 modules:
-	$(MAKE) -C $(KERNELDIR) M=`pwd`
+	$(MAKE) -C $(KERNEL_DIR) M=$(CURRENT_DIR)
 
 clean:
-	$(MAKE) -C $(KERNELDIR) M=`pwd` clean
+	$(MAKE) -C $(KERNEL_DIR) M=$(CURRENT_DIR) clean
 
 #------------------------------------------------------------------------------