Makefiles verbessert.
authorFlorian Pose <fp@igh-essen.com>
Fri, 06 Jan 2006 16:36:03 +0000
changeset 50 458e704afc6e
parent 49 3f8e769ca747
child 51 b3beaa00640f
Makefiles verbessert.
Makefile
drivers/Makefile
mini/Makefile
rt/Makefile
--- a/Makefile	Fri Jan 06 16:19:35 2006 +0000
+++ b/Makefile	Fri Jan 06 16:36:03 2006 +0000
@@ -29,7 +29,7 @@
 
 clean:
 	$(MAKE) -C $(KERNELDIR) M=`pwd` clean
-	rm -rvf */.tmp_versions
+	@rm -rf */.tmp_versions
 
 doc docs:
 	doxygen Doxyfile
--- a/drivers/Makefile	Fri Jan 06 16:19:35 2006 +0000
+++ b/drivers/Makefile	Fri Jan 06 16:36:03 2006 +0000
@@ -32,11 +32,17 @@
 #------------------------------------------------------------------------------
 # Default-Abschnitt
 
+ifneq ($(wildcard ethercat.conf),)
+include ethercat.conf
+else
+KERNELDIR = /lib/modules/`uname -r`/build
+endif
+
 modules:
-	$(MAKE) -C ..
+	$(MAKE) -C $(KERNELDIR) M=`pwd` modules
 
 clean:
-	$(MAKE) -C .. clean
+	$(MAKE) -C $(KERNELDIR) M=`pwd` clean
 
 #------------------------------------------------------------------------------
 
--- a/mini/Makefile	Fri Jan 06 16:19:35 2006 +0000
+++ b/mini/Makefile	Fri Jan 06 16:36:03 2006 +0000
@@ -24,11 +24,17 @@
 #----------------------------------------------------------------
 # Default-Abschnitt
 
+ifneq ($(wildcard ethercat.conf),)
+include ethercat.conf
+else
+KERNELDIR = /lib/modules/`uname -r`/build
+endif
+
 modules:
-	$(MAKE) -C ..
+	$(MAKE) -C $(KERNELDIR) M=`pwd` modules
 
 clean:
-	$(MAKE) -C .. clean
+	$(MAKE) -C $(KERNELDIR) M=`pwd` clean
 
 #----------------------------------------------------------------
 
--- a/rt/Makefile	Fri Jan 06 16:19:35 2006 +0000
+++ b/rt/Makefile	Fri Jan 06 16:36:03 2006 +0000
@@ -37,11 +37,17 @@
 #------------------------------------------------------------------------------
 # Default-Abschnitt
 
-default:
-	$(MAKE) -C ..
+ifneq ($(wildcard ethercat.conf),)
+include ethercat.conf
+else
+KERNELDIR = /lib/modules/`uname -r`/build
+endif
+
+modules:
+	$(MAKE) -C $(KERNELDIR) M=`pwd` modules
 
 clean:
-	$(MAKE) -C .. clean
+	$(MAKE) -C $(KERNELDIR) M=`pwd` clean
 
 #------------------------------------------------------------------------------