Better modules_install targets.
authorFlorian Pose <fp@igh-essen.com>
Mon, 26 Jun 2006 14:20:36 +0000
changeset 281 c91bbf7bc52c
parent 280 35c99cdda518
child 282 b9f15748cade
Better modules_install targets.
Makefile
devices/Makefile
ethercat.conf.tmpl
master/Makefile
--- a/Makefile	Mon Jun 26 11:28:24 2006 +0000
+++ b/Makefile	Mon Jun 26 14:20:36 2006 +0000
@@ -1,7 +1,7 @@
 #------------------------------------------------------------------------------
 #
 #  Makefile
-#  
+#
 #  IgH EtherCAT master
 #
 #  $Id$
@@ -55,6 +55,7 @@
 
 KERNEL_DIR := /lib/modules/$(KERNEL)/build
 CURRENT_DIR := $(shell pwd)
+INSTALL_MOD_DIR := ethercat
 
 modules:
 	$(MAKE) -C $(KERNEL_DIR) M=$(CURRENT_DIR) modules
@@ -63,8 +64,8 @@
 	@script/install.sh $(KERNEL)
 
 modules_install:
-	$(MAKE) -C $(KERNEL_DIR) M=$(CURRENT_DIR)/master modules_install
-	$(MAKE) -C $(KERNEL_DIR) M=$(CURRENT_DIR)/devices modules_install
+	$(MAKE) -C $(KERNEL_DIR) M=$(CURRENT_DIR) \
+		INSTALL_MOD_DIR=$(INSTALL_MOD_DIR) modules_install
 
 clean: cleandoc
 	$(MAKE) -C $(KERNEL_DIR) M=$(CURRENT_DIR) clean
--- a/devices/Makefile	Mon Jun 26 11:28:24 2006 +0000
+++ b/devices/Makefile	Mon Jun 26 14:20:36 2006 +0000
@@ -61,6 +61,7 @@
 
 KERNEL_DIR := /lib/modules/$(KERNEL)/build
 CURRENT_DIR := $(shell pwd)
+INSTALL_MOD_DIR := ethercat/devices
 
 modules:
 	$(MAKE) -C $(KERNEL_DIR) M=$(CURRENT_DIR) modules
@@ -68,7 +69,8 @@
 install: modules_install
 
 modules_install:
-	$(MAKE) -C $(KERNEL_DIR) M=$(CURRENT_DIR) modules_install
+	$(MAKE) -C $(KERNEL_DIR) M=$(CURRENT_DIR) \
+		INSTALL_MOD_DIR=$(INSTALL_MOD_DIR) modules_install
 
 clean:
 	$(MAKE) -C $(KERNEL_DIR) M=$(CURRENT_DIR) clean
--- a/ethercat.conf.tmpl	Mon Jun 26 11:28:24 2006 +0000
+++ b/ethercat.conf.tmpl	Mon Jun 26 14:20:36 2006 +0000
@@ -12,6 +12,6 @@
 #
 # The kernel to compile the EtherCAT sources against
 #
-KERNEL := `uname -r`
+KERNEL := $(shell uname -r)
 
 #------------------------------------------------------------------------------
--- a/master/Makefile	Mon Jun 26 11:28:24 2006 +0000
+++ b/master/Makefile	Mon Jun 26 14:20:36 2006 +0000
@@ -62,6 +62,7 @@
 
 KERNEL_DIR := /lib/modules/$(KERNEL)/build
 CURRENT_DIR := $(shell pwd)
+INSTALL_MOD_DIR := ethercat/master
 
 modules:
 	$(MAKE) -C $(KERNEL_DIR) M=$(CURRENT_DIR) modules
@@ -69,7 +70,8 @@
 install: modules_install
 
 modules_install:
-	$(MAKE) -C $(KERNEL_DIR) M=$(CURRENT_DIR) modules_install
+	$(MAKE) -C $(KERNEL_DIR) M=$(CURRENT_DIR) \
+		INSTALL_MOD_DIR=$(INSTALL_MOD_DIR) modules_install
 
 clean:
 	$(MAKE) -C $(KERNEL_DIR) M=$(CURRENT_DIR) clean